[gnome-2048/arnaudb/wip/gtk4: 45/57] Uncomment something.




commit 8328e14cfa54d0c00edbb0e73f7548b653a9b278
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Jul 15 17:23:30 2020 +0200

    Uncomment something.

 src/game-window.vala | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/game-window.vala b/src/game-window.vala
index a5cd4ea..ae55199 100644
--- a/src/game-window.vala
+++ b/src/game-window.vala
@@ -45,6 +45,7 @@ private class GameWindow : ApplicationWindow
             StyleContext.add_provider_for_display ((!) gdk_display, css_provider, 
STYLE_PROVIDER_PRIORITY_APPLICATION);
 
         _settings = new GLib.Settings ("org.gnome.TwentyFortyEight");
+        close_request.connect (_on_close_request);
 
         _install_ui_action_entries ();
 
@@ -70,13 +71,13 @@ private class GameWindow : ApplicationWindow
         _init_gestures ();
     }
 
-//    [GtkCallback]
-//    private void on_destroy ()
-//    {
-//        _game.save_game ();
-//        _save_window_state (this, ref _settings);
-//        base.destroy ();
-//    }
+    private inline bool _on_close_request ()
+    {
+        _game.save_game ();
+        _save_window_state (this, ref _settings);
+
+        return /* do not stop other handlers */ false;
+    }
 
     /*\
     * * init


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