summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2022-01-25 19:53:07 +0100
committerLiang Qi <liang.qi@qt.io>2022-02-02 10:43:51 +0100
commite3a8c19de733617ea40b6520c3b65e0faf52f578 (patch)
treec1ddad505f6f6c9b939a6f8a6d638871feb29ca9
parent7ce31f7f65f8d79c1f8763eb75b3ea238b727654 (diff)
downloadqtwayland-e3a8c19de733617ea40b6520c3b65e0faf52f578.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)
-rw-r--r--src/client/client.pro7
-rw-r--r--src/client/qwaylanddisplay.cpp4
-rw-r--r--src/client/qwaylanddisplay_p.h6
-rw-r--r--src/client/qwaylandinputdevice.cpp4
-rw-r--r--src/client/qwaylandinputdevice_p.h6
5 files changed, 25 insertions, 2 deletions
diff --git a/src/client/client.pro b/src/client/client.pro
index 793a4418..e7b1dad5 100644
--- a/src/client/client.pro
+++ b/src/client/client.pro
@@ -53,7 +53,6 @@ SOURCES += qwaylandintegration.cpp \
qwaylandextendedsurface.cpp \
qwaylandsubsurface.cpp \
qwaylandsurface.cpp \
- qwaylandtabletv2.cpp \
qwaylandtouch.cpp \
qwaylandqtkey.cpp \
../shared/qwaylandmimehelper.cpp \
@@ -79,7 +78,6 @@ HEADERS += qwaylandintegration_p.h \
qwaylandextendedsurface_p.h \
qwaylandsubsurface_p.h \
qwaylandsurface_p.h \
- qwaylandtabletv2_p.h \
qwaylandtouch_p.h \
qwaylandqtkey_p.h \
qwaylandabstractdecoration_p.h \
@@ -99,6 +97,11 @@ qtConfig(clipboard) {
SOURCES += qwaylandclipboard.cpp
}
+qtConfig(tabletevent) {
+ HEADERS += qwaylandtabletv2_p.h
+ SOURCES += qwaylandtabletv2.cpp
+}
+
include(hardwareintegration/hardwareintegration.pri)
include(shellintegration/shellintegration.pri)
include(inputdeviceintegration/inputdeviceintegration.pri)
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
index 39e84ad2..666a8557 100644
--- a/src/client/qwaylanddisplay.cpp
+++ b/src/client/qwaylanddisplay.cpp
@@ -69,7 +69,9 @@
#include "qwaylandextendedsurface_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>
@@ -364,8 +366,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
#if QT_CONFIG(wayland_client_primary_selection)
} else if (interface == QStringLiteral("zwp_primary_selection_device_manager_v1")) {
mPrimarySelectionManager.reset(new QWaylandPrimarySelectionDeviceManagerV1(this, id, 1));
diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
index 6b5f5641..d8f3dd48 100644
--- a/src/client/qwaylanddisplay_p.h
+++ b/src/client/qwaylanddisplay_p.h
@@ -99,7 +99,9 @@ class QWaylandDataDeviceManager;
#if QT_CONFIG(wayland_client_primary_selection)
class QWaylandPrimarySelectionDeviceManagerV1;
#endif
+#if QT_CONFIG(tabletevent)
class QWaylandTabletManagerV2;
+#endif
class QWaylandTouchExtension;
class QWaylandQtKeyExtension;
class QWaylandWindow;
@@ -169,7 +171,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
QWaylandTouchExtension *touchExtension() const { return mTouchExtension.data(); }
QtWayland::zwp_text_input_manager_v2 *textInputManager() const { return mTextInputManager.data(); }
QWaylandHardwareIntegration *hardwareIntegration() const { return mHardwareIntegration.data(); }
@@ -257,7 +261,9 @@ private:
QScopedPointer<QWaylandTouchExtension> mTouchExtension;
QScopedPointer<QWaylandQtKeyExtension> mQtKeyExtension;
QScopedPointer<QWaylandWindowManagerIntegration> mWindowManagerIntegration;
+#if QT_CONFIG(tabletevent)
QScopedPointer<QWaylandTabletManagerV2> mTabletManager;
+#endif
#if QT_CONFIG(wayland_client_primary_selection)
QScopedPointer<QWaylandPrimarySelectionDeviceManagerV1> mPrimarySelectionManager;
#endif
diff --git a/src/client/qwaylandinputdevice.cpp b/src/client/qwaylandinputdevice.cpp
index 51c64957..871e0d3f 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 "qwaylandtouch_p.h"
#include "qwaylandscreen_p.h"
#include "qwaylandcursor_p.h"
@@ -419,8 +421,10 @@ QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, int version,
if (mQDisplay->textInputManager())
mTextInput.reset(new QWaylandTextInput(mQDisplay, mQDisplay->textInputManager()->get_text_input(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 aebff248..042eb285 100644
--- a/src/client/qwaylandinputdevice_p.h
+++ b/src/client/qwaylandinputdevice_p.h
@@ -89,7 +89,9 @@ class QWaylandDisplay;
#if QT_CONFIG(wayland_client_primary_selection)
class QWaylandPrimarySelectionDeviceV1;
#endif
+#if QT_CONFIG(tabletevent)
class QWaylandTabletSeatV2;
+#endif
class QWaylandTextInput;
#if QT_CONFIG(cursor)
class QWaylandCursorTheme;
@@ -128,8 +130,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;
@@ -187,7 +191,9 @@ private:
Touch *mTouch = nullptr;
QScopedPointer<QWaylandTextInput> mTextInput;
+#if QT_CONFIG(tabletevent)
QScopedPointer<QWaylandTabletSeatV2> mTabletSeat;
+#endif
uint32_t mTime = 0;
uint32_t mSerial = 0;