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 593700 - [regression] Opens folder on top
[regression] Opens folder on top
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.30.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[kill-bonobo]
: 601645 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-08-31 17:50 UTC by Milan Crha
Modified: 2013-09-13 01:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
evo patch (6.21 KB, patch)
2009-12-17 19:16 UTC, Milan Crha
committed Details | Review
proposed evo hack (4.12 KB, patch)
2010-02-10 14:47 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2009-08-31 17:50:59 UTC
I'm using sorting from oldest to newest, thus new messages are at bottom. It used to behave in a way of starting folder (when selected for the first time) either around the last selected message, or at the bottom (probably depended on the scroll bar position from the previous mail).

It doesn't behave this way any more. The folder is usually opened at the top, thus I'm forced to scroll down to see new messages.
Comment 1 Matthew Barnes 2009-08-31 23:02:16 UTC
Debugging Hint:

I'm using a new mechanism to track folder states.  Instead of writing tons of tiny little XML files, everything gets written to and restored from a single key file: ~/.evolution/mail/config/state

Best part is the mechanism is integrated into the shell, so other components can easily use it too (though only mail is at the moment).

See: http://mbarnes.fedorapeople.org/docs/eshell/EShellView.html#e-shell-view-get-state-key-file
Comment 2 Matthew Barnes 2009-09-28 23:48:16 UTC
Think I figured out what was going on.  When you switch to a different folder, the scrollbar position for that folder gets restored after a short delay as part of a workaround hack for a GnomeCanvas / ETable issue that I guess Jeff added.

What was happening was the scrollbar position was getting saving prematurely, before that timeout expired and the real position could be restored.  So the real position got clobbered by the premature save, whose position is zero.

I disabled the callback that saves the scrollbar position until the real position can be restored.  Seems to be working.

http://git.gnome.org/cgit/evolution/commit/?id=af155cd7a614aa79398ee24b48441e580d4afbad

Test this by manually setting all your folders to non-zero scroll positions, and then watch whether any of them get reset over the course of a day.

Closing this as FIXED for now, but I'll reopen it if I still see problems.
Comment 3 Milan Crha 2009-09-29 13:48:34 UTC
It doesn't seem to be fixed for me, with the master as of commit 0089449, when I click between two folders, each of them has different count of messages in there, then these steps are producing the issue:
a) select the last message in folder A
b) select folder B, select the last message as well
c) select folder A, it's back at the top, thus select the last message again
d) select folder B, back in the top

if not, then no message selected there and repeating few times step c) and d) will result in the top view again, though maybe selecting the last message in folder C and returning to both folder A and folder B will show them both at the top.
Comment 4 Milan Crha 2009-09-29 13:50:39 UTC
I know I mentioned on IRC already, but let's have it here too:
I really miss a per folder setup, mainly for a preview panel, as having that off for all Junk folders (and for me also for the Inbox), but on for the rest, is quite convenient feature, which would be nice to have implemented back.
Comment 5 Akhil Laddha 2009-11-12 11:57:40 UTC
*** Bug 601645 has been marked as a duplicate of this bug. ***
Comment 6 Yves-Alexis Perez 2009-11-16 21:10:56 UTC
Hmh, it seems that it still occurs from time to time. For example, selecting a mail in another folder, then switching back to INBOX, seems to reset the view to “top”. This is on 2.29.2.
Comment 7 Milan Crha 2009-12-17 19:16:55 UTC
Created attachment 149931 [details] [review]
evo patch

for evolution;

As I discussed with Matt on IRC I dropped all the bits for scrollbar saving, it didn't work much anyway, surrounded with many FIXME comments as well.

The main change here is in message_list_set_folder. The call to clear_tree setup the message_list->idle_id again, thus when it was done the saved value for a newly selected folder had been re-saved with NULL. Removing the idle handler slightly later makes this work as expected.
Comment 8 Milan Crha 2009-12-17 19:18:13 UTC
Created commit 134a7d4 in evo master (2.29.4+)
Comment 9 Yves-Alexis Perez 2010-01-13 20:34:16 UTC
It seems that the bug is back in 2.29.5
Comment 10 Milan Crha 2010-01-14 09:52:19 UTC
There seems to be two possibilities, as it doesn't do that for me always (it usually works fine):
a) you ended with a multiselect in the folder and then changed it away. That means no particular message had been selected, and thus it stores the folder's selected message as none, and next selection of a folder stars at the top. It does the previous version too.

b) some timing issue, where the message is properly selected (you can move in the message list up and down and the view will be centered around the selected message as expected), only the view didn't show the cursor. It would be much harder to hunt.

These are only guesses, but from what I saw I would bet for a), as I usually see it working as expected (message is selected and properly shown in the view on folder selection change).

Maybe you've other observation?
Comment 11 Yves-Alexis Perez 2010-01-14 09:59:21 UTC
I was indeed wondering if it was related to message selection, so here's what I did:

* select the latest message (at the bottom) (and only one) in INBOX
* switch to another folder
* switch back to INBOX

then the INBOX is displayed from top and my message is not visible.
Comment 12 Milan Crha 2010-01-14 17:18:44 UTC
Hrm, it seems to work fine for me. When you try to press arrow up/down, will it focus the right message, that previously selected, or will it select the first in a list? I think it's saving the state on folder change, so is your
~/.evolution/mail/config/state
changed when you change the message and move to other folder? There should be something like
  SelectedMessage=279503
in the section for your Inbox.
Comment 13 Yves-Alexis Perez 2010-01-14 19:32:01 UTC
SelectedMessage doesn't change when changing folder.
If I press up/down, the view switches to the end of folder.

So basically the correct message is selected (and the correct content appear) but the list is not at the correct position.
Comment 14 Milan Crha 2010-01-15 12:51:48 UTC
OK, thanks, thinking of it I saw something very similar yesterday too. Would be something with timing, I guess. I'm reopening this. Thanks for investigation.
Comment 15 Yves-Alexis Perez 2010-02-09 07:19:57 UTC
Still reproducible in 2.29.90.
Comment 16 Milan Crha 2010-02-10 14:36:42 UTC
Yeah, seems to be related to a folder size, as this is a race between on-idle function tree_canvas_reflow and an on-timeout function show_area_timeout. The first sets correct scrollbar sizes for the message list content, and the second shows the cursor.
With larger folders is the second called before the first, thus there is no movement possible, because the area is still small, even the passed-in numbers are correct.
Comment 17 Milan Crha 2010-02-10 14:47:35 UTC
Created attachment 153419 [details] [review]
proposed evo hack

for evolution;

This is a hack, I couldn't find anything better, whatever else I tried failed for some cases. Basically, when the message-list regen is done, I set the ETree to restore cursor position on reflow, thus in time when the scrollbar has correct bounds. So the previous scroll to cursor (which didn't work) can be faulty, but otherwise everything seems to work correctly for a user.
Comment 18 Matthew Barnes 2010-02-10 15:16:43 UTC
Nice work, Milan.  Patch looks fine to me.  Let's get this in and fine-tune if any missed corner cases crop up.
Comment 19 Milan Crha 2010-02-10 17:28:45 UTC
Created commit 62a56d5 in evo master (2.29.91+)