[five-or-more/arnaudb/wip/gtk4: 1/9] Adapt size_allocate stuff.




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

    Adapt size_allocate stuff.

 src/window.vala | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/window.vala b/src/window.vala
index b7c30ec..3290b4d 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -129,6 +129,7 @@ private class GameWindow : 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;
@@ -145,15 +146,12 @@ private class GameWindow : ApplicationWindow
         window_tiled =      (state & tiled_state)                != 0;
     }
 
-    protected override void size_allocate (Allocation allocation)
+    private inline void on_size_changed (int width, int height)
     {
-        base.size_allocate (allocation);
-
         if (window_maximized || window_tiled)
             return;
-
-        window_width = allocation.width;
-        window_height = allocation.height;
+        window_width  = width;
+        window_height = height;
     }
 
     internal inline void on_shutdown ()


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