summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2023-12-08 11:45:30 +0100
committerLiang Qi <liang.qi@qt.io>2023-12-08 12:59:07 +0100
commita960d6e107a809c9f5ff9c71cceaa316bf1d428f (patch)
tree6f2229d5b08d392af819366466688531f53ea4fa /src
parent07cdddac1c863fe3716b1a10463b314d740a2b15 (diff)
client: implement QWaylandCursor::size()
See also 78272c667f008f6afcf5f84e0add525b56c3a558 in qtbase. Fixes: QTBUG-118612 Pick-to: 6.6 6.5 Change-Id: I1cfd0c287b133c21a0ccdc5f283d9997f06fb2ed Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandcursor.cpp10
-rw-r--r--src/client/qwaylandcursor_p.h2
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: