track xwl clipboard owner
authorMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 10 Aug 2015 20:29:11 +0000 (16:29 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 10 Aug 2015 22:59:02 +0000 (18:59 -0400)
src/bin/e_comp_wl.h
src/bin/e_comp_wl_data.c
src/modules/xwayland/dnd.c

index 2bd81a4..c55d163 100644 (file)
@@ -200,6 +200,7 @@ struct _E_Comp_Wl_Data
      {
         void *source;
         struct wl_listener listener;
+        E_Client *xwl_owner;
      } clipboard;
 
    struct
index 7042a7d..3dc4a1b 100644 (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)
index 269bbc4..68f6e52 100644 (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;
 }