From 35a3184ea3cbfcb0a66a49b466f9f6793c466d10 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 20 Jun 2022 11:57:19 +0300 Subject: [PATCH] Fix computation of effective opaque region of SurfaceItemX11 The value of _NET_WM_OPAQUE_REGION can be out of sync with the geometry of the window. The NETWM spec suggests to compute the effective opaque region by taking intersection of _NET_WM_OPAQUE_REGION and the bounding region set by the shape extension. SurfaceItemX11::opaque() got broken after refactoring opaque region handling in wayland surfaces so SurfaceInterface::opaque() always returns a sane value, the computation of effective opaque region is done in SurfaceInterface at commit time. BUG: 455617 --- src/surfaceitem_x11.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/surfaceitem_x11.cpp b/src/surfaceitem_x11.cpp index 075c9eea2a..6c5e106856 100644 --- a/src/surfaceitem_x11.cpp +++ b/src/surfaceitem_x11.cpp @@ -139,7 +139,11 @@ QRegion SurfaceItemX11::shape() const QRegion SurfaceItemX11::opaque() const { - return window()->opaqueRegion(); + if (!window()->hasAlpha()) { + return shape(); + } else { + return window()->opaqueRegion() & shape(); + } } SurfacePixmap *SurfaceItemX11::createPixmap()