[mutter/cherry-pick-450ab0fd-2] window-group: Disable culling when rendering to non-stage-view buffer




commit 1af58b566af90f84f4c0f37d14b1e93c356875c0
Author: Sebastian Keller <skeller gnome org>
Date:   Mon Nov 8 05:37:22 2021 +0100

    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>
    
    
    (cherry picked from commit 450ab0fdb94da77143c2301720bef114bc028230)

 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 d526805fee..16ff2db097 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,


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