discomfitor pushed a commit to branch enlightenment-0.19.

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

commit b0df36d59572067e09a4cbe7f6280110eedc97dc
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Wed Jul 1 15:51:46 2015 -0400

    ensure x11 focus grabs are applied on client init when needed
---
 src/bin/e_comp_x.c | 39 +++++++++++++++++++++++++--------------
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index 0b18bb9..f96bce7 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -117,13 +117,8 @@ _e_comp_x_print_win(Ecore_X_Window win)
 }
 
 static void
-_e_comp_x_focus_setup(E_Client *ec)
+_e_comp_x_focus_grab(E_Client *ec)
 {
-   if (ec->comp_data->button_grabbed) return;
-   if ((!e_client_focus_policy_click(ec)) ||
-       (e_config->always_click_to_raise) ||
-       (e_config->always_click_to_focus)) return;
-        
    ecore_x_window_button_grab(e_client_util_win_get(ec), 1,
                               ECORE_X_EVENT_MASK_MOUSE_DOWN |
                               ECORE_X_EVENT_MASK_MOUSE_UP |
@@ -139,6 +134,26 @@ _e_comp_x_focus_setup(E_Client *ec)
    ec->comp_data->button_grabbed = 1;
 }
 
+static void
+_e_comp_x_focus_init(E_Client *ec)
+{
+   if (ec->comp_data->button_grabbed) return;
+   if (!((e_client_focus_policy_click(ec)) ||
+       (e_config->always_click_to_raise) ||
+       (e_config->always_click_to_focus))) return;
+   _e_comp_x_focus_grab(ec);
+}
+
+static void
+_e_comp_x_focus_setup(E_Client *ec)
+{
+   if (ec->comp_data->button_grabbed) return;
+   if ((!e_client_focus_policy_click(ec)) ||
+       (e_config->always_click_to_raise) ||
+       (e_config->always_click_to_focus)) return;
+   _e_comp_x_focus_grab(ec);
+}
+
 
 static void
 _e_comp_x_focus_setdown(E_Client *ec)
@@ -2789,14 +2804,9 @@ _e_comp_x_hook_client_pre_frame_assign(void *d 
EINA_UNUSED, E_Client *ec)
         ecore_x_window_show(pwin);
      }
 
-   if (ec->focused)
-     _e_comp_x_focus_setdown(ec);
-   else
-     {
-        _e_comp_x_focus_setup(ec);
-        e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win);
-        e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win);
-     }
+   _e_comp_x_focus_init(ec);
+   e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, win);
+   e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, win);
    _e_comp_x_client_evas_init(ec);
    if (ec->netwm.ping && (!ec->ping_poller))
      e_client_ping(ec);
@@ -4813,6 +4823,7 @@ _e_comp_x_bindings_grab_cb(E_Comp *c)
    EINA_LIST_FOREACH(c->clients, l, ec)
      {
         if (e_client_util_ignored_get(ec)) continue;
+        _e_comp_x_focus_init(ec);
         if (ec->focused)
           _e_comp_x_focus_setdown(ec);
         else

-- 


Reply via email to