discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=a117c977dd79b12fd1f1e8b5841af56c1c00315c

commit a117c977dd79b12fd1f1e8b5841af56c1c00315c
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Feb 24 14:15:42 2017 -0500

    e_menu_grab_window_get() -> e_menu_is_active()
    
    0 is a valid canvas window id, and this function was no longer being used
    for its original purpose
---
 src/bin/e_comp.c    |  4 ++--
 src/bin/e_comp_wl.c |  4 ++--
 src/bin/e_menu.c    | 16 ++++++++--------
 src/bin/e_menu.h    |  2 +-
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c
index 6fe65a0..ad7186c 100644
--- a/src/bin/e_comp.c
+++ b/src/bin/e_comp.c
@@ -1732,13 +1732,13 @@ e_comp_ungrab_input(Eina_Bool mouse, Eina_Bool kbd)
 E_API Eina_Bool
 e_comp_util_kbd_grabbed(void)
 {
-   return e_menu_grab_window_get() || e_client_action_get() || 
e_grabinput_key_win_get();
+   return e_menu_is_active() || e_client_action_get() || 
e_grabinput_key_win_get();
 }
 
 E_API Eina_Bool
 e_comp_util_mouse_grabbed(void)
 {
-   return e_menu_grab_window_get() || e_client_action_get() || 
e_grabinput_mouse_win_get();
+   return e_menu_is_active() || e_client_action_get() || 
e_grabinput_mouse_win_get();
 }
 
 E_API void
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index e636ce9..10083d2 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -3252,7 +3252,7 @@ e_comp_wl_key_down(Ecore_Event_Key *ev)
    *k = keycode;
 
    if ((!e_client_action_get()) && (!e_comp->input_key_grabs) &&
-       (!e_menu_grab_window_get()))
+       (!e_menu_is_active()))
      {
         ec = e_client_focused_get();
         if (ec && ec->comp_data->surface && e_comp_wl->kbd.focused)
@@ -3302,7 +3302,7 @@ e_comp_wl_key_up(Ecore_Event_Key *ev)
      (const char *)end - (const char *)e_comp_wl->kbd.keys.data;
 
    if ((!e_client_action_get()) && (!e_comp->input_key_grabs) &&
-       (!e_menu_grab_window_get()))
+       (!e_menu_is_active()))
      {
         ec = e_client_focused_get();
 
diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c
index cf686ca..56f93ac 100644
--- a/src/bin/e_menu.c
+++ b/src/bin/e_menu.c
@@ -83,7 +83,7 @@ static void         _e_menu_category_free_cb(E_Menu_Category 
*cat);
 static void         _e_menu_cb_mouse_evas_down(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED);
 
 /* local subsystem globals */
-static Ecore_Window _e_menu_win = 0;
+static Ecore_Window _e_menu_win = UINT_MAX;
 static Eina_List *_e_active_menus = NULL;
 static E_Menu_Item *_e_active_menu_item = NULL;
 static E_Menu_Item *_e_prev_active_menu_item = NULL;
@@ -1182,19 +1182,19 @@ e_menu_idler_before(void)
 
    if (!_e_active_menus)
      {
-        if (_e_menu_win)
+        if (_e_menu_win == e_comp->ee_win)
           {
              e_comp_ungrab_input(1, 1);
-             _e_menu_win = 0;
+             _e_menu_win = UINT_MAX;
              e_bindings_disabled_set(0);
           }
      }
 }
 
-E_API Ecore_Window
-e_menu_grab_window_get(void)
+E_API Eina_Bool
+e_menu_is_active(void)
 {
-   return _e_menu_win;
+   return _e_menu_win == e_comp->ee_win;
 }
 
 /* local subsystem functions */
@@ -1873,12 +1873,12 @@ _e_menu_activate_internal(E_Menu *m, E_Zone *zone)
      m->pre_activate_cb.func(m->pre_activate_cb.data, m);
    m->fast_mouse = 0;
    m->pending_new_submenu = 0;
-   if (!_e_menu_win)
+   if (_e_menu_win != e_comp->ee_win)
      {
         _e_menu_win = e_comp->ee_win;
         if (!e_comp_grab_input(1, 1))
           {
-             _e_menu_win = 0;
+             _e_menu_win = UINT_MAX;
              return;
           }
         e_bindings_disabled_set(1);
diff --git a/src/bin/e_menu.h b/src/bin/e_menu.h
index 7ad3da4..3432010 100644
--- a/src/bin/e_menu.h
+++ b/src/bin/e_menu.h
@@ -203,7 +203,7 @@ E_API void         e_menu_item_disabled_set(E_Menu_Item 
*mi, int disable);
 
 E_API void         e_menu_idler_before(void);
 
-E_API Ecore_Window e_menu_grab_window_get(void);
+E_API Eina_Bool    e_menu_is_active(void);
 
 #endif
 #endif

-- 


Reply via email to