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 335931 - disappearing of the bottom-most mail leaves invalid selection
disappearing of the bottom-most mail leaves invalid selection
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.6.x (obsolete)
Other All
: Normal normal
: ---
Assigned To: Milan Crha
Evolution QA team
: 337262 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-25 09:21 UTC by Ignacio Vazquez-Abrams
Modified: 2007-11-23 09:08 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
proposed evo patch (3.83 KB, patch)
2007-08-22 09:11 UTC, Milan Crha
needs-work Details | Review
proposed evo patch ][ (5.73 KB, patch)
2007-10-23 10:27 UTC, Milan Crha
committed Details | Review

Description Ignacio Vazquez-Abrams 2006-03-25 09:21:26 UTC
Please describe the problem:
When no message is currently selected in Evolution and no selection box is
present, giving Evolution focus causes the first message to become selected.

Steps to reproduce:
1. Do an action that removes the selection box (e.g., filtering the last message
in the Inbox)
2. Give another application focus
3. Give Evolution focus


Actual results:
The first message in the message list becomes selected and visible in the preview.

Expected results:
No message should be selected.

Does this happen every time?
In the Inbox, yes. Have not tested in other folders.

Other information:
Comment 1 Karsten Bräckelmann 2006-03-25 14:28:21 UTC
I can not reproduce this.

When no message is selected, changing focus does not change anything WRT this state. Tried with a variety of cases. Still no message selected, empty Preview Pane. Enabling/Disabling the Preview doesn't change anything either.

How do you exactly switch back the focus to Evo? Where is the focus inside Evo set to, when switching to another app? NEEDINFO.
Comment 2 Ignacio Vazquez-Abrams 2006-03-25 21:38:17 UTC
Here's an example where I focus via mouse clicks. But any sort of focus causes the message to become selected.

http://www.ivazquez.net/media/record.gif
Comment 3 Karsten Bräckelmann 2006-03-25 23:37:36 UTC
OK, now I can reproduce this.

However, the first step given is not correct. This happens *only*, if
(a) View / Hide Deleted Messages is enabled  and
(b) The last mail is moved by drag-n-drop

This does *not* happen, if no mail is selected for any other reason (for example a search without results, then clear the search), or any other mail but the last one is moved. It doesn't happen either, if the last mail is deleted (which will select the previous mail).


This is some sort of a message selection bug when drag-n-drop'ing the last mail.


Adjusting the Summary. Confirming.
Comment 4 Ignacio Vazquez-Abrams 2006-03-26 00:23:16 UTC
This can also happen if all messages become unselected via Message | Apply Filters or Message | Move to Folder.
Comment 5 Karsten Bräckelmann 2006-04-04 21:08:13 UTC
*** Bug 337262 has been marked as a duplicate of this bug. ***
Comment 6 Karsten Bräckelmann 2006-04-04 21:13:20 UTC
Adjusting the Summary. According to comment 4 and bug 337262 this is triggered in other cases than drag-n-drop as well.

Seems like any (automatic) disappearing will result in a broken focus.


** If the bottom-most mail vanishes from the mail list for whatever reason, the focus must be set to the mail that now is the bottom-most one. Just like deteling a mail already does. **

This is inconsistent behavior and a usability issue. Raising Priority.
Comment 7 Milan Crha 2007-08-22 09:11:37 UTC
Created attachment 94094 [details] [review]
proposed evo patch

for evolution;

My simplest reproducer call View->Hide selected messages. (Just in case you need something easy to reproduce).

Please notice that I removed struct _MessageList::cursor_row member, because it wasn't synchronized with cursor_uid and it wasn't used anywhere in the project.
Comment 8 Srinivasa Ragavan 2007-08-23 08:19:25 UTC
Milan, Im sure that it works well with this, but try deleting message/marking as junk or have hide-deleted-messages toggling, the entire message lists wobbles. 
Comment 9 Ignacio Vazquez-Abrams 2007-08-23 08:38:18 UTC
I don't think that's necessarily a problem with the patch itself. I've seen the message list shift around even when just receiving new mail.
Comment 10 Srinivasa Ragavan 2007-08-23 08:45:00 UTC
Ignacio, but after the patch, it has worsen even for delete mails. I tried it atleast.
Comment 11 Milan Crha 2007-08-23 08:45:59 UTC
I don't see any difference, the magic of this patch is that it should act like without it, especially when deleting, so when I have Threaded view, and checked Hide deleted messages, and then pressing delete, it works exactly like before.

a) When I have reached the bottom of message list (by scrollbar), then all the messages are scrolled down after deleting.

b) Why I'm not at the end of the list, then only the bottom part of the list is moved.

c) In threaded view, after deleting sub-node of the thread, it sometimes skips more lines to the top, not only one line. It makes the delete operation itself, not my new code :)

My new code is only for the cases we don't have any message selected after rebuilding the message list. And because deleting moves cursor itself, then there didn't apply new code. I really think it works like before, when deleting.
Comment 12 Milan Crha 2007-10-23 10:27:02 UTC
Created attachment 97711 [details] [review]
proposed evo patch ][

for evolution;

a bit updated patch, but mostly do same thing, because after we discuss this and I tested/investigated this as srag suggested, then I realized that I'm not sure what srag thinks with that "wobbles". I only see an "issue" when in threaded view, deleted messages hidden and sorting by date, then it sometimes selects different message in folder, than that next/previous before I hit Del. It's because of sorting and new feature srag added, threads are sorted by the latest message, so thread can change its position, when you delete/junk right message. As far as I tested this, my code is not invoked in any manner when you delete/junk/non-junk because it selects next/previous message by itself. My code is there only for cases when no message has left selected, and there still can be selected one.
Comment 13 Srinivasa Ragavan 2007-11-05 07:40:40 UTC
Milan, Possible that they are not related to the bug. But let me ask another thing. What are the things this bug fixes.

From comment #6

This bug is now not even reproducible on those steps. What other steps to test this patch? Does this fix something else?
Comment 14 Milan Crha 2007-11-05 16:45:18 UTC
I hope it fixes this bug :)
Try this:
a) select any message in a list
b) call View->Hide selected messages

- without a patch, no message is selected (and Alt+Tab out and
  back to evo selects first message)
- with a patch, next message is selected

It just makes sure that every time, after (re)generating message-list, there will be selected any message (if available).
Comment 15 Srinivasa Ragavan 2007-11-22 17:42:11 UTC
Ok Milan commit this to head.
Comment 16 Milan Crha 2007-11-23 09:08:55 UTC
Committed to trunk. Committed revision 34567.