GNOME Bugzilla – Bug 394525
Drag-and-drop breakage
Last modified: 2008-09-08 05:48:22 UTC
Please describe the problem: I'm using Thunderbird-1.5.0.9. With gtk+-2.10.7, it is impossible to drag and drop a single message from one folder to another. As soon as the mouse pointer crosses the border between the message list pane and the folder list pane, the drag and drop operation gets canceled. This does not happen when moving two or more messages, only when trying to move a single message. Steps to reproduce: 1. Select a single message in Thunderbird's message list pane 2. Try to drag it to a different folder in the folder list pane 3. Watch the message jump back as soon as the mouse cursor enters the folder list pane 4. Repeat steps 1. to 3. until you get bored Actual results: The message icon attached to the mouse pointer jumps back to its original position in the message list pane as soon as the mouse pointer crosses the border to the folder list pane. Expected results: I would expect the drag and drop operation to finish successfully, of course. ;-) Does this happen every time? Yes. Other information: As soon as I revert to gtk+-2.10.6 and restart Thunderbird, the problem is gone. Switch back again to gtk+-2.10.7 and restart Thunderbird, and the problem reappears.
This happens on Gentoo also; see http://bugs.gentoo.org/show_bug.cgi?id=162362 It seems to only happen to mozilla programs (seamonkey, firefox, and thunderbird).
There is some brokenness in the mozilla dnd code: nsDragService::GetTargetDragData(GdkAtom aFlavor) { gtk_grab_add(mHiddenWidget); PR_LOG(sDragLm, PR_LOG_DEBUG, ("getting data flavor %d\n", aFlavor)); PR_LOG(sDragLm, PR_LOG_DEBUG, ("mLastWidget is %p and mLastContext is %p\n", mTargetWidget, mTargetDragContext)); // reset our target data areas TargetResetData(); gtk_drag_get_data(mTargetWidget, mTargetDragContext, aFlavor, mTargetTime); PR_LOG(sDragLm, PR_LOG_DEBUG, ("about to start inner iteration.")); PRTime entryTime = PR_Now(); while (!mTargetDragDataReceived && mDoingDrag) { // check the number of iterations PR_LOG(sDragLm, PR_LOG_DEBUG, ("doing iteration...\n")); PR_Sleep(20*PR_TicksPerSecond()/1000); /* sleep for 20 ms/iteration */ if (PR_Now()-entryTime > NS_DND_TIMEOUT) break; gtk_main_iteration(); } PR_LOG(sDragLm, PR_LOG_DEBUG, ("finished inner iteration\n")); gtk_grab_remove(mHiddenWidget); } This is being called from dnd callbacks, and causes the drag to be canceled, because gtk+ does cancel drags when a grab is added. This is normally the right thing to do, and was the fix for bug 122688.
I've filed a mozilla bug about this, https://bugzilla.mozilla.org/show_bug.cgi?id=367203
Just confirming that the patch you attached to your Mozilla bug report works fine (thunderbird-1.5.0.9, gtk+-2.10.8). I recompiled Thunderbird, and single-message DND seems to work fine again, haven't noticed any ill side effects so far. Thanks!