After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 394525 - Drag-and-drop breakage
Drag-and-drop breakage
Status: RESOLVED NOTGNOME
Product: gtk+
Classification: Platform
Component: .General
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-01-09 07:53 UTC by Thomas Zajic
Modified: 2008-09-08 05:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16



Description Thomas Zajic 2007-01-09 07:53:09 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.
Comment 1 Daniel Gryniewicz 2007-01-16 19:05:58 UTC
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).
Comment 2 Matthias Clasen 2007-01-16 19:52:24 UTC
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.

Comment 3 Matthias Clasen 2007-01-17 02:52:45 UTC
I've filed a mozilla bug about this, https://bugzilla.mozilla.org/show_bug.cgi?id=367203
Comment 4 Thomas Zajic 2007-01-17 11:44:10 UTC
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!