1
0
Fork 0

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2080>
This commit is contained in:
Sebastian Keller 2021-11-08 05:37:22 +01:00 committed by Marge Bot
parent 36481b8d21
commit 450ab0fdb9

View file

@ -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,