From 84a6083d5d07dbeb7746e80732f32aa2afb0e5d5 Mon Sep 17 00:00:00 2001 From: xcomputerman Date: Wed, 14 Jan 2004 05:18:43 +0000 Subject: [PATCH] Boom, Copy & Paste all works now SVN revision: 8398 --- legacy/ecore/src/lib/ecore_x/ecore_x_events.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/legacy/ecore/src/lib/ecore_x/ecore_x_events.c b/legacy/ecore/src/lib/ecore_x/ecore_x_events.c index c40ce84424..981f6c1025 100644 --- a/legacy/ecore/src/lib/ecore_x/ecore_x_events.c +++ b/legacy/ecore/src/lib/ecore_x/ecore_x_events.c @@ -878,18 +878,15 @@ _ecore_x_event_handle_selection_clear(XEvent *xevent) void _ecore_x_event_handle_selection_request(XEvent *xevent) { - Ecore_X_Event_Selection_Request *e; Ecore_X_Selection_Data *sd; XSelectionEvent xnotify; XEvent *xev; char *data; - e = calloc(1, sizeof(Ecore_X_Event_Selection_Request)); - e->win = xevent->xselectionrequest.requestor; - e->time = xevent->xselectionrequest.time; - xev = calloc(1, sizeof(XEvent)); + xnotify.type = SelectionNotify; + xnotify.display = xevent->xselectionrequest.display; xnotify.requestor = xevent->xselectionrequest.requestor; xnotify.selection = xevent->xselectionrequest.selection; xnotify.target = xevent->xselectionrequest.target; @@ -898,7 +895,8 @@ _ecore_x_event_handle_selection_request(XEvent *xevent) if((sd = _ecore_x_selection_get(xnotify.selection)) && (sd->win == xevent->xselectionrequest.owner)) { - /* FIXME: Provide API for user-defined conversion functions */ + /* TODO: Use predefined/user-definable callback functions + * to convert selections */ if (xnotify.target == _ecore_x_atom_string) data = ecore_x_selection_convert_to_string(sd->data); else if (xnotify.target == _ecore_x_atom_utf8_string) @@ -907,7 +905,7 @@ _ecore_x_event_handle_selection_request(XEvent *xevent) data = sd->data; /* FIXME: This does not properly handle large data transfers */ - ecore_x_window_prop_property_set(e->win, + ecore_x_window_prop_property_set(xevent->xselectionrequest.requestor, xevent->xselectionrequest.property, xevent->xselectionrequest.target, 8, data, sd->length); @@ -920,9 +918,9 @@ _ecore_x_event_handle_selection_request(XEvent *xevent) } xev->xselection = xnotify; - XSendEvent(_ecore_x_disp, e->win, False, 0, xev); - /* FIXME: We alloc e but we never actually add it to the event - * queue -- should it be freed or is it still useful? */ + XSendEvent(xevent->xselectionrequest.display, + xevent->xselectionrequest.requestor, False, 0, xev); + XFree(xev); }