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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3613>
This commit is contained in:
Florian Müllner 2025-01-24 14:21:51 +01:00
parent 4bef27d85c
commit a80e5a8c39

View File

@ -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