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 351672 - Dragging imap message when another is copying locks X
Dragging imap message when another is copying locks X
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.10.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 308354 374809 408471 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-08-16 20:39 UTC by Adam Wiggins
Modified: 2008-08-07 16:20 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
backtrace of evolution while cursor locked in drag mode (30.63 KB, text/plain)
2006-09-12 15:38 UTC, Gavin Scott
  Details
gdb session showing gtk_drag_finish calls (31.00 KB, text/plain)
2006-12-20 03:20 UTC, Gavin Scott
  Details
Patch described in comment #6 (500 bytes, patch)
2007-07-03 15:40 UTC, Gavin Scott
reviewed Details | Review
proposed evolution patch (1.32 KB, patch)
2007-08-29 22:12 UTC, Gavin Scott
committed Details | Review

Description Adam Wiggins 2006-08-16 20:39:06 UTC
Please describe the problem:
If I drag one message from an imap folder to another and, while it is still coying, start dragging the one below it, the application will lock my mouse cursor into a mode and never return.  (i.e. the second drag operation never completes).  This mode prevents me from clicking on any other application or from using the keyboard.  The only solution I've found is hitting Ctrl-Alt-F1 to switch to a text terminal, logging in, and typing "killall evolution."  (No -9 is necessary; the app is not locked, only my X input state.)

Aside from any imap issues, it seems to me that locking the user input in this way is a bad idea.  Other apps (for example, Firefox) don't do this, but instead if you drag the item to an invalid space (outside the app window, for example) it just cancels the operation.

Steps to reproduce:
Best done with a slow imap server, but even without reproducing the imap bug the input locking should be obvious since it does that every time by design.

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 André Klapper 2006-08-19 15:10:27 UTC
which distro is this? which evo version is this exactly?
Comment 2 Adam Wiggins 2006-08-19 21:17:16 UTC
I've run into this bug on both the 2.5 and the 2.6 series, on several distributions (Fedora and Ubuntu that I can think of offhand) and on a number of different machines over the last year or two.  My current setup is Ubuntu 6.06 with Evolution 2.6.1.

I've been using the same mail server this whole time (just a standard RHEL4 install with Postfix and Dovecot for the imap) so I suspect I'm seeing it more often than others due to some peculiarity in the setup there.  (Maybe just that it's slow.)
Comment 3 Gavin Scott 2006-09-12 15:36:32 UTC
I also experience this bug at least once every other day or so using evolution (both evolution-2.2 2.2.3 on Fedora Core 4 and evolution-2.6 2.6.1 on Ubuntu 6.06) with IMAP mail.  I had not figured out how to reproduce it, but Adam's synopsis seems to be correct.  I also have to quit to a text console and killall evolution.

In case its not clear from his description, what happens is that you start to drag the mail to a folder, the mouse cursor changes to the drag icon and then will never change back, preventing you from doing anything in X.

I will attach a backtrace I just took from the text console while my cursor was stuck in Drag mode.
Comment 4 Gavin Scott 2006-09-12 15:38:15 UTC
Created attachment 72622 [details]
backtrace of evolution while cursor locked in drag mode

Backtrace of all evolution threads while cursor stuck in drag mode.
Comment 5 Corey Burger 2006-11-14 21:54:20 UTC
I have experienced with as well, with exactly the same versions of Evo on exactly the same distros as Gavin. I would call this one confirmed, although I have not tested it with 2.8 in Edgy.
Comment 6 Gavin Scott 2006-12-20 03:15:23 UTC
I looked into this further -- its driving me crazy.  The bug occurs when emft_drop_async_done calls gtk_drag_finish while you are in the process of dragging a mail message.  Note that this can occur because emft_drop_async_done is called asynchronously at some point *AFTER* you have dropped a message in a folder, thus giving you time to start dragging a different message. 

AFAICT this gtk_drag_finish call is unneeded because em_folder_tree_enable_drag_and_drop sets GTK_DEST_DEFAULT_ALL, which causes gtk_drag_finish to be called automatically.  Removing the emft_drop_async_done gtk_drag_finish call resolves this bug for me.

I will attach a gdb session where I set a breakpoint on gtk_drag_finish, attach to a running evolution process, and drag a mail from the message list into a folder while using an IMAP server.  It shows 3 breaks, two result from the GTK_DEST_DEFAULT_ALL-related calls and one is from emft_drop_async_done.

I am currently running evolution-2.6.1-0ubuntu7 on Ubuntu 6.06 (dapper drake), but this bug exists on every version of evolution I can find, including CVS HEAD.

STEPS TO REPRODUCE:

1) set up an imap account, preferably to a "slow" server
2) view one of the imap folders
3) drag a message from the message list and drop it on a different imap folder
4) *AS FAST AS POSSBILE* start dragging a different message from the message list.  You have gone too slow if the original message (step 3) disappears from the message list before you start dragging the second message
Comment 7 Gavin Scott 2006-12-20 03:20:00 UTC
Created attachment 78664 [details]
gdb session showing gtk_drag_finish calls
Comment 8 Tarek Loubani 2007-04-12 15:30:35 UTC
Hi all!

I wish to confirm that this bug still exists in 2.10.1 in Ubuntu Feisty. It is painful, honestly.

tarek : )
Comment 9 Thomas Vander Stichele 2007-07-02 19:30:30 UTC
another metoo.

