[mutter] clutter/actor: Don't check handlers when emitting stage-views-changed



commit 52e2afa2ec7028e2ca206a07b9ea062448bfa855
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Sat Oct 24 23:50:51 2020 +0200

    clutter/actor: Don't check handlers when emitting stage-views-changed
    
    Turns out the g_signal_has_handler_pending() call in
    update_stage_views() is actually more expensive than comparing the
    sorted list (which is usually very short), so remove that and simply
    always emit the signal.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1524

 clutter/clutter/clutter-actor.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 6044382699..10a7336905 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -16049,12 +16049,8 @@ update_stage_views (ClutterActor *self)
                                                         &bounding_rect);
 
 out:
-  if (g_signal_has_handler_pending (self, actor_signals[STAGE_VIEWS_CHANGED],
-                                    0, TRUE))
-    {
-      if (!sorted_lists_equal (old_stage_views, priv->stage_views))
-        g_signal_emit (self, actor_signals[STAGE_VIEWS_CHANGED], 0);
-    }
+  if (!sorted_lists_equal (old_stage_views, priv->stage_views))
+    g_signal_emit (self, actor_signals[STAGE_VIEWS_CHANGED], 0);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]