From aa1768a9d9d12812928961e7e302005fbfc4e6fa Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Sat, 18 Jun 2016 10:54:23 -0400 Subject: [PATCH] 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 4c05e14bf..7d077ab14 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 a9432a979..9b4e148d1 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); }