[five-or-more/arnaudb/wip/gtk4: 47/50] Comment size_allocate stuff.



commit 52880f6d8bf94ea981dfbbc90de4a61c087f62ae
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon May 11 11:58:46 2020 +0200

    Comment size_allocate stuff.

 src/window.vala | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index 39fe991..ab2b602 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -74,6 +74,7 @@ private class GameWindow : ApplicationWindow
     {
         add_action_entries (win_actions, this);
 
+//        size_allocate.connect (on_size_allocate);
         map.connect (init_state_watcher);
 
         SimpleAction theme_action = (SimpleAction) lookup_action ("change-theme");
@@ -145,15 +146,17 @@ private class GameWindow : ApplicationWindow
         window_tiled =      (state & tiled_state)                != 0;
     }
 
-    protected override void size_allocate (Allocation allocation)
+    private inline void on_size_allocate (int width, int height, int baseline)
     {
-        base.size_allocate (allocation);
-
         if (window_maximized || window_tiled)
             return;
-
-        window_width = allocation.width;
-        window_height = allocation.height;
+        int? _window_width = null;
+        int? _window_height = null;
+        get_size (out _window_width, out _window_height);
+        if (_window_width == null || _window_height == null)
+            return;
+        window_width = (!) _window_width;
+        window_height = (!) _window_height;
     }
 
     internal inline void on_shutdown ()


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