From a80e5a8c39497f4874b9c6051bbc462f7f7988ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 24 Jan 2025 14:21:51 +0100 Subject: [PATCH] st/box-layout: Fix forwarding `vertical` changes Our code to "forward" `notify` signals from the underlying layout manager for the `vertical` property broke when ClutterLayoutManager removed its own `vertical` property. Property changes via the underlying layout manager should be rare, but still worth fixing, so explicitly connect to `notify::orientation` now. Part-of: --- src/st/st-box-layout.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c index db174e40c..059a81dd1 100644 --- a/src/st/st-box-layout.c +++ b/src/st/st-box-layout.c @@ -131,15 +131,12 @@ st_box_layout_style_changed (StWidget *self) } static void -layout_notify (GObject *object, - GParamSpec *pspec, - gpointer user_data) +on_layout_orientation_changed (GObject *object, + GParamSpec *pspec, + gpointer user_data) { - GObject *self = user_data; - const char *prop_name = g_param_spec_get_name (pspec); - - if (g_object_class_find_property (G_OBJECT_GET_CLASS (self), prop_name)) - g_object_notify (self, prop_name); + GObject *box = user_data; + g_object_notify_by_pspec (box, props[PROP_VERTICAL]); } static void @@ -153,7 +150,8 @@ on_layout_manager_notify (GObject *object, if (layout == NULL) return; - g_signal_connect (layout, "notify", G_CALLBACK (layout_notify), object); + g_signal_connect (layout, "notify::orientation", + G_CALLBACK (on_layout_orientation_changed), object); } static void