if we can't convert to the requested target, fail so that requesting app can re-request a different type

fix broken logic  (!foo == -1) is always false


SVN revision: 29616
This commit is contained in:
rephorm 2007-04-21 02:57:51 +00:00 committed by rephorm
parent 64f4fbc453
commit 3259061f6e
3 changed files with 7 additions and 3 deletions

View File

@ -1136,7 +1136,7 @@ _ecore_x_event_handle_selection_request(XEvent *xevent)
if (!ecore_x_selection_convert(xevent->xselectionrequest.selection,
xevent->xselectionrequest.target,
&data) == -1)
&data))
{
/* Refuse selection, conversion to requested target failed */
property = None;

View File

@ -477,11 +477,15 @@ ecore_x_selection_convert(Ecore_X_Atom selection, Ecore_X_Atom target, void **da
}
}
/* Default, just return the data */
/* ICCCM says "If the selection cannot be converted into a form based on the target (and parameters, if any), the owner should refuse the SelectionRequest as previously described." */
return 0;
/* Default, just return the data
*data_ret = malloc(sel->length);
memcpy(*data_ret, sel->data, sel->length);
free(tgt_str);
return 1;
*/
}
/* TODO: We need to work out a mechanism for automatic conversion to any requested

View File

@ -1317,7 +1317,7 @@ _ecore_x_event_handle_selection_request(xcb_generic_event_t *event)
(sd->win == ev->owner))
{
if (!ecore_x_selection_convert(ev->selection, ev->target,
&data) == -1)
&data))
{
/* Refuse selection, conversion to requested target failed */
sn_event.property = XCB_NONE;