summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2024-04-12 13:29:56 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-04-22 14:49:02 +0000
commit98d1534dfa28bbedff64fb22f11a5b24385d9cdc (patch)
tree59618b7aa2c5a15847d5444eb0656aec0f2d2cee
parent1353b9cf3e437b69bf09894366edb38daf621b24 (diff)
client: implement QWaylandScreen::topLevelAt()
For security reason, Wayland doesn't provide global position for top level windows in most cases. Task-number: QTBUG-113404 Pick-to: 6.5 6.2 5.15 Change-Id: I2cd11b641fba6582cf96cfbea16f5e598a473db5 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit f7a2d52336123d30253cc3548d4a971167b3d965) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandscreen.cpp10
-rw-r--r--src/client/qwaylandscreen_p.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
index ea109c8f5..4c9e46e0d 100644
--- a/src/client/qwaylandscreen.cpp
+++ b/src/client/qwaylandscreen.cpp
@@ -163,6 +163,16 @@ QList<QPlatformScreen *> QWaylandScreen::virtualSiblings() const
return list;
}
+QWindow *QWaylandScreen::topLevelAt(const QPoint & pos) const
+{
+ if (QWaylandWindow::fixedToplevelPositions) {
+ Q_UNUSED(pos);
+ return nullptr;
+ }
+
+ return QPlatformScreen::topLevelAt(pos);
+}
+
Qt::ScreenOrientation QWaylandScreen::orientation() const
{
return m_orientation;
diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h
index a56e56f19..8cc9d05d5 100644
--- a/src/client/qwaylandscreen_p.h
+++ b/src/client/qwaylandscreen_p.h
@@ -62,6 +62,8 @@ public:
QDpi logicalDpi() const override;
QList<QPlatformScreen *> virtualSiblings() const override;
+ QWindow *topLevelAt(const QPoint &point) const override;
+
Qt::ScreenOrientation orientation() const override;
int scale() const;
qreal devicePixelRatio() const override;