From 436fac7f2b9524b209ad90a7acbc2b803ebd9f67 Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Sun, 20 Jan 2019 11:44:37 +1030 Subject: [PATCH] Don't auto-mark email as read when window is not in the foreground --- src/client/conversation-viewer/conversation-list-box.vala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/conversation-viewer/conversation-list-box.vala b/src/client/conversation-viewer/conversation-list-box.vala index 519e51a4..b7f19425 100644 --- a/src/client/conversation-viewer/conversation-list-box.vala +++ b/src/client/conversation-viewer/conversation-list-box.vala @@ -870,7 +870,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface { // size of the body will be off, affecting the visibility // of emails further down the conversation. if (email_view.email.is_unread().is_certain() && - conversation_message.web_view.has_valid_height && + email_view.message_bodies_loaded && !email_view.is_manually_read) { int body_top = 0; int body_left = 0; @@ -899,7 +899,11 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface { return true; }); - if (email_ids.size > 0) { + // Only-automark if the window is currently focused + Gtk.Window? top_level = get_toplevel() as Gtk.Window; + if (top_level != null && + top_level.is_active && + email_ids.size > 0) { Geary.EmailFlags flags = new Geary.EmailFlags(); flags.add(Geary.EmailFlags.UNREAD); mark_emails(email_ids, null, flags);