From 90c4b6492fc227d59a53d6fa0b7c1cb602c52ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 20 Apr 2020 22:39:08 +0200 Subject: [PATCH] stage: Only invoke paint phase callbacks when painting views These phase callbacks are not intended to be inovked when something secondary is painting the stage, such as a screen cast stream, or similar. Thus, only invoke the callbacks when there is a view associated with the paint context, which will not be the case for offscreen painting. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1207 --- src/backends/meta-stage.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c index d5a5d8720..e5f156880 100644 --- a/src/backends/meta-stage.c +++ b/src/backends/meta-stage.c @@ -198,17 +198,22 @@ meta_stage_paint (ClutterActor *actor, CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor, paint_context); view = clutter_paint_context_get_stage_view (paint_context); - - notify_watchers_for_mode (stage, view, paint_context, - META_STAGE_WATCH_AFTER_ACTOR_PAINT); + if (view) + { + notify_watchers_for_mode (stage, view, paint_context, + META_STAGE_WATCH_AFTER_ACTOR_PAINT); + } g_signal_emit (stage, signals[ACTORS_PAINTED], 0); for (l = stage->overlays; l; l = l->next) meta_overlay_paint (l->data, paint_context); - notify_watchers_for_mode (stage, view, paint_context, - META_STAGE_WATCH_AFTER_OVERLAY_PAINT); + if (view) + { + notify_watchers_for_mode (stage, view, paint_context, + META_STAGE_WATCH_AFTER_OVERLAY_PAINT); + } } static void