[gnome-klotski/arnaudb/wip/gtk4: 38/42] The size-allocate signal is gone.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-klotski/arnaudb/wip/gtk4: 38/42] The size-allocate signal is gone.
- Date: Mon, 1 Jun 2020 21:24:08 +0000 (UTC)
commit 2a0d556349e19e237ac12f82c5ea254e5759915b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Mon Jun 1 22:39:39 2020 +0200
The size-allocate signal is gone.
data/ui/klotski.ui | 1 -
src/klotski-window.vala | 9 ++-------
2 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/data/ui/klotski.ui b/data/ui/klotski.ui
index 37ec405..96a696e 100644
--- a/data/ui/klotski.ui
+++ b/data/ui/klotski.ui
@@ -314,7 +314,6 @@
<!-- <initial-focus name=""/> -->
<property name="width-request">600</property>
<property name="height-request">400</property>
- <signal name="size-allocate" handler="on_size_allocate"/>
<signal name="map" handler="init_state_watcher"/>
<signal name="destroy" handler="on_destroy"/>
<child type="titlebar">
diff --git a/src/klotski-window.vala b/src/klotski-window.vala
index a9200f2..23a357c 100644
--- a/src/klotski-window.vala
+++ b/src/klotski-window.vala
@@ -633,12 +633,6 @@ private class KlotskiWindow : ApplicationWindow
* * Window management callbacks
\*/
- [GtkCallback]
- private void on_size_allocate (int width, int height)
- {
- update_window_state ();
- }
-
[GtkCallback]
private inline void init_state_watcher ()
{
@@ -647,6 +641,7 @@ private class KlotskiWindow : ApplicationWindow
assert_not_reached ();
surface = (Gdk.Toplevel) (!) nullable_surface;
surface.notify ["state"].connect (on_window_state_event);
+ surface.size_changed.connect (update_window_state);
}
private Gdk.Toplevel surface;
@@ -694,7 +689,7 @@ private class KlotskiWindow : ApplicationWindow
* * manage window state
\*/
- private void update_window_state () // called on size-allocate
+ private void update_window_state (int width, int height)
{
if (window_is_maximized || window_is_tiled || window_is_fullscreen)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]