diff options
author | Liang Qi <liang.qi@qt.io> | 2022-01-25 15:36:33 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-25 16:29:28 +0000 |
commit | 28769bf20553c4daefc2396cd42521088fe830ee (patch) | |
tree | dbec2b5f63e7a7dbd6f5e300ff5693689b679fe2 | |
parent | 54d886d420bc0bc0a5d1c8fa28336665d8c77812 (diff) | |
download | qtwayland-28769bf20553c4daefc2396cd42521088fe830ee.tar.gz |
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)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 696a8b3d..7bcb65c8 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -44,7 +44,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 @@ -107,6 +106,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_wayland_text_input_v4_wip SOURCES qwaylandtextinputv4.cpp qwaylandtextinputv4_p.h diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index e1987742..4e0a90b7 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -75,7 +75,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> @@ -524,8 +526,10 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin mTouchExtension.reset(new QWaylandTouchExtension(this, id)); } else if (interface == QLatin1String(QWaylandQtKeyExtension::interface()->name)) { mQtKeyExtension.reset(new QWaylandQtKeyExtension(this, id)); +#if QT_CONFIG(tabletevent) } else if (interface == QLatin1String(QWaylandTabletManagerV2::interface()->name)) { mTabletManager.reset(new QWaylandTabletManagerV2(this, id, qMin(1, int(version)))); +#endif } else if (interface == QLatin1String(QWaylandPointerGestures::interface()->name)) { 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 cb345d7a..8d8000d2 100644 --- a/src/client/qwaylanddisplay_p.h +++ b/src/client/qwaylanddisplay_p.h @@ -101,7 +101,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; @@ -168,7 +170,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(); } @@ -277,7 +281,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 7d8726b4..4c32a534 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" @@ -435,8 +437,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 } // Can't be in header because dtors for scoped pointers aren't known there. diff --git a/src/client/qwaylandinputdevice_p.h b/src/client/qwaylandinputdevice_p.h index ef914392..a6b69c98 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(QWaylandTextInputInterface *textInput); QWaylandTextInputInterface *textInput() const; @@ -201,7 +205,9 @@ protected: QScopedPointer<QWaylandTextInputInterface> mTextInput; QScopedPointer<QWaylandTextInputMethod> mTextInputMethod; +#if QT_CONFIG(tabletevent) QScopedPointer<QWaylandTabletSeatV2> mTabletSeat; +#endif uint32_t mTime = 0; uint32_t mSerial = 0; |