Generate Ecore event for selection clear
authorxcomputerman <xcomputerman>
Wed, 14 Jan 2004 04:43:51 +0000 (04:43 +0000)
committerxcomputerman <xcomputerman@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 14 Jan 2004 04:43:51 +0000 (04:43 +0000)
SVN revision: 8397

legacy/ecore/src/lib/ecore_x/Ecore_X.h
legacy/ecore/src/lib/ecore_x/ecore_x_events.c

index 76e8d23dca7eda12fdeabe59e450a8f30b4d0795..48796bed7848277bea4e0625dcad2c0845e9ae1f 100644 (file)
@@ -359,8 +359,9 @@ struct _Ecore_X_Event_Window_Colormap
 
 struct _Ecore_X_Event_Selection_Clear
 {
-   Ecore_X_Window  win;
-   Ecore_X_Time    time;
+   Ecore_X_Window    win;
+   Ecore_X_Selection selection;
+   Ecore_X_Time      time;
 };
 
 struct _Ecore_X_Event_Selection_Request
index 62293a4c38fddd9fe7051abebd0abd72797f74fb..c40ce8442474d6ec75c8105b961d9d4fb16bebfd 100644 (file)
@@ -849,6 +849,8 @@ void
 _ecore_x_event_handle_selection_clear(XEvent *xevent)
 {
    Ecore_X_Selection_Data *d;
+   Ecore_X_Event_Selection_Clear *e;
+   Atom sel;
 
    if(!(d = _ecore_x_selection_get(xevent->xselectionclear.selection)))
       return;
@@ -857,6 +859,20 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent)
       _ecore_x_selection_set(None, NULL, 0, 
             xevent->xselectionclear.selection);
    }
+
+   /* Generate event for app cleanup */
+   e = malloc(sizeof(Ecore_X_Event_Selection_Clear));
+   e->win = xevent->xselectionclear.window;
+   e->time = xevent->xselectionclear.time;
+   sel = xevent->xselectionclear.selection;
+   if (sel == _ecore_x_atom_selection_primary)
+      e->selection = ECORE_X_SELECTION_PRIMARY;
+   else if (sel == _ecore_x_atom_selection_secondary)
+      e->selection = ECORE_X_SELECTION_SECONDARY;
+   else
+      e->selection = ECORE_X_SELECTION_CLIPBOARD;
+   ecore_event_add(ECORE_X_EVENT_SELECTION_CLEAR, e, _ecore_x_event_free_generic, NULL);
+   
 }
 
 void