if we can't convert to the requested target, fail so that requesting app can re-reque...
authorrephorm <rephorm>
Sat, 21 Apr 2007 02:57:51 +0000 (02:57 +0000)
committerrephorm <rephorm@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 21 Apr 2007 02:57:51 +0000 (02:57 +0000)
fix broken logic  (!foo == -1) is always false

SVN revision: 29616

legacy/ecore/src/lib/ecore_x/ecore_x_events.c
legacy/ecore/src/lib/ecore_x/ecore_x_selection.c
legacy/ecore/src/lib/ecore_x/ecore_xcb_events.c

index 5b87f34..8b66468 100644 (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;
index a5cb4ec..de45c23 100644 (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
index b38510b..1ce95fb 100644 (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;