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 7c661b54a9
This commit is contained in:
Mike Blumenkrantz 2016-01-19 13:49:10 -05:00
parent 0a2442d3b7
commit e3f829ace7
1 changed files with 14 additions and 8 deletions

View File

@ -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;