From 60a3ae6559c3d53ef936c5f90182d53b1a7fea24 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Mon, 6 Mar 2017 13:19:15 +0100 Subject: Code cleanup (fixing -no-feature-cursor) Move QWaylandDisplay member functions into the correct .cpp file. Change-Id: Ie3915d2bd0d191900ad2fd306564bb732e40221a Reviewed-by: Johan Helsing Reviewed-by: Pier Luigi Fiorini --- src/client/qwaylandcursor.cpp | 25 ------------------------- src/client/qwaylanddisplay.cpp | 27 +++++++++++++++++++++++++++ src/client/qwaylanddisplay_p.h | 4 ++-- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/client/qwaylandcursor.cpp b/src/client/qwaylandcursor.cpp index e3e3469be..7caa247e5 100644 --- a/src/client/qwaylandcursor.cpp +++ b/src/client/qwaylandcursor.cpp @@ -143,31 +143,6 @@ void QWaylandCursor::changeCursor(QCursor *cursor, QWindow *window) mDisplay->setCursor(buffer, image); } -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 &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); - } -} - -QWaylandInputDevice *QWaylandDisplay::defaultInputDevice() const -{ - return mInputDevices.isEmpty() ? 0 : mInputDevices.first(); -} - void QWaylandCursor::pointerEvent(const QMouseEvent &event) { mLastPos = event.globalPos(); 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 &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 diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index e96a89176..9268d9f1e 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -123,10 +123,10 @@ public: QWaylandClientBufferIntegration *clientBufferIntegration() const; QWaylandWindowManagerIntegration *windowManagerIntegration() const; - +#if QT_CONFIG(cursor) void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image); void setCursor(const QSharedPointer &buffer, const QPoint &hotSpot); - +#endif struct wl_display *wl_display() const { return mDisplay; } struct ::wl_registry *wl_registry() { return object(); } -- cgit v1.2.3