diff options
author | Aleix Pol <aleixpol@kde.org> | 2018-04-26 17:38:10 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2018-05-15 09:43:58 +0000 |
commit | 687cf7c7d1d2f809de56787e16c73a4eb64766fc (patch) | |
tree | 07ef5647ae435d06b1542e577830b481f189a7ba /src/client/qwaylanddisplay.cpp | |
parent | 83084f717ccf6e7c1930c7b61de3bfec2cc48bc3 (diff) |
Adapt the cursor size per screen
Adapt the cursor size to the screen's devicePixelRatio, so we are not
forced to have a tiny cursor on a high dpi screen or a huge cursor on
external low-dpi displays.
Change-Id: I3712dc64e5c5e2e05d0dc5943bd49ba5c1335cd3
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 515888d4a..1c2b47da5 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -474,23 +474,23 @@ QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const } #if QT_CONFIG(cursor) -void QWaylandDisplay::setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image) +void QWaylandDisplay::setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image, qreal dpr) { /* Qt doesn't tell us which input device we should set the cursor * for, so set it for all devices. */ for (int i = 0; i < mInputDevices.count(); i++) { QWaylandInputDevice *inputDevice = mInputDevices.at(i); - inputDevice->setCursor(buffer, image); + inputDevice->setCursor(buffer, image, dpr); } } -void QWaylandDisplay::setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot) +void QWaylandDisplay::setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot, qreal dpr) { /* Qt doesn't tell us which input device we should set the cursor * for, so set it for all devices. */ for (int i = 0; i < mInputDevices.count(); i++) { QWaylandInputDevice *inputDevice = mInputDevices.at(i); - inputDevice->setCursor(buffer, hotSpot); + inputDevice->setCursor(buffer, hotSpot, dpr); } } #endif // QT_CONFIG(cursor) |