From 1ce933e281ec6d9333b318ef485465e1cdf8b9c1 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 17 Jan 2020 18:11:03 +0100 Subject: [PATCH] window-actor/x11: Get frame rect from the buffer size When building the frame mask, the current reported frame size may not match when is actually on screen if the buffer has not been updated yet. So instead of getting the frame size from the meta window, deduce it from the texture size. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1009 --- src/compositor/meta-window-actor-x11.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index cd2aa2edd..4f20336d8 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -892,7 +892,16 @@ build_and_scan_frame_mask (MetaWindowActorX11 *actor_x11, cairo_rectangle_int_t rect = { 0, 0, tex_width, tex_height }; cairo_rectangle_int_t frame_rect; - meta_window_get_frame_rect (window, &frame_rect); + /* If we update the shape regardless of the frozen state of the actor, + * as with Xwayland to avoid the black shadow effect, we ought to base + * the frame size on the buffer size rather than the reported window's + * frame size, as the buffer may not have been committed yet at this + * point. + */ + if (meta_window_x11_always_update_shape (window)) + meta_window_x11_buffer_rect_to_frame_rect (window, &rect, &frame_rect); + else + meta_window_get_frame_rect (window, &frame_rect); /* Make sure we don't paint the frame over the client window. */ frame_paint_region = cairo_region_create_rectangle (&rect);