From bf4c5452f38ff2fa8c090452bdb90a999dd57ebd Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 10 Aug 2015 16:29:11 -0400 Subject: [PATCH] track xwl clipboard owner --- src/bin/e_comp_wl.h | 1 + src/bin/e_comp_wl_data.c | 1 + src/modules/xwayland/dnd.c | 11 +++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 2bd81a4ed..c55d163f8 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -200,6 +200,7 @@ struct _E_Comp_Wl_Data { void *source; struct wl_listener listener; + E_Client *xwl_owner; } clipboard; struct diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c index 7042a7d44..3dc4a1b20 100644 --- a/src/bin/e_comp_wl_data.c +++ b/src/bin/e_comp_wl_data.c @@ -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) diff --git a/src/modules/xwayland/dnd.c b/src/modules/xwayland/dnd.c index 269bbc46b..68f6e522f 100644 --- a/src/modules/xwayland/dnd.c +++ b/src/modules/xwayland/dnd.c @@ -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; }