summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-03-06 13:19:15 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2017-03-08 08:12:41 +0000
commit60a3ae6559c3d53ef936c5f90182d53b1a7fea24 (patch)
tree34543fc5ba694bbbc2476cd9fd131f8c8db04cbe
parent3b05ffe304d89790e2d46c4e3822c5bf46f1f178 (diff)
Code cleanup (fixing -no-feature-cursor)
Move QWaylandDisplay member functions into the correct .cpp file. Change-Id: Ie3915d2bd0d191900ad2fd306564bb732e40221a Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
-rw-r--r--src/client/qwaylandcursor.cpp25
-rw-r--r--src/client/qwaylanddisplay.cpp27
-rw-r--r--src/client/qwaylanddisplay_p.h4
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<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);
- }
-}
-
-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<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
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<QWaylandBuffer> &buffer, const QPoint &hotSpot);
-
+#endif
struct wl_display *wl_display() const { return mDisplay; }
struct ::wl_registry *wl_registry() { return object(); }