From 797c34924590e693da57ff50e9f2a4ced444557c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 20 Apr 2020 22:41:12 +0200 Subject: [PATCH] clutter/paint-context: Add 'no-cursors' paint flag Will be used by the stage to not paint the overlays. We skip all overlays since overlays are only ever used for pointer cursors when the hardware cursors cannot or should not be used. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1222 --- clutter/clutter/clutter-paint-context-private.h | 1 + clutter/clutter/clutter-paint-context.c | 2 +- src/backends/meta-stage.c | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/clutter/clutter/clutter-paint-context-private.h b/clutter/clutter/clutter-paint-context-private.h index 32c54c0ab..4cc72043e 100644 --- a/clutter/clutter/clutter-paint-context-private.h +++ b/clutter/clutter/clutter-paint-context-private.h @@ -23,6 +23,7 @@ typedef enum _ClutterPaintFlag { CLUTTER_PAINT_FLAG_NONE = 0, + CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0, } ClutterPaintFlag; ClutterPaintContext * clutter_paint_context_new_for_view (ClutterStageView *view, diff --git a/clutter/clutter/clutter-paint-context.c b/clutter/clutter/clutter-paint-context.c index d331f97bb..fc519c058 100644 --- a/clutter/clutter/clutter-paint-context.c +++ b/clutter/clutter/clutter-paint-context.c @@ -66,7 +66,7 @@ clutter_paint_context_new_for_framebuffer (CoglFramebuffer *framebuffer) paint_context = g_new0 (ClutterPaintContext, 1); g_ref_count_init (&paint_context->ref_count); - paint_context->paint_flags = CLUTTER_PAINT_FLAG_NONE; + paint_context->paint_flags = CLUTTER_PAINT_FLAG_NO_CURSORS; clutter_paint_context_push_framebuffer (paint_context, framebuffer); diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c index e3efe1cd8..43b0ecb2a 100644 --- a/src/backends/meta-stage.c +++ b/src/backends/meta-stage.c @@ -206,8 +206,12 @@ meta_stage_paint (ClutterActor *actor, g_signal_emit (stage, signals[ACTORS_PAINTED], 0); - for (l = stage->overlays; l; l = l->next) - meta_overlay_paint (l->data, paint_context); + if (!(clutter_paint_context_get_paint_flags (paint_context) & + CLUTTER_PAINT_FLAG_NO_CURSORS)) + { + for (l = stage->overlays; l; l = l->next) + meta_overlay_paint (l->data, paint_context); + } if (view) {