[geary/mjog/716-no-notifications-when-hidden] Application.Controller: Permit notifications when no main window



commit c2adf8e0fc200f44c23dd7aff112fd11bef432ae
Author: Michael Gratton <mike vee net>
Date:   Wed Mar 4 11:29:38 2020 +1100

    Application.Controller: Permit notifications when no main window
    
    If there's no main window, the app must be running hidden, so
    notifications should be sent.
    
    Fixes #716

 src/client/application/application-controller.vala | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/client/application/application-controller.vala 
b/src/client/application/application-controller.vala
index a4d43b07..10de12e0 100644
--- a/src/client/application/application-controller.vala
+++ b/src/client/application/application-controller.vala
@@ -1351,15 +1351,16 @@ internal class Application.Controller : Geary.BaseObject {
     }
 
     private bool should_notify_new_messages(Geary.Folder folder) {
-        // A monitored folder must be selected to squelch notifications;
-        // if conversation list is at top of display, don't display
-        // and don't display if main window has top-level focus
+        // Don't show notifications if the top of the folder's
+        // conversations is visible. That is, if there is a main
+        // window, it's focused, the folder is selected, and the
+        // conversation list is at the top.
         MainWindow? window = this.application.last_active_main_window;
         return (
-            window != null &&
-            (folder != window.selected_folder ||
-             window.conversation_list_view.vadjustment.value != 0.0 ||
-             !window.has_toplevel_focus)
+            window == null ||
+            !window.has_toplevel_focus ||
+            window.selected_folder != folder ||
+            window.conversation_list_view.vadjustment.value > 0.0
         );
     }
 


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