A better workaround that I discovered this week is that you can start another evolution process from a console, which allows you to pick up where you left off and at least expunge your moves/deletions, instead of having to redo them after killing evo.
Comment 10 Gavin Scott 2007-07-03 15:39:04 UTC
I don't think I made it clear in comment #6, but the attached 1-line patch fixes this for me.  I haven't noticed any adverse affects from it since last December.  Someone with more gtk drag-and-drop knowledge than me should double-check I'm not missing something.
Comment 11 Gavin Scott 2007-07-03 15:40:49 UTC
Created attachment 91115 [details] [review]
Patch described in comment #6
Comment 12 Srinivasa Ragavan 2007-07-05 08:49:49 UTC
Gavin, the issue could be little different. The gtk_drag_finish gets called in a non-main (gui) thread. Im not sure, about the removal of that call. 

Matthew, any idea?
Comment 13 Matthew Barnes 2007-07-06 18:28:45 UTC
Maybe we just need to throw a gdk_threads_enter()/leave() guard around it.
I'll take a closer look...
Comment 14 Milan Crha 2007-08-28 08:39:55 UTC
I think Gavin has right. Based on the documentation for signals "drag-drop" and "drag-data-received", gtk_drag_finish is supposed to be called in one of this signal handlers to let the source know that the drop is done. Evolution do this too late, from my point of view, so it breaks this rule and when dragging next message the call for gtk_drag_finish breaks UI.

Also as Gavin proved by callstack, with GTK_DEST_DEFAULT_ALL used with gtk_drag_dest_set, call of gtk_drag_finish is made automatically, in the proper place, and as I tested it a bit, it seems to me that it works in a same way like before Gavin's patch from Comment #11 (but I'm not a gtk guru at all, so I may be wrong).

Gavin, if you add a ChangeLog entry to your patch, then I would like to suggest to commit it to trunk.
Comment 15 Gavin Scott 2007-08-29 22:12:55 UTC
Created attachment 94580 [details] [review]
proposed evolution patch

OK, here is a patch with a ChangeLog entry.  Since all emft_drop_async_done really does is call gtk_drag_finish I removed it entirely in this version.
Comment 16 Milan Crha 2007-08-30 07:42:47 UTC
Patch looks fine to commit. Only one thing, you've picked up wrong ChangeLog file, there is one in /mail subdirectory, so I moved it there.
Comment 17 Milan Crha 2007-08-30 07:45:19 UTC
Committed to trunk. Committed revision 34135.
Comment 18 Christopher Beland 2008-01-18 17:25:12 UTC
I'm still able to experience this problem with evolution-2.12.2-2.fc8 for Fedora 8. I did selected multiple messages at the same time to make sure that the system was slowed down enough for me to DnD another message before it finished with the
first batch.

This looks like a duplicate of bug 308354 and bug 408471.
Comment 19 Srinivasa Ragavan 2008-01-20 20:17:12 UTC
*** Bug 308354 has been marked as a duplicate of this bug. ***
Comment 20 Srinivasa Ragavan 2008-01-20 20:17:20 UTC
*** Bug 408471 has been marked as a duplicate of this bug. ***
Comment 21 Srinivasa Ragavan 2008-01-20 20:23:10 UTC
Guys, I'm using 2.21.90 from trunk and I tried dragging 100 emails thrice, one after the other to my IMAP folder and I don't see it. I can see that the tasks are queued.

Just to know, if it is a distro specific bug, Matt/Milan can you see if it happens for you on Fedora/trunk?
Comment 22 Christopher Beland 2008-01-21 05:57:48 UTC
Does the hang happen on trunk if you refile messages two or three at a time instead of one at a time?  Does it matter if you select discontiguous messages from the folder list?
Comment 23 Srinivasa Ragavan 2008-01-21 06:09:50 UTC
Oh, I dragged 100 at a time. (but they were contiguous).
Comment 24 Gavin Scott 2008-01-28 22:31:20 UTC
evolution-2.12.2-2.fc8 contains a patch (evolution-2.8.1-kill-ethread.patch) that basically restores the gtk_drag_finish call that the fix in revision 34135 removed.  They do it in a new function, emft_drop_async__done (that's two _'s before done).  AFAICT plain-vanilla evolution-2.12.1.tar.bz2 should not have this problem.
Comment 25 Matthew Barnes 2008-01-29 00:58:20 UTC
That patch has been removed in evolution-2.12.3-1.fc8.
Comment 26 Christopher Beland 2008-03-01 03:47:52 UTC
I'm still able to reproduce this problem in evolution-2.12.3-1.fc8 with contiguous selects.
Comment 27 Milan Crha 2008-03-03 16:13:08 UTC
Oops, it's back in actual trunk too, only the name is emft_drop_async__done (two underscores at the end instead of one). Same code is in F8 version too.
Comment 28 Matthew Barnes 2008-03-03 16:30:59 UTC
Ah crap, probably introduced while merging changes into my "kill-ethread" checkout.  That stuff was committed in revision 34730.

Comment 29 Matthew Barnes 2008-03-03 17:11:09 UTC
Yeah, here's the revision where my patch puts the old logic right back in.

http://svn.gnome.org/viewvc/evolution/trunk/mail/em-folder-tree.c?r1=34730&r2=34729&pathrev=34730
Comment 30 Matthew Barnes 2008-03-03 17:26:06 UTC
Re-fixed in revision 35124.

Milan, you want to handle this for Fedora 8?
Comment 31 Milan Crha 2008-03-03 18:29:10 UTC
Sure, building evolution-2.12.3-2.fc8 right now, will push to updates-testing tomorrow morning (CET).
Comment 32 Milan Crha 2008-03-03 19:23:43 UTC
I did it today, finally, so package for f8 is in updates-testing now. If you wish you can try, Christopher.
Comment 33 Christopher Beland 2008-03-06 01:33:31 UTC
I tested evolution-2.12.3-3.fc8, and I can no longer reproduce this bug.  Yay!
Comment 34 Matthew Barnes 2008-08-07 16:20:24 UTC
*** Bug 374809 has been marked as a duplicate of this bug. ***