b=721762 don't startDragSession when invokeDragSession will fail r=enndeakin
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 02 Feb 2012 15:10:43 +1300
changeset 86276 e4ea03a30a09740a6919fae1189d64758bc4b21b
parent 86275 841b4395aa6639db91a0d47e7f286ff07959cc7b
child 86277 34e3dad7a39daaf8109ae458e600459f7ce0256b
push id22008
push userbmo@edmorley.co.uk
push dateTue, 07 Feb 2012 10:32:58 +0000
treeherdermozilla-central@2b61af9d18ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenndeakin
bugs721762
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
b=721762 don't startDragSession when invokeDragSession will fail r=enndeakin
widget/gtk2/nsDragService.cpp
--- a/widget/gtk2/nsDragService.cpp
+++ b/widget/gtk2/nsDragService.cpp
@@ -340,34 +340,34 @@ nsDragService::InvokeDragSession(nsIDOMN
                                              sourceList,
                                              action,
                                              1,
                                              &event);
 
     mSourceRegion = nsnull;
 
     if (context) {
+        StartDragSession();
+
         // GTK uses another hidden window for receiving mouse events.
         mGrabWidget = gtk_grab_get_current();
         if (mGrabWidget) {
             g_object_ref(mGrabWidget);
             // Only motion events are required but connect to
             // "event-after" as this is never blocked by other handlers.
             g_signal_connect(mGrabWidget, "event-after",
                              G_CALLBACK(OnSourceGrabEventAfter), NULL);
         }
     }
     else {
         rv = NS_ERROR_FAILURE;
     }
 
     gtk_target_list_unref(sourceList);
 
-    StartDragSession();
-
     return rv;
 }
 
 bool
 nsDragService::SetAlphaPixmap(gfxASurface *aSurface,
                                  GdkDragContext *aContext,
                                  PRInt32 aXOffset,
                                  PRInt32 aYOffset,