b=497498 use event and widget coordinates for drop point instead of new cursor position r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Tue, 17 Apr 2012 13:00:25 +1200
changeset 91815 fadcc45f8fe80aa5a52c96cf1422efc31981faab
parent 91814 46b2bf54dd1e1de503f2b990a49ab63b02d1b953
child 91816 8bea9978c445a4a6dac7f2d05796e113746ce863
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs497498
milestone14.0a1
b=497498 use event and widget coordinates for drop point instead of new cursor position r=roc
widget/gtk2/nsWindow.cpp
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -3443,16 +3443,18 @@ nsWindow::OnDragDropEvent(GtkWidget *aWi
 
 {
     LOGDRAG(("nsWindow::OnDragDropSignal\n"));
 
     // get our drag context
     nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
     nsDragService *dragServiceGTK = static_cast<nsDragService*>(dragService.get());
 
+    dragServiceGTK->SetDragEndPoint(nsIntPoint(aX, aY) + WidgetToScreenOffset());
+
     nscoord retx = 0;
     nscoord rety = 0;
 
     GdkWindow *innerWindow = get_inner_gdk_window(gtk_widget_get_window(aWidget), aX, aY,
                                                   &retx, &rety);
     nsRefPtr<nsWindow> innerMostWidget = get_window_for_gdk_window(innerWindow);
 
     if (!innerMostWidget)
@@ -3535,23 +3537,16 @@ nsWindow::OnDragDropEvent(GtkWidget *aWi
     // event and and that case is handled in that handler.
     dragServiceGTK->TargetSetLastContext(0, 0, 0);
 
     // clear the sLastDragMotion window
     sLastDragMotionWindow = 0;
 
     // Make sure to end the drag session. If this drag started in a
     // different app, we won't get a drag_end signal to end it from.
-    gint x, y;
-    GdkDisplay* display = gdk_display_get_default();
-    if (display) {
-      // get the current cursor position
-      gdk_display_get_pointer(display, NULL, &x, &y, NULL);
-      dragServiceGTK->SetDragEndPoint(nsIntPoint(x, y));
-    }
     dragService->EndDragSession(true);
 
     return TRUE;
 }
 
 void
 nsWindow::OnDragDataReceivedEvent(GtkWidget *aWidget,
                                   GdkDragContext *aDragContext,