discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=bf4c5452f38ff2fa8c090452bdb90a999dd57ebd

commit bf4c5452f38ff2fa8c090452bdb90a999dd57ebd
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Mon Aug 10 16:29:11 2015 -0400

    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 2bd81a4..c55d163 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 7042a7d..3dc4a1b 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 269bbc4..68f6e52 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;
 }
 

-- 


Reply via email to