Enlightenment CVS committal

Author  : lordchaos
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_menu.c 


Log Message:
* Make single-mouse-down click work with new menu style (Also only feed mouse 
move events to parent embed when mouse is *not* over active menu)

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- ewl_menu.c  7 Jan 2006 06:45:23 -0000       1.20
+++ ewl_menu.c  7 Jan 2006 12:27:46 -0000       1.21
@@ -234,8 +234,10 @@
        Ewl_Event_Mouse_Move* ev;
        Ewl_Menu* menu;
        Ewl_Embed* embed;
+       Ewl_Embed* menu_embed;
        int wx, wy;
        int x, y;
+       int width,height;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
@@ -246,11 +248,17 @@
        menu = EWL_MENU(user_data);
        
        embed = ewl_embed_widget_find(EWL_WIDGET(menu)->parent);
+       menu_embed = ewl_embed_widget_find(EWL_WIDGET(menu->base.popup));
        ewl_window_position_get(EWL_WINDOW(embed), &wx, &wy);
        ewl_window_position_get(EWL_WINDOW(menu->base.popup), &x, &y);
-       
-       if (menu->menubar_parent) {
-               ewl_embed_mouse_move_feed(embed, ev->x+x - wx, ev->y+y - wy,0);
+       ewl_object_current_size_get(EWL_OBJECT(menu->base.popup), &width, 
&height);
+
+       if (ev->x+x > x && ev->y+y > y && ev->x+x < x+width && ev->y+y < 
y+height) {
+               if (ewl_embed_active_embed_get() != menu_embed)
+                       ewl_embed_active_set(menu_embed,1);
+       } else {
+               if (menu->menubar_parent) 
+                       ewl_embed_mouse_move_feed(embed, ev->x+x - wx, ev->y+y 
- wy,0);
        }
 }
 




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to