discomfitor pushed a commit to branch master.

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

commit aa1768a9d9d12812928961e7e302005fbfc4e6fa
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Sat Jun 18 10:54:23 2016 -0400

    enforce mouse grabs and block client/compositor event propagation while 
active
    
    fixes cases where mouse events could filter to objects and cause unwanted 
effects,
    such as evry hiding randomly under wayland
---
 src/bin/e_comp_canvas.c | 8 ++++----
 src/bin/e_comp_object.c | 4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index 4c05e14..7d077ab 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -72,7 +72,7 @@ _e_comp_canvas_cb_mouse_in(void *d EINA_UNUSED, Evas *e 
EINA_UNUSED, Evas_Object
    E_Client *ec;
 
    e_screensaver_notidle();
-   if (e_client_action_get()) return;
+   if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
    ec = e_client_focused_get();
    if (ec && (!ec->border_menu)) e_focus_event_mouse_out(ec);
 }
@@ -81,7 +81,7 @@ static void
 _e_comp_canvas_cb_mouse_down(void *d EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED, void *event_info)
 {
    e_screensaver_notidle();
-   if (e_client_action_get()) return;
+   if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
    e_bindings_mouse_down_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, 
E_OBJECT(e_comp), event_info);
 }
 
@@ -89,7 +89,7 @@ static void
 _e_comp_canvas_cb_mouse_up(void *d EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED, void *event_info)
 {
    e_screensaver_notidle();
-   if (e_client_action_get()) return;
+   if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
    e_bindings_mouse_up_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, 
E_OBJECT(e_comp), event_info);
 }
 
@@ -97,7 +97,7 @@ static void
 _e_comp_canvas_cb_mouse_wheel(void *d EINA_UNUSED, Evas *e EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED, void *event_info)
 {
    e_screensaver_notidle();
-   if (e_client_action_get()) return;
+   if (e_client_action_get() || e_grabinput_mouse_win_get()) return;
    e_bindings_wheel_evas_event_handle(E_BINDING_CONTEXT_COMPOSITOR, 
E_OBJECT(e_comp), event_info);
 }
 
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c
index a9432a9..9b4e148 100644
--- a/src/bin/e_comp_object.c
+++ b/src/bin/e_comp_object.c
@@ -405,6 +405,8 @@ _e_comp_object_cb_mouse_in(void *data, Evas *e EINA_UNUSED, 
Evas_Object *obj, vo
         if (E_INSIDE(ev->output.x, ev->output.y, cw->ec->client.x, 
cw->ec->client.y,
             cw->ec->client.w, cw->ec->client.h)) return;
      }
+   if (e_grabinput_mouse_win_get() && (e_grabinput_mouse_win_get() != 
e_client_util_win_get(cw->ec)))
+     return;
    e_client_mouse_in(cw->ec, ev->output.x, ev->output.y);
 }
 
@@ -415,6 +417,8 @@ _e_comp_object_cb_mouse_out(void *data, Evas *e 
EINA_UNUSED, Evas_Object *obj EI
    Evas_Event_Mouse_Out *ev = event_info;
    E_Comp_Object *cw = data;
 
+   if (e_grabinput_mouse_win_get() && (e_grabinput_mouse_win_get() != 
e_client_util_win_get(cw->ec)))
+     return;
    e_client_mouse_out(cw->ec, ev->output.x, ev->output.y);
 }
 

-- 


Reply via email to