[five-or-more/arnaudb/wip/gtk4: 70/80] Adapt size_allocate stuff.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [five-or-more/arnaudb/wip/gtk4: 70/80] Adapt size_allocate stuff.
- Date: Sun, 25 Oct 2020 18:51:47 +0000 (UTC)
commit 213ed43404a1c02a4df41a6d26118167baec149b
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 52d754a..74b4f24 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]