From 8e7257a0bf12d8688bb7a6ddc91de2f2513de0e3 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 6 Mar 2001 15:38:31 +0000 Subject: [PATCH] and add selection clear handling... and we are done.. :) SVN revision: 4326 --- legacy/ecore/src/Ecore.h | 12 ++++++++++-- legacy/ecore/src/e_ev_x.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/legacy/ecore/src/Ecore.h b/legacy/ecore/src/Ecore.h index 3dce1672a2..07381d7dfe 100644 --- a/legacy/ecore/src/Ecore.h +++ b/legacy/ecore/src/Ecore.h @@ -183,8 +183,6 @@ void e_window_no_ignore(Window win); int e_window_is_ignored(Window win); Window e_window_get_at_xy(int x, int y); -char *e_selection_get_data(Window win, Atom prop); - int e_window_dnd_capable(Window win); void e_window_dnd_handle_motion(Window source_win, int x, int y, @@ -274,6 +272,8 @@ char *e_window_get_title(Window win); void e_keyboard_grab(Window win); void e_keyboard_ungrab(void); + +char *e_selection_get_data(Window win, Atom prop); Window e_selection_request(void); Window e_selection_set(char *string); @@ -321,6 +321,7 @@ typedef struct _ev_dnd_drop Ev_Dnd_Drop; typedef struct _ev_dnd_drop_status Ev_Dnd_Drop_Status; typedef struct _ev_dnd_data_request Ev_Dnd_Data_Request; typedef struct _ev_paste_request Ev_Paste_Request; +typedef struct _ev_clear_selection Ev_Clear_Selection; enum _eev_stack_detail { @@ -379,6 +380,7 @@ enum _eev_type EV_DND_DROP_STATUS, EV_DND_DATA_REQUEST, EV_PASTE_REQUEST, + EV_CLEAR_SELECTION, EV_CHILD, EV_USER, @@ -636,6 +638,12 @@ struct _ev_paste_request char *string; }; +struct _ev_clear_selection +{ + Window win, root; + Atom selection; +}; + struct _ev_dnd_drop_request { Window win, root, source_win; diff --git a/legacy/ecore/src/e_ev_x.c b/legacy/ecore/src/e_ev_x.c index 6cd7329b5a..67aa179c52 100644 --- a/legacy/ecore/src/e_ev_x.c +++ b/legacy/ecore/src/e_ev_x.c @@ -37,6 +37,7 @@ static void e_ev_x_handle_circulate_request(XEvent * xevent); static void e_ev_x_handle_property_notify(XEvent * xevent); static void e_ev_x_handle_colormap_notify(XEvent * xevent); static void e_ev_x_handle_selection_notify(XEvent * xevent); +static void e_ev_x_handle_selection_clear(XEvent * xevent); static void e_ev_x_handle_selection_request(XEvent * xevent); static void e_ev_x_handle_client_message(XEvent * xevent); static void e_ev_x_handle_shape_change(XEvent * xevent); @@ -97,6 +98,7 @@ e_ev_x_init(void) event_translator[ColormapNotify] = e_ev_x_handle_colormap_notify; event_translator[ClientMessage] = e_ev_x_handle_client_message; event_translator[SelectionNotify] = e_ev_x_handle_selection_notify; + event_translator[SelectionClear] = e_ev_x_handle_selection_clear; event_translator[SelectionRequest] = e_ev_x_handle_selection_request; event_translator[shape_event_id] = e_ev_x_handle_shape_change; @@ -887,6 +889,19 @@ e_ev_x_handle_selection_notify(XEvent * xevent) ev_drop_request_pending = NULL; } +static void +e_ev_x_handle_selection_clear(XEvent * xevent) +{ + Ev_Clear_Selection *e; + + e = NEW(Ev_Clear_Selection, 1); + e->win = xevent->xselectionclear.window; + printf("%x\n", e->win); + e->root = e_window_get_root(e->win); + e->selection = xevent->xselectionclear.selection; + e_add_event(EV_CLEAR_SELECTION, e, e_ev_generic_free); +} + static void e_ev_x_handle_selection_request(XEvent * xevent) {