track xwl clipboard owner

This commit is contained in:
Mike Blumenkrantz 2015-08-10 16:29:11 -04:00
parent 2e000a45dc
commit bf4c5452f3
3 changed files with 11 additions and 2 deletions

View File

@ -200,6 +200,7 @@ struct _E_Comp_Wl_Data
{
void *source;
struct wl_listener listener;
E_Client *xwl_owner;
} clipboard;
struct

View File

@ -236,6 +236,7 @@ _e_comp_wl_data_device_selection_set(void *data EINA_UNUSED, E_Comp_Wl_Data_Sour
}
e_comp->wl_comp_data->selection.data_source = sel_source = source;
e_comp->wl_comp_data->clipboard.xwl_owner = NULL;
e_comp->wl_comp_data->selection.serial = serial;
if (e_comp->wl_comp_data->kbd.enabled)

View File

@ -131,7 +131,11 @@ _xwayland_cancelled_send(E_Comp_Wl_Data_Source *source)
static Eina_Bool
_xwl_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Fixes_Selection_Notify *ev)
{
if (ev->owner == e_comp->cm_selection) return ECORE_CALLBACK_RENEW;
if (ev->owner == e_comp->cm_selection)
{
e_comp->wl_comp_data->clipboard.xwl_owner = NULL;
return ECORE_CALLBACK_RENEW;
}
if (ev->atom == ECORE_X_ATOM_SELECTION_XDND)
{
if (ev->owner)
@ -201,7 +205,10 @@ _xwl_fixes_selection_notify(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Even
e_screensaver_inhibit_toggle(!!ev->owner);
return ECORE_CALLBACK_RENEW;
}
//if (ev->atom == ECORE_X_ATOM_SELECTION_CLIPBOARD)
if (ev->atom == ECORE_X_ATOM_SELECTION_CLIPBOARD)
{
e_comp->wl_comp_data->clipboard.xwl_owner = ev->owner ? e_pixmap_find_client(E_PIXMAP_TYPE_X, ev->owner) : NULL;
}
return ECORE_CALLBACK_RENEW;
}