ecore-wl2: preserve data selection source after receiving the selection
authorMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 25 Apr 2016 20:14:02 +0000 (16:14 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Mon, 25 Apr 2016 20:15:59 +0000 (16:15 -0400)
this is copied from weston, except all the code which is supposed to be of
struct type "offer" has been renamed "source" and then reused in the same way
that weston uses "offer" in order to maximize reader confusion

deleting the source here is invalid since the selection only changes in the
corresponding callback from the wayland interface

src/lib/ecore_wl2/ecore_wl2_dnd.c

index 4762621..2e4765c 100644 (file)
@@ -240,9 +240,10 @@ _selection_data_read(void *data, Ecore_Fd_Handler *fdh)
                WL_DATA_OFFER_FINISH_SINCE_VERSION)
                wl_data_offer_finish(source->offer);
           }
-        if (source->input->selection.source == source)
-          source->input->selection.source = NULL;
-        _ecore_wl2_dnd_del(source);
+        close(ecore_main_fd_handler_fd_get(source->fdh));
+        ecore_main_fd_handler_del(source->fdh);
+        source->fdh = NULL;
+
         event->done = EINA_TRUE;
         event->data = NULL;
         event->len = 0;