diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-06-24 11:29:11 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-06-24 11:31:02 -0400 |
commit | cefcc5248fb99a9c26db95910f4df3e0339c0722 (patch) | |
tree | 440a32c877c86ebb8790f8c34d419f777df5f5d6 | |
parent | 4852a6903b75e6db3eb61af5df9f58b939855f8a (diff) | |
download | enlightenment-cefcc5248fb99a9c26db95910f4df3e0339c0722.tar.gz |
add some hacks to route mouse events to wl popups correctly while mouse is down
in a choice between fixing a corner case popup behavior and breaking dnd
or having functional dnd and adding hacks to fix corner case popup behavior,
adding more hacks was the obvious correct solution
ref 03a4ecbdb0972f8267c07ea14d752fcee69bd9fa
-rw-r--r-- | src/bin/e_comp_wl.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index d97dd096cf..983e461501 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -284,7 +284,55 @@ _e_comp_wl_send_mouse_move(E_Client *ec, int x, int y, unsigned int timestamp) struct wl_resource *res; struct wl_client *wc; Eina_List *l; - + E_Client *tec, *tec_in = NULL; + Eina_Bool found = EINA_FALSE; + Evas_Event_Mouse_In ev; + + /* begin hacks: + * + * this should be handled by setting NOGRAB pointer mode on comp object internals, + * ie. 03a4ecbdb0972f8267c07ea14d752fcee69bd9fa + * but doing so breaks dnd eventing. + * + * instead, walk the transients list, assuming (correctly) that they are listed from + * bottom to top, and send mouse events to whichever surface the pointer is in + */ + ev.canvas.x = x; + ev.canvas.y = y; + EINA_LIST_FOREACH(ec->transients, l, tec) + { + if (e_client_util_ignored_get(tec) || (!evas_object_visible_get(tec->frame))) + continue; + if (tec->mouse.in) tec_in = tec; + if (E_INSIDE(x, y, tec->x, tec->y, tec->w, tec->h)) + { + if (tec_in && (tec != tec_in)) + { + e_client_mouse_out(tec_in, x, y); + _e_comp_wl_mouse_out(tec_in); + tec_in = NULL; + } + e_client_mouse_in(tec, x, y); + _e_comp_wl_mouse_in(tec, &ev); + e_client_mouse_move(tec, &(Evas_Point){x, y}); + _e_comp_wl_send_mouse_move(tec, x, y, timestamp); + found = EINA_TRUE; + } + else if (tec->mouse.in) + { + e_client_mouse_out(tec, x, y); + _e_comp_wl_mouse_out(tec); + } + } + if (found) return; + /* if a transient previously had mouse.in, re-set mouse.in to the parent */ + if (tec_in) + { + e_client_mouse_in(ec, x, y); + _e_comp_wl_mouse_in(ec, &ev); + e_client_mouse_move(ec, &(Evas_Point){x, y}); + } + /* end hacks */ wc = wl_resource_get_client(ec->comp_data->surface); EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res) { |