From e3f829ace78419ef91997d3637f048dd2a399de2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 19 Jan 2016 13:49:10 -0500 Subject: [PATCH] more correctly handle evry mouse detection on wayland in this case, mouse events which are not originating from the internal window are for the screen, and these coords can be used for determining "mouse out". if the mouse event comes from the window, it is inside the window. ref 7c661b54a94351717201ac18f4c79a44a3207320 --- src/modules/everything/evry.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/modules/everything/evry.c b/src/modules/everything/evry.c index 959f7767a..eed3f8cf3 100644 --- a/src/modules/everything/evry.c +++ b/src/modules/everything/evry.c @@ -890,7 +890,7 @@ _evry_cb_mouse(void *data, int type, void *event) if (!win->grab) return ECORE_CALLBACK_PASS_ON; - if ((win->grab && (ev->event_window != ecore_evas_window_get(e_comp->ee))) && + if ((ev->event_window != ecore_evas_window_get(e_comp->ee)) && (ev->event_window != elm_win_window_id_get(win->ewin))) return ECORE_CALLBACK_PASS_ON; @@ -954,12 +954,20 @@ _evry_cb_mouse(void *data, int type, void *event) { win->mouse_out = 0; - if (!E_INSIDE(e_comp_canvas_x_root_adjust(ev->root.x), - e_comp_canvas_y_root_adjust(ev->root.y), x, y, w, h)) + if (e_comp->comp_type == E_PIXMAP_TYPE_WL) { - win->mouse_out = 1; - return ECORE_CALLBACK_PASS_ON; + if (ev->event_window == ecore_evas_window_get(e_comp->ee)) + { + if (!E_INSIDE(e_comp_canvas_x_root_adjust(ev->root.x), + e_comp_canvas_y_root_adjust(ev->root.y), x, y, w, h)) + win->mouse_out = 1; + } } + else if (!E_INSIDE(e_comp_canvas_x_root_adjust(ev->root.x), + e_comp_canvas_y_root_adjust(ev->root.y), x, y, w, h)) + win->mouse_out = 1; + if (win->mouse_out) + return ECORE_CALLBACK_PASS_ON; win->mouse_button = ev->buttons; } @@ -967,9 +975,7 @@ _evry_cb_mouse(void *data, int type, void *event) { win->mouse_button = 0; - if (win->mouse_out && - (!E_INSIDE(e_comp_canvas_x_root_adjust(ev->root.x), - e_comp_canvas_y_root_adjust(ev->root.y), x, y, w, h))) + if (win->mouse_out) { evry_hide(win, 0); return ECORE_CALLBACK_PASS_ON;