diff options
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 8e4c8d67c..83a69483f 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -468,6 +468,33 @@ void QWaylandDisplay::requestWaylandSync() wl_callback_add_listener(mSyncCallback, &syncCallbackListener, this); } +QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const +{ + return mInputDevices.isEmpty() ? 0 : mInputDevices.first(); +} + +#if QT_CONFIG(cursor) +void QWaylandDisplay::setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image) +{ + /* 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); + } +} + +void QWaylandDisplay::setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot) +{ + /* 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); + } +} +#endif // QT_CONFIG(cursor) + } QT_END_NAMESPACE |