[gnome-klotski/arnaudb/wip/gtk4: 39/42] Replace destroy by close-request.



commit 02c70ee4af8dad61432767397c5d3271d7fe36a4
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Jun 1 22:44:53 2020 +0200

    Replace destroy by close-request.
    
    TODO test.

 data/ui/klotski.ui      | 2 +-
 src/klotski-window.vala | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/data/ui/klotski.ui b/data/ui/klotski.ui
index 96a696e..2efce7e 100644
--- a/data/ui/klotski.ui
+++ b/data/ui/klotski.ui
@@ -315,7 +315,7 @@
     <property name="width-request">600</property>
     <property name="height-request">400</property>
     <signal name="map" handler="init_state_watcher"/>
-    <signal name="destroy" handler="on_destroy"/>
+    <signal name="close-request" handler="on_destroy"/>
     <child type="titlebar">
       <object class="GtkHeaderBar" id="headerbar">
         <property name="show-title-buttons">True</property>
diff --git a/src/klotski-window.vala b/src/klotski-window.vala
index 23a357c..ea61146 100644
--- a/src/klotski-window.vala
+++ b/src/klotski-window.vala
@@ -679,10 +679,11 @@ private class KlotskiWindow : ApplicationWindow
     }
 
     [GtkCallback]
-    private void on_destroy ()
+    private bool on_destroy ()
     {
         settings.set_int (KEY_LEVEL, current_level);
         save_window_state ();
+        return false;
     }
 
     /*\


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