forked from enlightenment/enlightenment
make pager kbd/mouse grabs more effective in wayland compositors
use the same codepaths as x11 compositors, but explicitly grab the compositor canvas
This commit is contained in:
parent
86d5d318fa
commit
2edd687800
|
@ -1285,7 +1285,10 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
|
|||
e_comp_object_effect_unclip(pw->client->frame);
|
||||
if (act_popup)
|
||||
{
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
e_grabinput_get(input_window, 0, input_window);
|
||||
else
|
||||
e_comp_grab_input(1, 1);
|
||||
if (!hold_count) _pager_popup_hide(1);
|
||||
}
|
||||
}
|
||||
|
@ -1642,7 +1645,10 @@ _pager_desk_cb_drag_finished(E_Drag *drag, int dropped)
|
|||
|
||||
if (act_popup)
|
||||
{
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
e_grabinput_get(input_window, 0, input_window);
|
||||
else
|
||||
e_comp_grab_input(1, 1);
|
||||
if (!hold_count) _pager_popup_hide(1);
|
||||
}
|
||||
}
|
||||
|
@ -1672,13 +1678,21 @@ _pager_popup_cb_timeout(void *data)
|
|||
_pager_popup_free(pp);
|
||||
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
if (input_window)
|
||||
{
|
||||
ecore_x_window_free(input_window);
|
||||
e_grabinput_release(input_window, input_window);
|
||||
ecore_x_window_free(input_window);
|
||||
input_window = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
e_comp_ungrab_input(1, 1);
|
||||
input_window = 0;
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
@ -1705,6 +1719,8 @@ _pager_popup_show(void)
|
|||
if (pp) _pager_popup_free(pp);
|
||||
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
input_window = ecore_x_window_input_new(e_comp->win, 0, 0, 1, 1);
|
||||
ecore_x_window_show(input_window);
|
||||
if (!e_grabinput_get(input_window, 0, input_window))
|
||||
|
@ -1713,7 +1729,13 @@ _pager_popup_show(void)
|
|||
input_window = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
input_window = e_comp->ee_win;
|
||||
e_comp_grab_input(1, 1);
|
||||
}
|
||||
|
||||
handlers = eina_list_append
|
||||
(handlers, ecore_event_handler_add
|
||||
|
|
|
@ -2028,7 +2028,10 @@ _pager_window_cb_drag_finished(E_Drag *drag, int dropped)
|
|||
e_comp_object_effect_unclip(pw->client->frame);
|
||||
if (act_popup)
|
||||
{
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
e_grabinput_get(input_window, 0, input_window);
|
||||
else
|
||||
e_comp_grab_input(1, 1);
|
||||
if (!hold_count) _pager_popup_hide(1);
|
||||
}
|
||||
}
|
||||
|
@ -2389,7 +2392,10 @@ _pager_desk_cb_drag_finished(E_Drag *drag, int dropped)
|
|||
|
||||
if (act_popup)
|
||||
{
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
e_grabinput_get(input_window, 0, input_window);
|
||||
else
|
||||
e_comp_grab_input(1, 1);
|
||||
if (!hold_count) _pager_popup_hide(1);
|
||||
}
|
||||
}
|
||||
|
@ -2419,13 +2425,21 @@ _pager_popup_cb_timeout(void *data)
|
|||
_pager_popup_free(pp);
|
||||
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
if (input_window)
|
||||
{
|
||||
ecore_x_window_free(input_window);
|
||||
e_grabinput_release(input_window, input_window);
|
||||
ecore_x_window_free(input_window);
|
||||
input_window = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
e_comp_ungrab_input(1, 1);
|
||||
input_window = 0;
|
||||
}
|
||||
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
|
@ -2452,6 +2466,8 @@ _pager_popup_show(void)
|
|||
if (pp) _pager_popup_free(pp);
|
||||
|
||||
#ifndef HAVE_WAYLAND_ONLY
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_X)
|
||||
{
|
||||
input_window = ecore_x_window_input_new(e_comp->win, 0, 0, 1, 1);
|
||||
ecore_x_window_show(input_window);
|
||||
if (!e_grabinput_get(input_window, 0, input_window))
|
||||
|
@ -2460,7 +2476,13 @@ _pager_popup_show(void)
|
|||
input_window = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (e_comp->comp_type == E_PIXMAP_TYPE_WL)
|
||||
{
|
||||
input_window = e_comp->ee_win;
|
||||
e_comp_grab_input(1, 1);
|
||||
}
|
||||
|
||||
handlers = eina_list_append
|
||||
(handlers, ecore_event_handler_add
|
||||
|
|
Loading…
Reference in New Issue