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.7 6.5 6.2 5.15
Change-Id: I2cd11b641fba6582cf96cfbea16f5e598a473db5
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Liang Qi 2024-04-12 13:29:56 +02:00
parent f53c249d06
commit 682f7c4b78
2 changed files with 12 additions and 0 deletions

View File

@ -170,6 +170,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;

View File

@ -63,6 +63,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;