35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From 1e0862acdc2e6ccf77bf3a1436b877d3af5e5fe7 Mon Sep 17 00:00:00 2001
|
|
From: Jan Grulich <jgrulich@redhat.com>
|
|
Date: Wed, 10 Feb 2021 17:11:27 +0100
|
|
Subject: [PATCH] Translate opaque area with frame margins
|
|
|
|
The opaque area doesn't take window decorations into account, which may
|
|
result into possible graphical artefacts.
|
|
|
|
Pick-to: 5.15
|
|
Change-Id: I1606e8256e7e204dad927931eb1221b576e227fd
|
|
---
|
|
|
|
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
|
|
index 04c2dbd..b29edfa 100644
|
|
--- a/src/client/qwaylandwindow.cpp
|
|
+++ b/src/client/qwaylandwindow.cpp
|
|
@@ -1242,12 +1242,14 @@
|
|
|
|
void QWaylandWindow::setOpaqueArea(const QRegion &opaqueArea)
|
|
{
|
|
- if (opaqueArea == mOpaqueArea || !mSurface)
|
|
+ const QRegion translatedOpaqueArea = opaqueArea.translated(frameMargins().left(), frameMargins().top());
|
|
+
|
|
+ if (translatedOpaqueArea == mOpaqueArea || !mSurface)
|
|
return;
|
|
|
|
- mOpaqueArea = opaqueArea;
|
|
+ mOpaqueArea = translatedOpaqueArea;
|
|
|
|
- struct ::wl_region *region = mDisplay->createRegion(opaqueArea);
|
|
+ struct ::wl_region *region = mDisplay->createRegion(translatedOpaqueArea);
|
|
mSurface->set_opaque_region(region);
|
|
wl_region_destroy(region);
|
|
}
|