[gnome-tetravex/arnaudb/wip/gtk4: 28/32] Fix size_allocate.



commit 6037dbefbe3ea5a6b5fcfd0b68b426ed70e20077
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Wed Apr 1 18:25:56 2020 +0200

    Fix size_allocate.

 src/gnome-tetravex.vala | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-tetravex.vala b/src/gnome-tetravex.vala
index f6b76c5..cc1632f 100644
--- a/src/gnome-tetravex.vala
+++ b/src/gnome-tetravex.vala
@@ -539,9 +539,13 @@ private class Tetravex : Gtk.Application
     {
         if (window_is_maximized || window_is_tiled || window_is_fullscreen)
             return;
-
-        window_width = width;
-        window_height = height;
+        int? _window_width = null;
+        int? _window_height = null;
+        window.get_size (out _window_width, out _window_height);
+        if (_window_width == null || _window_height == null)
+            return;
+        window_width = (!) _window_width;
+        window_height = (!) _window_height;
     }
 
     private void init_state_watcher ()


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