wayland: Fix glitchy steam during interactive resize
Xwayland windows have two geometry types that are used during rendering - wl_surface's geometry and x11 window's geometry. Unfortunately, it's not possible just ignore the x11 window geometry because the window may have a custom shape region. Pixels outside the shape region can have arbitrary values; it's not guaranteed that the area outside the shape region will be transparent. In some cases, the x11 window geometry can be larger than the wl_surface rect. That breaks repaint logic as the SurfaceItemXwayland can draw outside the bounding rect. Specifically, this issue can be seen while resizing Steam interactively. Another example is where a video game enters fullscreen mode. I occasionally see that Red Dead Redemption II window leaves a ghost after itself when it switches to fullscreen mode. It's not a perfect solution, but on the other hand, it doesn't look like there's a better way to handle this due to the fact that there are two conflicting geometry sources.
This commit is contained in:
parent
f14350e1bb
commit
b344afd8cd
1 changed files with 1 additions and 1 deletions
|
@ -205,7 +205,7 @@ SurfaceItemXwayland::SurfaceItemXwayland(Scene::Window *window, Item *parent)
|
|||
QRegion SurfaceItemXwayland::shape() const
|
||||
{
|
||||
const Toplevel *toplevel = window()->window();
|
||||
const QRect clipRect = toplevel->clientGeometry().translated(-toplevel->bufferGeometry().topLeft());
|
||||
const QRect clipRect = rect() & toplevel->clientGeometry().translated(-toplevel->bufferGeometry().topLeft());
|
||||
const QRegion shape = toplevel->shapeRegion();
|
||||
|
||||
return shape & clipRect;
|
||||
|
|
Loading…
Reference in a new issue