diff --git a/CMakeLists.txt b/CMakeLists.txt index b0342cc44d..4f17fc477b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,7 +175,7 @@ set_package_properties(XKB PROPERTIES PURPOSE "Required for building KWin with Wayland support" ) -find_package(Libinput 1.5) +find_package(Libinput 1.9) set_package_properties(Libinput PROPERTIES TYPE OPTIONAL PURPOSE "Required for input handling on Wayland.") find_package(UDev) @@ -185,12 +185,8 @@ set_package_properties(UDev PROPERTIES URL "http://www.freedesktop.org/software PURPOSE "Required for input handling on Wayland." ) set(HAVE_INPUT FALSE) -set(HAVE_INPUT_1_9 FALSE) if (Libinput_FOUND AND UDEV_FOUND) set(HAVE_INPUT TRUE) - if(${Libinput_VERSION} VERSION_GREATER "1.9.0" OR ${Libinput_VERSION} VERSION_EQUAL "1.9.0") - set(HAVE_INPUT_1_9 TRUE) - endif() endif() set(HAVE_UDEV FALSE) if (UDEV_FOUND) diff --git a/autotests/libinput/CMakeLists.txt b/autotests/libinput/CMakeLists.txt index 7f2ac2de7c..bc0fff699e 100644 --- a/autotests/libinput/CMakeLists.txt +++ b/autotests/libinput/CMakeLists.txt @@ -68,18 +68,16 @@ ecm_mark_as_test(testLibinputGestureEvent) ######################################################## # Test Switch Event ######################################################## -if(HAVE_INPUT_1_9) - set( testLibinputSwitchEvent_SRCS - switch_event_test.cpp - mock_libinput.cpp - ../../libinput/device.cpp - ../../libinput/events.cpp - ) - add_executable(testLibinputSwitchEvent ${testLibinputSwitchEvent_SRCS}) - target_link_libraries(testLibinputSwitchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) - add_test(NAME kwin-testLibinputSwitchEvent COMMAND testLibinputSwitchEvent) - ecm_mark_as_test(testLibinputSwitchEvent) -endif() +set( testLibinputSwitchEvent_SRCS + switch_event_test.cpp + mock_libinput.cpp + ../../libinput/device.cpp + ../../libinput/events.cpp + ) +add_executable(testLibinputSwitchEvent ${testLibinputSwitchEvent_SRCS}) +target_link_libraries(testLibinputSwitchEvent Qt5::Test Qt5::DBus Qt5::Widgets KF5::ConfigCore) +add_test(NAME kwin-testLibinputSwitchEvent COMMAND testLibinputSwitchEvent) +ecm_mark_as_test(testLibinputSwitchEvent) ######################################################## # Test Context diff --git a/autotests/libinput/device_test.cpp b/autotests/libinput/device_test.cpp index 619d626ca6..a93cc43259 100644 --- a/autotests/libinput/device_test.cpp +++ b/autotests/libinput/device_test.cpp @@ -221,9 +221,7 @@ void TestLibinputDevice::testDeviceType_data() QTest::newRow("pointer/touch") << false << true << true << false << false; QTest::newRow("keyboard/pointer/touch") << true << true << true << false << false; QTest::newRow("tabletTool") << false << false << false << true << false; -#if HAVE_INPUT_1_9 QTest::newRow("switch") << false << false << false << false << true; -#endif } void TestLibinputDevice::testDeviceType() @@ -2181,7 +2179,6 @@ void TestLibinputDevice::testSwitch_data() void TestLibinputDevice::testSwitch() { -#if HAVE_INPUT_1_9 libinput_device device; device.switchDevice = true; QFETCH(bool, lid); @@ -2195,9 +2192,6 @@ void TestLibinputDevice::testSwitch() QCOMPARE(d.property("lidSwitch").toBool(), lid); QCOMPARE(d.isTabletModeSwitch(), tablet); QCOMPARE(d.property("tabletModeSwitch").toBool(), tablet); -#else - QSKIP("Requires libinput 1.9"); -#endif } QTEST_GUILESS_MAIN(TestLibinputDevice) diff --git a/autotests/libinput/mock_libinput.cpp b/autotests/libinput/mock_libinput.cpp index 74aced6cea..a412078dd3 100644 --- a/autotests/libinput/mock_libinput.cpp +++ b/autotests/libinput/mock_libinput.cpp @@ -41,10 +41,8 @@ int libinput_device_has_capability(struct libinput_device *device, enum libinput return device->gestureSupported; case LIBINPUT_DEVICE_CAP_TABLET_TOOL: return device->tabletTool; -#if HAVE_INPUT_1_9 case LIBINPUT_DEVICE_CAP_SWITCH: return device->switchDevice; -#endif default: return 0; } @@ -815,8 +813,6 @@ uint32_t libinput_device_config_scroll_get_default_button(struct libinput_device return device->defaultScrollButton; } -#if HAVE_INPUT_1_9 - int libinput_device_switch_has_switch(struct libinput_device *device, enum libinput_switch sw) { switch (sw) { @@ -860,5 +856,3 @@ uint64_t libinput_event_switch_get_time_usec(struct libinput_event_switch *event { return event->timeMicroseconds; } - -#endif diff --git a/config-kwin.h.cmake b/config-kwin.h.cmake index ebae8aef0e..1566d649f6 100644 --- a/config-kwin.h.cmake +++ b/config-kwin.h.cmake @@ -10,7 +10,6 @@ #define KWIN_RULES_DIALOG_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/kwin_rules_dialog" #define KWIN_XCLIPBOARD_SYNC_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/org_kde_kwin_xclipboard_syncer" #cmakedefine01 HAVE_INPUT -#cmakedefine01 HAVE_INPUT_1_9 #cmakedefine01 HAVE_X11_XCB #cmakedefine01 HAVE_X11_XINPUT #cmakedefine01 HAVE_DRM diff --git a/libinput/connection.cpp b/libinput/connection.cpp index 9e74d6f52d..38f00b23f2 100644 --- a/libinput/connection.cpp +++ b/libinput/connection.cpp @@ -460,7 +460,6 @@ void Connection::processEvents() } break; } -#if HAVE_INPUT_1_9 case LIBINPUT_EVENT_SWITCH_TOGGLE: { SwitchEvent *se = static_cast(event.data()); switch (se->state()) { @@ -475,7 +474,6 @@ void Connection::processEvents() } break; } -#endif default: // nothing break; diff --git a/libinput/device.cpp b/libinput/device.cpp index c92f3d5879..330499d399 100644 --- a/libinput/device.cpp +++ b/libinput/device.cpp @@ -163,11 +163,9 @@ Device::Device(libinput_device *device, QObject *parent) , m_tabletPad(false) #endif , m_supportsGesture(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_GESTURE)) -#if HAVE_INPUT_1_9 , m_switch(libinput_device_has_capability(m_device, LIBINPUT_DEVICE_CAP_SWITCH)) , m_lidSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_LID) : false) , m_tabletSwitch(m_switch ? libinput_device_switch_has_switch(m_device, LIBINPUT_SWITCH_TABLET_MODE) : false) -#endif , m_name(QString::fromLocal8Bit(libinput_device_get_name(m_device))) , m_sysName(QString::fromLocal8Bit(libinput_device_get_sysname(m_device))) , m_outputName(QString::fromLocal8Bit(libinput_device_get_output_name(m_device))) diff --git a/libinput/events.cpp b/libinput/events.cpp index cf52fc2b06..17efc64253 100644 --- a/libinput/events.cpp +++ b/libinput/events.cpp @@ -57,10 +57,8 @@ Event *Event::create(libinput_event *event) case LIBINPUT_EVENT_GESTURE_PINCH_UPDATE: case LIBINPUT_EVENT_GESTURE_PINCH_END: return new PinchGestureEvent(event, t); -#if HAVE_INPUT_1_9 case LIBINPUT_EVENT_SWITCH_TOGGLE: return new SwitchEvent(event, t); -#endif default: return new Event(event, t); } @@ -290,11 +288,7 @@ SwipeGestureEvent::~SwipeGestureEvent() = default; SwitchEvent::SwitchEvent(libinput_event *event, libinput_event_type type) : Event(event, type) -#if HAVE_INPUT_1_9 , m_switchEvent(libinput_event_get_switch_event(event)) -#else - , m_switchEvent(nullptr) -#endif { } @@ -302,7 +296,6 @@ SwitchEvent::~SwitchEvent() = default; SwitchEvent::State SwitchEvent::state() const { -#if HAVE_INPUT_1_9 switch (libinput_event_switch_get_switch_state(m_switchEvent)) { case LIBINPUT_SWITCH_STATE_OFF: @@ -312,24 +305,17 @@ SwitchEvent::State SwitchEvent::state() const default: Q_UNREACHABLE(); } -#endif return State::Off; } quint32 SwitchEvent::time() const { -#if HAVE_INPUT_1_9 return libinput_event_switch_get_time(m_switchEvent); -#endif - return 0; } quint64 SwitchEvent::timeMicroseconds() const { -#if HAVE_INPUT_1_9 return libinput_event_switch_get_time_usec(m_switchEvent); -#endif - return 0; } } diff --git a/libinput/events.h b/libinput/events.h index f9f6bb429c..28d68a6b55 100644 --- a/libinput/events.h +++ b/libinput/events.h @@ -24,11 +24,6 @@ along with this program. If not, see . #include -#include -#if !(HAVE_INPUT_1_9) -struct libinput_event_switch; -#endif - namespace KWin { namespace LibInput