mirror of
https://github.com/brl/mutter.git
synced 2025-07-05 10:31:18 +00:00
clutter/actor: Make sure expand_set flags are set correctly
If an actor's expand properties haven't been set explicitly, its expand flags are computed by traversing its children. However we currently also traverse into children when explicitly setting "expand" to FALSE, because that is the default value and the properties are only marked as explicitly-set when the value actually changed. Fix this, so propagating expand flags can be stopped without hacks like ```c g_object_set (actor, "x-expand", TRUE, NULL); g_object_set (actor, "x-expand", FALSE, NULL); `` Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3088>
This commit is contained in:
@ -18275,13 +18275,16 @@ clutter_actor_set_x_expand (ClutterActor *self,
|
|||||||
gboolean expand)
|
gboolean expand)
|
||||||
{
|
{
|
||||||
ClutterLayoutInfo *info;
|
ClutterLayoutInfo *info;
|
||||||
|
gboolean changed;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
expand = !!expand;
|
expand = !!expand;
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info (self);
|
info = _clutter_actor_get_layout_info (self);
|
||||||
if (info->x_expand != expand)
|
changed = info->x_expand != expand;
|
||||||
|
|
||||||
|
if (changed || !self->priv->x_expand_set)
|
||||||
{
|
{
|
||||||
info->x_expand = expand;
|
info->x_expand = expand;
|
||||||
|
|
||||||
@ -18289,6 +18292,7 @@ clutter_actor_set_x_expand (ClutterActor *self,
|
|||||||
|
|
||||||
clutter_actor_queue_compute_expand (self);
|
clutter_actor_queue_compute_expand (self);
|
||||||
|
|
||||||
|
if (changed)
|
||||||
g_object_notify_by_pspec (G_OBJECT (self),
|
g_object_notify_by_pspec (G_OBJECT (self),
|
||||||
obj_props[PROP_X_EXPAND]);
|
obj_props[PROP_X_EXPAND]);
|
||||||
}
|
}
|
||||||
@ -18330,13 +18334,16 @@ clutter_actor_set_y_expand (ClutterActor *self,
|
|||||||
gboolean expand)
|
gboolean expand)
|
||||||
{
|
{
|
||||||
ClutterLayoutInfo *info;
|
ClutterLayoutInfo *info;
|
||||||
|
gboolean changed;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
g_return_if_fail (CLUTTER_IS_ACTOR (self));
|
||||||
|
|
||||||
expand = !!expand;
|
expand = !!expand;
|
||||||
|
|
||||||
info = _clutter_actor_get_layout_info (self);
|
info = _clutter_actor_get_layout_info (self);
|
||||||
if (info->y_expand != expand)
|
changed = info->y_expand != expand;
|
||||||
|
|
||||||
|
if (changed || !self->priv->y_expand_set)
|
||||||
{
|
{
|
||||||
info->y_expand = expand;
|
info->y_expand = expand;
|
||||||
|
|
||||||
@ -18344,6 +18351,7 @@ clutter_actor_set_y_expand (ClutterActor *self,
|
|||||||
|
|
||||||
clutter_actor_queue_compute_expand (self);
|
clutter_actor_queue_compute_expand (self);
|
||||||
|
|
||||||
|
if (changed)
|
||||||
g_object_notify_by_pspec (G_OBJECT (self),
|
g_object_notify_by_pspec (G_OBJECT (self),
|
||||||
obj_props[PROP_Y_EXPAND]);
|
obj_props[PROP_Y_EXPAND]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user