st/box-layout: Set layout manager type

Now that ClutterActor itself provides API to use a particular
layout manager type, we can use that instead of our own mechanism.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3046>
This commit is contained in:
Florian Müllner 2023-12-06 15:20:56 +01:00 committed by Marge Bot
parent e746b038ef
commit ef2e96bb32

View File

@ -158,13 +158,9 @@ on_layout_manager_notify (GObject *object,
ClutterActor *actor = CLUTTER_ACTOR (object);
ClutterLayoutManager *layout = clutter_actor_get_layout_manager (actor);
g_warn_if_fail (CLUTTER_IS_BOX_LAYOUT (layout));
if (layout == NULL)
return;
g_signal_connect_swapped (layout, "layout-changed",
G_CALLBACK (clutter_actor_queue_relayout), actor);
g_signal_connect (layout, "notify", G_CALLBACK (layout_notify), object);
}
@ -172,6 +168,7 @@ static void
st_box_layout_class_init (StBoxLayoutClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
object_class->get_property = st_box_layout_get_property;
@ -207,6 +204,8 @@ st_box_layout_class_init (StBoxLayoutClass *klass)
ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
g_object_class_install_properties (object_class, N_PROPS, props);
clutter_actor_class_set_layout_manager_type (actor_class, CLUTTER_TYPE_BOX_LAYOUT);
}
static void
@ -216,7 +215,6 @@ st_box_layout_init (StBoxLayout *self)
g_signal_connect (self, "notify::layout-manager",
G_CALLBACK (on_layout_manager_notify), NULL);
clutter_actor_set_layout_manager (CLUTTER_ACTOR (self), clutter_box_layout_new ());
}
/**