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 730145 - Switching folders marks message as seen
Switching folders marks message as seen
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
3.12.x (obsolete)
Other Linux
: Normal minor
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2014-05-14 20:25 UTC by Carl Schaefer
Modified: 2014-05-23 16:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch/hack; "works for me" (5.28 KB, text/plain)
2014-05-14 20:25 UTC, Carl Schaefer
Details

Description Carl Schaefer 2014-05-14 20:25:20 UTC
Created attachment 276559 [details]
patch/hack; "works for me"

Each folder can have a 'current message' that is displayed when it is selected.  Selecting a folder causes its current message to be marked 'read' if:

1) the message preview pane is visible, and
2) org.gnome.evolution.mail.mark-seen is checked

I don't like this behavior, and based on this comment in mail/e-mail-reader.c

        /* These flags work together to prevent message selection
         * restoration after a folder switch from automatically
         * marking the message as read.  We only want that to
         * happen when the -user- selects a message. */
        guint folder_was_just_selected : 1;
        guint restoring_message_selection : 1;
        guint avoid_next_mark_as_seen : 1;

it seems that this behavior isn't intentional.

I've attached a patch that fixes it for me and doesn't have any side-effects I've noticed, but since it was written with little understanding of how e-mail-reader.c actually works, it's likely wrong in one or more ways...
Comment 1 Milan Crha 2014-05-23 13:13:18 UTC
Thanks for a bug report and a patch.

+		/* ??? hopefully there's a better way, but without this
+		 * clicking on the currently displayed message after
+		 * switching to a folder doesn't mark the message as read */
+		if (message_list_selected_count(message_list) == 1)
+		    schedule_timeout_mark_seen (reader);

I do not agree with this, this behaviour is the last thing you want to do. The right thing is to click the envelope icon, usually the most-left column, which switches the message's read/unread state.

+	/* ??? without this, the current message
+	 * is not displayed after this sequence:
+	 * . hide message body pane
+	 * . select different folder
+	 * . unhide message body pane
+	 */
+	priv = E_MAIL_READER_GET_PRIVATE (reader);
+	priv->folder_was_just_selected = FALSE;

This happens, because the events which unset priv->folder_was_just_selected were not triggered with the disabled preview panel. Thus it's correct here.
Comment 2 Milan Crha 2014-05-23 13:27:21 UTC
I took your patch and adapted it according to comment #1.

Created commit daee89c in evo master (3.13.2+) [1]
Created commit ddadd86 in evo evolution-3-12 (3.12.3+)

[1] https://git.gnome.org/browse/evolution/commit/?id=daee89c
Comment 3 Carl Schaefer 2014-05-23 16:02:31 UTC
Thank you for looking at this bug, Milan.  Since I submitted it, I've noticed that the "mark seen" timeout can also be triggered by toggling View:Group_By_Threads.  I assume there are other paths too, since as Matthew Barnes mentioned on evolution-list, there are a "multitude
of reasons a message list may be regenerated."

My personal preference would be for the "mark seen" timeout to be set only when one of these happens:
1) a user selects a message (by click, up/down key or Enter)
2) a message is automatically displayed after a previous message is deleted

but I can't say whether this would be appropriate behavior in general...