b=634719 don't start a new source drag session until the previous has completed r=roc
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 19 Apr 2012 18:18:31 +1200
changeset 92756 eb870a2d03f7197509e1c5fd94068979ee0d0f0d
parent 92755 ac5c8077e3539114b40254d30895ba83ffe82cf1
child 92757 c0a2d79ca66dcfbf6a05e6902e6459f1bff3fe42
push id8855
push userktomlinson@mozilla.com
push dateMon, 30 Apr 2012 20:56:38 +0000
treeherdermozilla-inbound@c0a2d79ca66d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs634719
milestone15.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=634719 don't start a new source drag session until the previous has completed r=roc
widget/gtk2/nsDragService.cpp
--- a/widget/gtk2/nsDragService.cpp
+++ b/widget/gtk2/nsDragService.cpp
@@ -312,16 +312,24 @@ OnSourceGrabEventAfter(GtkWidget *widget
 
 NS_IMETHODIMP
 nsDragService::InvokeDragSession(nsIDOMNode *aDOMNode,
                                  nsISupportsArray * aArrayTransferables,
                                  nsIScriptableRegion * aRegion,
                                  PRUint32 aActionType)
 {
     PR_LOG(sDragLm, PR_LOG_DEBUG, ("nsDragService::InvokeDragSession"));
+
+    // If the previous source drag has not yet completed, signal handlers need
+    // to be removed from mGrabWidget and dragend needs to be dispatched to
+    // the source node, but we can't call EndDragSession yet because we don't
+    // know whether or not the drag succeeded.
+    if (mSourceNode)
+        return NS_ERROR_NOT_AVAILABLE;
+
     nsresult rv = nsBaseDragService::InvokeDragSession(aDOMNode,
                                                        aArrayTransferables,
                                                        aRegion, aActionType);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // make sure that we have an array of transferables to use
     if (!aArrayTransferables)
         return NS_ERROR_INVALID_ARG;