From 450ab0fdb94da77143c2301720bef114bc028230 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Mon, 8 Nov 2021 05:37:22 +0100 Subject: [PATCH] window-group: Disable culling when rendering to non-stage-view buffer When rendering to a buffer that is not the stage view buffer, we can not know where the buffer will be displayed on the screen. As a result we also can not know what translation would need to be applied to culling. This was causing glitches when the gnome-shell magnifier was applying offscreen effects. ClutterOffscreenEffect causes MetaWindowGroup to be rendered to an offscreen buffer at an offset, because it draws to a slightly larger texture with an accordingly translated origin. This translation then later is canceled out again when the offscreen buffer is drawn. To meta_actor_painting_untransformed() however which only sees the translation used when drawing to the buffer this looked like the window group was being rendered at the offset. This then lead to redraw_clip getting translated accordingly, resulting in wrong coordinates used for culling. Similarly this was leading to issues when taking area screenshots while at 1x zoom. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1678 Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4876 Part-of: --- src/compositor/meta-window-group.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-window-group.c b/src/compositor/meta-window-group.c index d526805fe..16ff2db09 100644 --- a/src/compositor/meta-window-group.c +++ b/src/compositor/meta-window-group.c @@ -91,9 +91,13 @@ meta_window_group_paint (ClutterActor *actor, if (clutter_actor_is_in_clone_paint (actor)) { CoglFramebuffer *fb; + ClutterStageView *view; fb = clutter_paint_context_get_framebuffer (paint_context); - if (!meta_actor_painting_untransformed (fb, + view = clutter_paint_context_get_stage_view (paint_context); + if (!view || + fb != clutter_stage_view_get_framebuffer (view) || + !meta_actor_painting_untransformed (fb, screen_width, screen_height, screen_width,