From 7660ca2579bbfec77e9294316da4016c2013f1d0 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Wed, 8 Apr 2020 12:02:28 -0300 Subject: [PATCH] clutter/effect: Override ClutterActorMeta.set_enabled Instead of using GObject.notify to queue a redraw, use the new ClutterActorMeta.set_enabled vfunc. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1187 --- clutter/clutter/clutter-effect.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/clutter/clutter/clutter-effect.c b/clutter/clutter/clutter-effect.c index cde26fc4d..81109ff0e 100644 --- a/clutter/clutter/clutter-effect.c +++ b/clutter/clutter/clutter-effect.c @@ -230,28 +230,26 @@ clutter_effect_real_pick (ClutterEffect *effect, } static void -clutter_effect_notify (GObject *gobject, - GParamSpec *pspec) +clutter_effect_set_enabled (ClutterActorMeta *meta, + gboolean is_enabled) { - if (strcmp (pspec->name, "enabled") == 0) - { - ClutterActorMeta *meta = CLUTTER_ACTOR_META (gobject); - ClutterActor *actor = clutter_actor_meta_get_actor (meta); + ClutterActorMetaClass *parent_class = + CLUTTER_ACTOR_META_CLASS (clutter_effect_parent_class); + ClutterActor *actor; - if (actor != NULL) - clutter_actor_queue_redraw (actor); - } + actor = clutter_actor_meta_get_actor (meta); + if (actor) + clutter_actor_queue_redraw (actor); - if (G_OBJECT_CLASS (clutter_effect_parent_class)->notify != NULL) - G_OBJECT_CLASS (clutter_effect_parent_class)->notify (gobject, pspec); + parent_class->set_enabled (meta, is_enabled); } static void clutter_effect_class_init (ClutterEffectClass *klass) { - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + ClutterActorMetaClass *actor_meta_class = CLUTTER_ACTOR_META_CLASS (klass); - gobject_class->notify = clutter_effect_notify; + actor_meta_class->set_enabled = clutter_effect_set_enabled; klass->pre_paint = clutter_effect_real_pre_paint; klass->post_paint = clutter_effect_real_post_paint;