[gnome-taquin/arnaudb/wip/gtk4] The size-allocate signal is gone, part 2.



commit 5d18c863eefc9ffe096494b5f5ce4b7e873685ec
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Tue Sep 29 17:57:42 2020 +0200

    The size-allocate signal is gone, part 2.

 data/ui/adaptative-window.ui | 3 +--
 src/adaptative-window.vala   | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/data/ui/adaptative-window.ui b/data/ui/adaptative-window.ui
index 6872746..3155908 100644
--- a/data/ui/adaptative-window.ui
+++ b/data/ui/adaptative-window.ui
@@ -20,7 +20,6 @@
   <template class="AdaptativeWindow" parent="GtkApplicationWindow">
     <property name="height-request">284</property>  <!-- 288px max for Purism Librem 5 landscape, for 720px 
width; update gschema also -->
     <property name="width-request">350</property>   <!-- 360px max for Purism Librem 5 portrait, for 648px 
height; update gschema also -->
-    <signal name="map"                  handler="init_state_watcher"/>
-    <signal name="size-allocate"        handler="on_size_allocate"/>
+    <signal name="map" handler="init_state_watcher"/>
   </template>
 </interface>
diff --git a/src/adaptative-window.vala b/src/adaptative-window.vala
index d74f9fa..ea80a5b 100644
--- a/src/adaptative-window.vala
+++ b/src/adaptative-window.vala
@@ -229,6 +229,7 @@ private abstract class AdaptativeWindow : ApplicationWindow
             assert_not_reached ();
         surface = (Gdk.Toplevel) (!) nullable_surface;
         surface.notify ["state"].connect (on_window_state_event);
+        surface.size_changed.connect (on_size_changed);
     }
 
     private Gdk.Toplevel surface;
@@ -259,8 +260,7 @@ private abstract class AdaptativeWindow : ApplicationWindow
     protected abstract void on_fullscreen ();
     protected abstract void on_unfullscreen ();
 
-    [GtkCallback]
-    private void on_size_allocate (int width, int height)
+    private inline void on_size_changed (Gdk.Surface _surface, int width, int height)
     {
         update_adaptative_children (ref width, ref height);
         update_window_state ();


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