[gnome-games] ui: Inhibit logout while playing



commit 6a086add5ddd413e0a12e68a373b7e1afa5cd492
Author: Mathieu Bridon <bochecha daitauha fr>
Date:   Wed Aug 17 11:49:43 2016 +0200

    ui: Inhibit logout while playing
    
    This allows notifying the user when they try to logout that a game was
    running, giving them a chance to cancel the logout, go back to the game,
    save their progress, play for an hour or two because they got caught
    back in, save their progress again and then finally logout.
    
    This also handles poweroff, since it first logs out.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769968

 src/ui/application-window.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala
index b7938c2..7154f47 100644
--- a/src/ui/application-window.vala
+++ b/src/ui/application-window.vala
@@ -118,7 +118,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (run_game_cancellable == cancellable)
                        run_game_cancellable = null;
 
-               inhibit (Gtk.ApplicationInhibitFlags.IDLE);
+               inhibit (Gtk.ApplicationInhibitFlags.IDLE | Gtk.ApplicationInhibitFlags.LOGOUT);
        }
 
        public bool quit_game () {
@@ -197,7 +197,7 @@ private class Games.ApplicationWindow : Gtk.ApplicationWindow {
                if (quit_game ())
                        ui_state = UiState.COLLECTION;
 
-               uninhibit (Gtk.ApplicationInhibitFlags.IDLE);
+               uninhibit (Gtk.ApplicationInhibitFlags.IDLE | Gtk.ApplicationInhibitFlags.LOGOUT);
        }
 
        private void run_game_with_cancellable (Game game, Cancellable cancellable) {


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