Generate Ecore event for selection clear

SVN revision: 8397
This commit is contained in:
xcomputerman 2004-01-14 04:43:51 +00:00 committed by xcomputerman
parent 862a18b206
commit 6f41c8705e
2 changed files with 19 additions and 2 deletions

View 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

View 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