Cnp/X11: correct object parameter in datacb
authorThiep Ha <thiepha@gmail.com>
Tue, 9 Jun 2015 08:06:45 +0000 (17:06 +0900)
committerDaniel Zaoui <daniel.zaoui@yahoo.com>
Fri, 12 Jun 2015 08:53:55 +0000 (11:53 +0300)
The object parameter in datacb must be the selection request object,
not the selection owner object.
This patch corrects that.

Test case: open two windows with entry, copy text from one entry in
first window, paste to entry in other window.

@fix

src/lib/elm_cnp.c

index c38dbf5..88cdffc 100644 (file)
@@ -982,7 +982,7 @@ _x11_notify_handler_text(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify
         ddata.data = data->data;
         ddata.len = data->length;
         ddata.action = sel->action;
-        sel->datacb(sel->udata, sel->widget, &ddata);
+        sel->datacb(sel->udata, sel->requestwidget, &ddata);
      }
    else cnp_debug("Paste request\n");
 
@@ -1210,7 +1210,7 @@ _x11_vcard_receive(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notif
         ddata.data = data->data;
         ddata.len = data->length;
         ddata.action = sel->action;
-        sel->datacb(sel->udata, sel->widget, &ddata);
+        sel->datacb(sel->udata, sel->requestwidget, &ddata);
      }
    else cnp_debug("Paste request\n");
    return 0;
@@ -1272,7 +1272,7 @@ _x11_notify_handler_image(X11_Cnp_Selection *sel, Ecore_X_Event_Selection_Notify
         ddata.data = data->data;
         ddata.len = data->length;
         ddata.action = sel->action;
-        sel->datacb(sel->udata, sel->widget, &ddata);
+        sel->datacb(sel->udata, sel->requestwidget, &ddata);
      }
    else cnp_debug("Paste request\n");
    return 0;