summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-06-18 10:54:23 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-06-18 10:56:14 -0400
commitaa1768a9d9d12812928961e7e302005fbfc4e6fa (patch)
tree10620a915fb426b24397ba15c88c320ea67a749e
parent4bd97bfd5c1122c340984e07709d4ca70c8e7ea5 (diff)
downloadenlightenment-aa1768a9d9d12812928961e7e302005fbfc4e6fa.tar.gz
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
-rw-r--r--src/bin/e_comp_canvas.c8
-rw-r--r--src/bin/e_comp_object.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index 4c05e14bff..7d077ab147 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 a9432a9792..9b4e148d1a 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);
}