diff options
author | Jan Grulich <jgrulich@redhat.com> | 2022-07-29 11:47:02 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-07-29 12:48:42 +0000 |
commit | f672c3fa48f4cfdfc484bc95b873fab99002a7c3 (patch) | |
tree | defb4d85ffb2670daf93a05760344926c5c76930 | |
parent | f2b3217c911633778e27188799c04c3a44912073 (diff) | |
download | qtwayland-f672c3fa48f4cfdfc484bc95b873fab99002a7c3.tar.gz |
Client: do not take decoration shadows into account when placing popups
The anchor rectangle is relative to the window geometry, which according
to xdg-shell specs shouldn't include invisible portions like shadows.
This causes all popups be wrongly positioned when drop-shadows are used.
Change-Id: Iac30ab264599f9898f3ddecd7f0c5f2aca824ad6
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 14c0293fe6e55317e8a645f6a156b5973190cd8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index e3dee445..c4b1942b 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -410,8 +410,8 @@ void QWaylandXdgSurface::setPopup(QWaylandWindow *parent) QPoint transientPos = m_window->geometry().topLeft(); // this is absolute transientPos -= parent->geometry().topLeft(); if (parent->decoration()) { - transientPos.setX(transientPos.x() + parent->decoration()->margins().left()); - transientPos.setY(transientPos.y() + parent->decoration()->margins().top()); + transientPos.setX(transientPos.x() + parent->decoration()->margins(QWaylandAbstractDecoration::ShadowsExcluded).left()); + transientPos.setY(transientPos.y() + parent->decoration()->margins(QWaylandAbstractDecoration::ShadowsExcluded).top()); } positioner->set_anchor_rect(transientPos.x(), transientPos.y(), 1, 1); positioner->set_anchor(QtWayland::xdg_positioner::anchor_top_left); |