summaryrefslogtreecommitdiffstats
path: root/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-09-21 10:07:19 +0200
committerJohan Helsing <johan.helsing@qt.io>2018-09-24 06:48:51 +0000
commitaede513e7c592dd189754898a38d1aac432d55ed (patch)
treeb53fa8b12b597496bd20584eea8268d5d56ffea2 /src/compositor/extensions/qwaylandxdgshellv6integration.cpp
parentd32e59c1274d5a6806d6e82fd230ce1419d64440 (diff)
Compositor: Fix popup positions on screens when DPR != 1
[ChangeLog][Compositor] Fixed a bug where xdg-shell popups were misplaced when devicePixelRatio was not 1. The fix is to use the more robust QWaylandQuickItem::mapFromSurface instead. Also made wl-shell use mapFromSurface, although it already accounted for devicePixelRatio. Fixes: QTBUG-70662 Change-Id: I8be3ea76d6bcfd6d6974d532d160c20e44499382 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/compositor/extensions/qwaylandxdgshellv6integration.cpp')
-rw-r--r--src/compositor/extensions/qwaylandxdgshellv6integration.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
index 61a9092a3..0dd8df6f8 100644
--- a/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
+++ b/src/compositor/extensions/qwaylandxdgshellv6integration.cpp
@@ -285,11 +285,11 @@ void XdgPopupV6Integration::handleGeometryChanged()
{
if (m_item->view()->output()) {
const QPoint windowOffset = m_popup->parentXdgSurface()->windowGeometry().topLeft();
- const QPoint position = m_popup->unconstrainedPosition() + windowOffset;
+ const QPoint surfacePosition = m_popup->unconstrainedPosition() + windowOffset;
+ const QPoint itemPosition = m_item->mapFromSurface(surfacePosition).toPoint();
//TODO: positioner size or other size...?
- const float scaleFactor = m_item->view()->output()->scaleFactor();
//TODO check positioner constraints etc... sliding, flipping
- m_item->moveItem()->setPosition(position * scaleFactor);
+ m_item->moveItem()->setPosition(itemPosition);
} else {
qWarning() << "XdgPopupV6Integration popup item without output" << m_item;
}