|
|
79df40 |
From d4b6d9e3190e2cae30fb5bbc41a76286bbed0214 Mon Sep 17 00:00:00 2001
|
|
|
79df40 |
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
|
|
|
79df40 |
Date: Sat, 27 Jul 2019 00:20:55 +0200
|
|
|
79df40 |
Subject: [PATCH 10/28] clutter/actor-meta: Notify when actor property changed
|
|
|
79df40 |
|
|
|
79df40 |
The ActorMeta contains an actor property holding the parent actor, however when
|
|
|
79df40 |
it changes no notification is emitted.
|
|
|
79df40 |
|
|
|
79df40 |
Other tham this, since the set_actor vfunc is called on meta destruction, it
|
|
|
79df40 |
could be a problem if the virtual function is implemented by a Javascript object
|
|
|
79df40 |
since the JS context will try to use it during its disposition.
|
|
|
79df40 |
|
|
|
79df40 |
https://gitlab.gnome.org/GNOME/mutter/merge_requests/682
|
|
|
79df40 |
---
|
|
|
79df40 |
clutter/clutter/clutter-actor-meta.c | 1 +
|
|
|
79df40 |
1 file changed, 1 insertion(+)
|
|
|
79df40 |
|
|
|
79df40 |
diff --git a/clutter/clutter/clutter-actor-meta.c b/clutter/clutter/clutter-actor-meta.c
|
|
|
79df40 |
index 085f2f65d..2843ea222 100644
|
|
|
79df40 |
--- a/clutter/clutter/clutter-actor-meta.c
|
|
|
79df40 |
+++ b/clutter/clutter/clutter-actor-meta.c
|
|
|
79df40 |
@@ -73,60 +73,61 @@ enum
|
|
|
79df40 |
PROP_LAST
|
|
|
79df40 |
};
|
|
|
79df40 |
|
|
|
79df40 |
static GParamSpec *obj_props[PROP_LAST];
|
|
|
79df40 |
|
|
|
79df40 |
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterActorMeta,
|
|
|
79df40 |
clutter_actor_meta,
|
|
|
79df40 |
G_TYPE_INITIALLY_UNOWNED)
|
|
|
79df40 |
|
|
|
79df40 |
static void
|
|
|
79df40 |
on_actor_destroy (ClutterActor *actor,
|
|
|
79df40 |
ClutterActorMeta *meta)
|
|
|
79df40 |
{
|
|
|
79df40 |
meta->priv->actor = NULL;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
static void
|
|
|
79df40 |
clutter_actor_meta_real_set_actor (ClutterActorMeta *meta,
|
|
|
79df40 |
ClutterActor *actor)
|
|
|
79df40 |
{
|
|
|
79df40 |
if (meta->priv->actor == actor)
|
|
|
79df40 |
return;
|
|
|
79df40 |
|
|
|
79df40 |
if (meta->priv->destroy_id != 0)
|
|
|
79df40 |
{
|
|
|
79df40 |
g_signal_handler_disconnect (meta->priv->actor, meta->priv->destroy_id);
|
|
|
79df40 |
meta->priv->destroy_id = 0;
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
meta->priv->actor = actor;
|
|
|
79df40 |
+ g_object_notify_by_pspec (G_OBJECT (meta), obj_props[PROP_ACTOR]);
|
|
|
79df40 |
|
|
|
79df40 |
if (meta->priv->actor != NULL)
|
|
|
79df40 |
meta->priv->destroy_id = g_signal_connect (meta->priv->actor, "destroy",
|
|
|
79df40 |
G_CALLBACK (on_actor_destroy),
|
|
|
79df40 |
meta);
|
|
|
79df40 |
}
|
|
|
79df40 |
|
|
|
79df40 |
static void
|
|
|
79df40 |
clutter_actor_meta_set_property (GObject *gobject,
|
|
|
79df40 |
guint prop_id,
|
|
|
79df40 |
const GValue *value,
|
|
|
79df40 |
GParamSpec *pspec)
|
|
|
79df40 |
{
|
|
|
79df40 |
ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject);
|
|
|
79df40 |
|
|
|
79df40 |
switch (prop_id)
|
|
|
79df40 |
{
|
|
|
79df40 |
case PROP_NAME:
|
|
|
79df40 |
clutter_actor_meta_set_name (meta, g_value_get_string (value));
|
|
|
79df40 |
break;
|
|
|
79df40 |
|
|
|
79df40 |
case PROP_ENABLED:
|
|
|
79df40 |
clutter_actor_meta_set_enabled (meta, g_value_get_boolean (value));
|
|
|
79df40 |
break;
|
|
|
79df40 |
|
|
|
79df40 |
default:
|
|
|
79df40 |
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
|
|
|
79df40 |
break;
|
|
|
79df40 |
}
|
|
|
79df40 |
}
|
|
|
79df40 |
--
|
|
|
79df40 |
2.26.2
|
|
|
79df40 |
|