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 89155 e4ea03a30a09740a6919fae1189d64758bc4b21b
parent 89154 841b4395aa6639db91a0d47e7f286ff07959cc7b
child 89156 34e3dad7a39daaf8109ae458e600459f7ce0256b
push idunknown
push userunknown
push dateunknown
reviewersenndeakin
bugs721762
milestone13.0a1
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,