[gnome-boxes/gnome-3-20] app: Simply quit() on removal of main window



commit 35d4693adec8042036fb2a9917040cbbef257012
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Mar 29 18:13:50 2016 +0100

    app: Simply quit() on removal of main window
    
    Our shutdown() implementation needs to cleanup/shutdown all windows and
    it won't do that if we already remove the main window from the list
    of all the windows (that shutdown() iterates over) before launching the
    shutdown process.
    
    This fixes the issue of notifications not getting dismissed (and hence
    deletion of boxes not happning for deletion notifications) if user quits
    Boxes by pressing the 'x' button in the titlebar, instead of Ctrl+q
    shortcut.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761479

 src/app.vala |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 841c731..e5e24eb 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -580,6 +580,9 @@ private class Boxes.App: Gtk.Application {
     }
 
     public new bool remove_window (AppWindow window) {
+        if (windows.length () == 1)
+            return quit_app ();
+
         var initial_windows_count = windows.length ();
         bool window_was_main = (window == main_window);
 
@@ -587,12 +590,10 @@ private class Boxes.App: Gtk.Application {
             (window.current_item as Machine).window = null;
 
         window.hide ();
+
         windows.remove (window);
         base.remove_window (window);
 
-        if (windows.length () == 0)
-            return quit_app ();
-
         // If the main window have been removed,
         // populate the new main window's collection view.
         if (window_was_main)


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