diff options
author | Liang Qi <liang.qi@qt.io> | 2022-01-25 15:36:33 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2022-02-02 10:43:53 +0100 |
commit | aa7a128f590f524f36912a7c2472b5f39849a45d (patch) | |
tree | 1da1307576c6909db3cae1b02d4ba48d53a72193 | |
parent | c8eecedcece91a77b10482af51f84e3018bdff27 (diff) |
Fix build with -no-feature-tabletevent
Fixes: QTBUG-99965
Change-Id: Ib7fcf92973b4e559713ae27ad0c7f843f9122daf
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ba82ba66eb8dc3580e67683783a410a254984def)
-rw-r--r-- | src/client/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylanddisplay_p.h | 6 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice.cpp | 4 | ||||
-rw-r--r-- | src/client/qwaylandinputdevice_p.h | 6 |
5 files changed, 25 insertions, 1 deletions
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 1e1b83893..102241a68 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -42,7 +42,6 @@ qt_internal_add_module(WaylandClient qwaylandshmwindow.cpp qwaylandshmwindow_p.h qwaylandsubsurface.cpp qwaylandsubsurface_p.h qwaylandsurface.cpp qwaylandsurface_p.h - qwaylandtabletv2.cpp qwaylandtabletv2_p.h qwaylandtouch.cpp qwaylandtouch_p.h qwaylandwindow.cpp qwaylandwindow_p.h qwaylandwindowmanagerintegration.cpp qwaylandwindowmanagerintegration_p.h @@ -101,6 +100,11 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient # ) # special case end +qt_internal_extend_target(WaylandClient CONDITION QT_FEATURE_tabletevent + SOURCES + qwaylandtabletv2.cpp qwaylandtabletv2_p.h +) + qt_internal_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard SOURCES qwaylandclipboard.cpp qwaylandclipboard_p.h diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 8806773d5..dabb80877 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -71,7 +71,9 @@ #include "qwaylandpointergestures_p.h" #include "qwaylandsubsurface_p.h" #include "qwaylandtouch_p.h" +#if QT_CONFIG(tabletevent) #include "qwaylandtabletv2_p.h" +#endif #include "qwaylandqtkey_p.h" #include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h> @@ -354,8 +356,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin mTouchExtension.reset(new QWaylandTouchExtension(this, id)); } else if (interface == QStringLiteral("zqt_key_v1")) { mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id)); +#if QT_CONFIG(tabletevent) } else if (interface == QStringLiteral("zwp_tablet_manager_v2")) { mTabletManager.reset(new QWaylandTabletManagerV2(this, id, qMin(1, int(version)))); +#endif } else if (interface == QStringLiteral("zwp_pointer_gestures_v1")) { mPointerGestures.reset(new QWaylandPointerGestures(this, id, 1)); #if QT_CONFIG(wayland_client_primary_selection) diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h index ae80cd33c..5c265446d 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -100,7 +100,9 @@ class QWaylandDataDeviceManager; #if QT_CONFIG(wayland_client_primary_selection) class QWaylandPrimarySelectionDeviceManagerV1; #endif +#if QT_CONFIG(tabletevent) class QWaylandTabletManagerV2; +#endif class QWaylandPointerGestures; class QWaylandTouchExtension; class QWaylandQtKeyExtension; @@ -172,7 +174,9 @@ public: QWaylandPrimarySelectionDeviceManagerV1 *primarySelectionManager() const { return mPrimarySelectionManager.data(); } #endif QtWayland::qt_surface_extension *windowExtension() const { return mWindowExtension.data(); } +#if QT_CONFIG(tabletevent) QWaylandTabletManagerV2 *tabletManager() const { return mTabletManager.data(); } +#endif QWaylandPointerGestures *pointerGestures() const { return mPointerGestures.data(); } QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); } QtWayland::qt_text_input_method_manager_v1 *textInputMethodManager() const { return mTextInputMethodManager.data(); } @@ -276,7 +280,9 @@ private: QScopedPointer<QWaylandTouchExtension> mTouchExtension; QScopedPointer<QWaylandQtKeyExtension> mQtKeyExtension; QScopedPointer<QWaylandWindowManagerIntegration> mWindowManagerIntegration; +#if QT_CONFIG(tabletevent) QScopedPointer<QWaylandTabletManagerV2> mTabletManager; +#endif QScopedPointer<QWaylandPointerGestures> mPointerGestures; #if QT_CONFIG(wayland_client_primary_selection) QScopedPointer<QWaylandPrimarySelectionDeviceManagerV1> mPrimarySelectionManager; diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp index 09c60081c..63466b69a 100644 --- a/src/client/qwaylandinputdevice.cpp +++ b/src/client/qwaylandinputdevice.cpp @@ -50,7 +50,9 @@ #if QT_CONFIG(wayland_client_primary_selection) #include "qwaylandprimaryselectionv1_p.h" #endif +#if QT_CONFIG(tabletevent) #include "qwaylandtabletv2_p.h" +#endif #include "qwaylandpointergestures_p.h" #include "qwaylandtouch_p.h" #include "qwaylandscreen_p.h" @@ -425,8 +427,10 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version, if (mQDisplay->textInputMethodManager()) mTextInputMethod.reset(new QWaylandTextInputMethod(mQDisplay, mQDisplay->textInputMethodManager()->get_text_input_method(wl_seat()))); +#if QT_CONFIG(tabletevent) if (auto *tm = mQDisplay->tabletManager()) mTabletSeat.reset(new QWaylandTabletSeatV2(tm, this)); +#endif } QWaylandInputDevice::~QWaylandInputDevice() diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index 3e6484314..b1fde70f3 100644 --- a/src/client/qwaylandinputdevice_p.h +++ b/src/client/qwaylandinputdevice_p.h @@ -90,7 +90,9 @@ class QWaylandDisplay; #if QT_CONFIG(wayland_client_primary_selection) class QWaylandPrimarySelectionDeviceV1; #endif +#if QT_CONFIG(tabletevent) class QWaylandTabletSeatV2; +#endif class QWaylandPointerGestures; class QWaylandPointerGestureSwipe; class QWaylandPointerGesturePinch; @@ -135,8 +137,10 @@ public: QWaylandPrimarySelectionDeviceV1 *primarySelectionDevice() const; #endif +#if QT_CONFIG(tabletevent) void setTabletSeat(QWaylandTabletSeatV2 *tabletSeat); QWaylandTabletSeatV2* tabletSeat() const; +#endif void setTextInput(QWaylandTextInput *textInput); QWaylandTextInput *textInput() const; @@ -201,7 +205,9 @@ protected: QScopedPointer<QWaylandTextInput> mTextInput; QScopedPointer<QWaylandTextInputMethod> mTextInputMethod; +#if QT_CONFIG(tabletevent) QScopedPointer<QWaylandTabletSeatV2> mTabletSeat; +#endif uint32_t mTime = 0; uint32_t mSerial = 0; |