diff options
author | Liang Qi <liang.qi@qt.io> | 2023-12-08 11:45:30 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-12-08 13:23:03 +0000 |
commit | 499abc747185f9faae11f2a6bb198066cfc7e4d9 (patch) | |
tree | d69e8f13c364ea66391798d03d9393dca7820312 | |
parent | b2eac76c31c6b870f9487f8a8c76c17891669083 (diff) |
client: implement QWaylandCursor::size()
See also 78272c667f008f6afcf5f84e0add525b56c3a558 in qtbase.
Fixes: QTBUG-118612
Pick-to: 6.5
Change-Id: I1cfd0c287b133c21a0ccdc5f283d9997f06fb2ed
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit a960d6e107a809c9f5ff9c71cceaa316bf1d428f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/client/qwaylandcursor.cpp | 10 | ||||
-rw-r--r-- | src/client/qwaylandcursor_p.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index 83b240ce5..09e2e1010 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -8,6 +8,9 @@ #include "qwaylandinputdevice_p.h" #include "qwaylandshmbackingstore_p.h" +#include <QtGui/private/qguiapplication_p.h> +#include <qpa/qplatformtheme.h> + #include <QtGui/QImageReader> #include <QDebug> @@ -336,6 +339,13 @@ void QWaylandCursor::setPos(const QPoint &pos) qCWarning(lcQpaWayland) << "Setting cursor position is not possible on wayland"; } +QSize QWaylandCursor::size() const +{ + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + return theme->themeHint(QPlatformTheme::MouseCursorSize).toSize(); + return QSize(24, 24); +} + } // namespace QtWaylandClient QT_END_NAMESPACE diff --git a/src/client/qwaylandcursor_p.h b/src/client/qwaylandcursor_p.h index 8f4a5b7e5..1f6d5109e 100644 --- a/src/client/qwaylandcursor_p.h +++ b/src/client/qwaylandcursor_p.h @@ -106,6 +106,8 @@ public: QPoint pos() const override; void setPos(const QPoint &pos) override; + QSize size() const override; + static QSharedPointer<QWaylandBuffer> cursorBitmapBuffer(QWaylandDisplay *display, const QCursor *cursor); protected: |