[geary/gnumdk/stable: 1/2] client: Mark email as read if row expanded




commit 4a8b7e2c008c0f06470dcbf44f1efcbb38196b34
Author: Cédric Bellegarde <cedric bellegarde adishatz org>
Date:   Tue Sep 20 14:01:05 2022 +0200

    client: Mark email as read if row expanded
    
    Geary is trying to check if an email is fully read:
    - It's quite buggy, you often need to scroll up and down to mark the
      mail as read
    - It forces user to scroll down to the email signature just to mark
      the mail as read
    
    Simplify this: an email is read if expanded

 .../conversation-viewer/conversation-list-box.vala | 32 ++++------------------
 1 file changed, 5 insertions(+), 27 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-list-box.vala 
b/src/client/conversation-viewer/conversation-list-box.vala
index b8a7c0643..4335255d2 100644
--- a/src/client/conversation-viewer/conversation-list-box.vala
+++ b/src/client/conversation-viewer/conversation-list-box.vala
@@ -1264,9 +1264,6 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
     private void check_mark_read() {
         Gee.List<Geary.EmailIdentifier> email_ids =
             new Gee.LinkedList<Geary.EmailIdentifier>();
-        Gtk.Adjustment adj = get_adjustment();
-        int top_bound = (int) adj.value;
-        int bottom_bound = top_bound + (int) adj.page_size;
 
         this.foreach((child) => {
             // Don't bother with not-yet-loaded emails since the
@@ -1277,32 +1274,13 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
             Geary.Email? email = (view != null) ? view.email : null;
             if (row != null &&
                 row.is_expanded &&
-                view.message_body_state == COMPLETED &&
                 !view.is_manually_read &&
                 email.is_unread().is_certain()) {
-                ConversationMessage conversation_message = view.primary_message;
-                 int body_top = 0;
-                 int body_left = 0;
-                 conversation_message.web_view_translate_coordinates(
-                     this,
-                     0, 0,
-                     out body_left, out body_top
-                 );
-
-                 int body_height = conversation_message.web_view_get_allocated_height();
-                 int body_bottom = body_top + body_height;
-
-                 // Only mark the email as read if it's actually visible
-                 if (body_height > 0 &&
-                     body_bottom > top_bound &&
-                     body_top + MARK_READ_PADDING < bottom_bound) {
-                     email_ids.add(view.email.id);
-
-                     // Since it can take some time for the new flags
-                     // to round-trip back to our signal handlers,
-                     // mark as manually read here
-                     view.is_manually_read = true;
-                 }
+                email_ids.add(view.email.id);
+                // Since it can take some time for the new flags
+                // to round-trip back to our signal handlers,
+                // mark as manually read here
+                view.is_manually_read = true;
              }
         });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]