summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Grulich <jgrulich@redhat.com>2021-02-23 08:42:16 +0100
committerJan Grulich <jgrulich@redhat.com>2021-03-03 13:39:44 +0100
commita32cc186e645e8dac6dd7089f374f6d20e924f39 (patch)
tree69f091514ce152b2aa7bd0393c65ab0f5f588a76 /src
parentc2e9cb8e857b14de70169ff1980a72747e40ea00 (diff)
Client: get correct window content geometry
Window content geometry should not include invisible portions of the decorations, like shadows. This is stated in xdg-shell specificification and in the description for this method. Change-Id: I444fe9e28f0f175d2051be5c704efa7658bd45fb Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandwindow.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 9b9d30a6f..0f1752d6d 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -369,7 +369,7 @@ void QWaylandWindow::setGeometry(const QRect &rect)
sendExposeEvent(exposeGeometry);
if (mShellSurface && isExposed())
- mShellSurface->setWindowGeometry(windowContentGeometry());
+ mShellSurface->setWindowGeometry(QRect(QPoint(), surfaceSize()));
if (isOpaque() && mMask.isEmpty())
setOpaqueArea(rect);
@@ -697,7 +697,12 @@ QSize QWaylandWindow::surfaceSize() const
*/
QRect QWaylandWindow::windowContentGeometry() const
{
- return QRect(QPoint(), surfaceSize());
+ QMargins shadowMargins;
+
+ if (mWindowDecoration)
+ shadowMargins = mWindowDecoration->margins(QWaylandAbstractDecoration::ShadowsOnly);
+
+ return QRect(QPoint(shadowMargins.left(), shadowMargins.right()), surfaceSize().shrunkBy(shadowMargins));
}
/*!