Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_menu.c ewl_context_menu.c ewl_context_menu.h 


Log Message:
grab the mouse events when the popup gets focused

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_menu.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- ewl_menu.c  7 Mar 2007 09:13:51 -0000       1.46
+++ ewl_menu.c  8 Mar 2007 00:31:21 -0000       1.47
@@ -240,6 +240,8 @@
                cm = EWL_CONTEXT_MENU(item->inmenu);
                cm->open_menu = EWL_WIDGET(menu);
        }
+       else
+               ewl_widget_focus_send(menu->popup);
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -289,9 +291,12 @@
        DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
 
        menu = EWL_MENU(w);
-       if (menu->popup)
-               ewl_callback_del(menu->popup, EWL_CALLBACK_DESTROY, 
-                                               ewl_menu_cb_popup_destroy);
+       if (menu->popup) {
+               ewl_callback_del(menu->popup, EWL_CALLBACK_DESTROY,
+                                               ewl_menu_cb_popup_destroy);     
+               ewl_widget_destroy(menu->popup);
+               menu->popup = NULL;
+       }
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_context_menu.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_context_menu.c  7 Mar 2007 09:13:51 -0000       1.4
+++ ewl_context_menu.c  8 Mar 2007 00:31:21 -0000       1.5
@@ -85,6 +85,8 @@
                                ewl_context_menu_cb_mouse_move, NULL);
        ewl_callback_append(w, EWL_CALLBACK_HIDE, 
                                ewl_context_menu_cb_hide, NULL);
+       ewl_callback_append(w, EWL_CALLBACK_FOCUS_IN, 
+                               ewl_context_menu_cb_focus_in, NULL);
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
@@ -316,6 +318,27 @@
 
                } while (EWL_POPUP_IS(popup));
        }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @internal
+ * @param w: The widget to work with
+ * @param ev_data: UNUSED
+ * @param user_data: UNUSED
+ * @return Returns no value
+ * @brief The focus in callback
+ */
+void 
+ewl_context_menu_cb_focus_in(Ewl_Widget *w, void *ev_data __UNUSED__, 
+                               void *user_data __UNUSED__)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, EWL_WIDGET_TYPE);
+
+       ewl_context_menu_grabber_set(EWL_CONTEXT_MENU(w));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_context_menu.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_context_menu.h  6 Mar 2007 23:10:16 -0000       1.2
+++ ewl_context_menu.h  8 Mar 2007 00:31:21 -0000       1.3
@@ -58,6 +58,8 @@
                                                        void *user_data);
 void ewl_context_menu_cb_mouse_move(Ewl_Widget *w, void *ev_data, 
                                                        void *user_data);
+void ewl_context_menu_cb_focus_in(Ewl_Widget *w, void *ev_data, 
+                                                       void *user_data);
 void ewl_context_menu_cb_attach_mouse_down(Ewl_Widget *w, void *ev_data, 
                                                        void *user_data);
 void ewl_context_menu_cb_child_add(Ewl_Container *c, Ewl_Widget *w);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to