[mutter/gbsneto/more-screencast: 5/9] meta/stage: Process BEFORE_PAINT watchers at ClutterStage.before_paint




commit 454a79d15e573d122874f1972054c1503f318fad
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Aug 31 10:30:06 2020 -0300

    meta/stage: Process BEFORE_PAINT watchers at ClutterStage.before_paint
    
    This way, watches can properly get notified about before-paint without
    having to connect to the corresponding signal.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1421

 src/backends/meta-stage.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index f2040362f7..75244de03b 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -192,6 +192,16 @@ notify_watchers_for_mode (MetaStage           *stage,
     }
 }
 
+static void
+meta_stage_before_paint (ClutterStage     *stage,
+                         ClutterStageView *view)
+{
+  MetaStage *meta_stage = META_STAGE (stage);
+
+  notify_watchers_for_mode (meta_stage, view, NULL,
+                            META_STAGE_WATCH_BEFORE_PAINT);
+}
+
 static void
 meta_stage_paint (ClutterActor        *actor,
                   ClutterPaintContext *paint_context)
@@ -246,9 +256,6 @@ meta_stage_paint_view (ClutterStage         *stage,
 {
   MetaStage *meta_stage = META_STAGE (stage);
 
-  notify_watchers_for_mode (meta_stage, view, NULL,
-                            META_STAGE_WATCH_BEFORE_PAINT);
-
   CLUTTER_STAGE_CLASS (meta_stage_parent_class)->paint_view (stage, view,
                                                              redraw_clip);
 
@@ -298,6 +305,7 @@ meta_stage_class_init (MetaStageClass *klass)
 
   stage_class->activate = meta_stage_activate;
   stage_class->deactivate = meta_stage_deactivate;
+  stage_class->before_paint = meta_stage_before_paint;
   stage_class->paint_view = meta_stage_paint_view;
 
   signals[ACTORS_PAINTED] = g_signal_new ("actors-painted",


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