Convert target to string, the user will probably do this anyway.

SVN revision: 27514
This commit is contained in:
Sebastian Dransfeld 2006-12-19 06:40:30 +00:00
parent 348e7aaee5
commit bf9059d260
3 changed files with 14 additions and 3 deletions

View File

@ -543,7 +543,7 @@ struct _Ecore_X_Event_Selection_Request
Ecore_X_Window requestor;
Ecore_X_Time time;
Ecore_X_Atom selection;
Ecore_X_Atom target;
char *target;
Ecore_X_Atom property;
};

View File

@ -166,6 +166,15 @@ _ecore_x_event_free_xdnd_enter(void *data __UNUSED__, void *ev)
free(e);
}
static void
_ecore_x_event_free_selection_request(void *data __UNUSED__, void *ev)
{
Ecore_X_Event_Selection_Request *e;
XFree(e->target);
free(e);
}
static void
_ecore_x_event_free_selection_notify(void *data __UNUSED__, void *ev)
{
@ -1120,9 +1129,9 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
e->requestor = xevent->xselectionrequest.requestor;
e->time = xevent->xselectionrequest.time;
e->selection = xevent->xselectionrequest.selection;
e->target = xevent->xselectionrequest.target;
e->target = XGetAtomName(_ecore_x_disp, xevent->xselectionrequest.target);
e->property = xevent->xselectionrequest.property;
ecore_event_add(ECORE_X_EVENT_SELECTION_REQUEST, e, NULL, NULL);
ecore_event_add(ECORE_X_EVENT_SELECTION_REQUEST, e, _ecore_x_event_free_selection_request, NULL);
if ((sd = _ecore_x_selection_get(xevent->xselectionrequest.selection)) &&
(sd->win == xevent->xselectionrequest.owner))

View File

@ -277,6 +277,8 @@ _ecore_x_selection_target_atom_get(const char *target)
char *
_ecore_x_selection_target_get(Ecore_X_Atom target)
{
/* FIXME: Should not return mem allocated with strdup or X mixed,
* one should use free to free, the other XFree */
if (target == ECORE_X_ATOM_FILE_NAME)
return strdup(ECORE_X_SELECTION_TARGET_FILENAME);
else if (target == ECORE_X_ATOM_STRING)