Commit 3a8b714e authored by verdre's avatar verdre

clutter: Use G_PARAM_EXPLICIT_NOTIFY for actor and stage properties

Turns out GObject implicitly notifies all properties by default as soon
as a property setter is called, no matter if the property actually
changed or not. One can opt-out of this behavior by setting the
G_PARAM_EXPLICIT_NOTIFY flag.

So since almost all our properties get notified explicitely (well,
except ClutterActors deprecated show-on-set-parent property), set this
flag for all properties of ClutterActor and ClutterStage now. This
significantly reduces the number of notify:: signals emitted on
ClutterActors, because in gnome-shell javascript we usually set GObject
properties directly, not by going through the extra setter method.

More cleanups can be done in the future, since this flag is suitable for
almost every property in Clutter and even Mutter.

This fixes a crash where we'd hit a newly introduced assertion in
on_device_actor_reactive_changed() of ClutterStage because
notify::reactive got emitted multiple times.

Part-of: <!1651>
parent ad65c89d
Pipeline #240285 waiting for manual action with stages
This diff is collapsed.
......@@ -1359,7 +1359,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
P_("Perspective"),
P_("Perspective projection parameters"),
CLUTTER_TYPE_PERSPECTIVE,
CLUTTER_PARAM_READABLE);
CLUTTER_PARAM_READABLE |
G_PARAM_EXPLICIT_NOTIFY);
/**
* ClutterStage:title:
......@@ -1373,7 +1374,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
P_("Title"),
P_("Stage Title"),
NULL,
CLUTTER_PARAM_READWRITE);
CLUTTER_PARAM_READWRITE |
G_PARAM_EXPLICIT_NOTIFY);
/**
* ClutterStage:key-focus:
......@@ -1390,7 +1392,8 @@ clutter_stage_class_init (ClutterStageClass *klass)
P_("Key Focus"),
P_("The currently key focused actor"),
CLUTTER_TYPE_ACTOR,
CLUTTER_PARAM_READWRITE);
CLUTTER_PARAM_READWRITE |
G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment