[gnome-games] application-window: Fix quit dialog not appearing



commit 0251ffdebd3d3d763e6efb579c38e10d0289bfd2
Author: Yetizone <andreii lisita gmail com>
Date:   Sun Feb 3 17:17:35 2019 +0200

    application-window: Fix quit dialog not appearing

 src/ui/application-window.vala | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index 389e139d..0d6b80fa 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -475,10 +475,13 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (display_box.runner == null)
                        return true;
 
-               display_box.runner.stop ();
+               display_box.runner.pause ();
+
+               if (display_box.runner.can_quit_safely) {
+                       display_box.runner.stop();
 
-               if (display_box.runner.can_quit_safely)
                        return true;
+               }
 
                if (quit_dialog != null)
                        return false;
@@ -492,8 +495,13 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                });
 
                var response = quit_dialog.run ();
-               quit_dialog.destroy ();
-               quit_dialog = null;
+
+               // The null check is necessary because the dialog could already
+               // be canceled by this point
+               if (quit_dialog != null) {
+                       quit_dialog.destroy ();
+                       quit_dialog = null;
+               }
 
                if (cancellable.is_cancelled ())
                        return cancel_quitting_game ();


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