From 343338049cb4240d189fb9ad661ba37de9045c4d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 30 Jan 2021 16:39:37 +0200 Subject: [PATCH] Drop libinputtest There's little practical value behind it. If there are input related issues, we will ask for WAYLAND_DEBUG output. --- tests/CMakeLists.txt | 15 ------ tests/libinputtest.cpp | 103 ----------------------------------------- 2 files changed, 118 deletions(-) delete mode 100644 tests/libinputtest.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 9bfc09d493..155de52818 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,21 +10,6 @@ add_executable(screenedgeshowtest ${screenedgeshowtest_SRCS}) target_link_libraries(screenedgeshowtest Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem KF5::WaylandClient ${XCB_XCB_LIBRARY}) target_include_directories(screenedgeshowtest PRIVATE ${CMAKE_SOURCE_DIR}/src) -set(libinputtest_SRCS - ${KWin_SOURCE_DIR}/src/libinput/connection.cpp - ${KWin_SOURCE_DIR}/src/libinput/context.cpp - ${KWin_SOURCE_DIR}/src/libinput/device.cpp - ${KWin_SOURCE_DIR}/src/libinput/events.cpp - ${KWin_SOURCE_DIR}/src/libinput/libinput_logging.cpp - ${KWin_SOURCE_DIR}/src/logind.cpp - ${KWin_SOURCE_DIR}/src/udev.cpp - libinputtest.cpp -) -add_executable(libinputtest ${libinputtest_SRCS}) -add_definitions(-DKWIN_BUILD_TESTING) -target_link_libraries(libinputtest Qt::Core Qt::DBus Libinput::Libinput UDev::UDev KF5::ConfigCore KF5::GlobalAccel KF5::WindowSystem) -target_include_directories(libinputtest PRIVATE ${CMAKE_SOURCE_DIR}/src) - add_executable(x11shadowreader x11shadowreader.cpp) target_link_libraries(x11shadowreader XCB::XCB Qt::Widgets Qt::X11Extras KF5::ConfigCore KF5::WindowSystem) target_include_directories(x11shadowreader PRIVATE ${CMAKE_SOURCE_DIR}/src) diff --git a/tests/libinputtest.cpp b/tests/libinputtest.cpp deleted file mode 100644 index 70a8a1fa67..0000000000 --- a/tests/libinputtest.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - SPDX-FileCopyrightText: 2014 Martin Gräßlin - - SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL -*/ -#include "input.h" -#include "libinput/connection.h" -#include "libinput/device.h" -#include "logind.h" - -#include -#include - -#include - -#include - -Q_LOGGING_CATEGORY(KWIN_CORE, "kwin_core") - -int main(int argc, char **argv) -{ - using namespace KWin::LibInput; - - QCoreApplication app(argc, argv); - - KWin::LogindIntegration *logind = KWin::LogindIntegration::create(&app); - QObject::connect(logind, &KWin::LogindIntegration::connectedChanged, - [logind]() { - if (logind->isConnected()) { - logind->takeControl(); - } - } - ); - QObject::connect(logind, &KWin::LogindIntegration::hasSessionControlChanged, - [&app](bool valid) { - if (!valid) { - return; - } - Connection *conn = Connection::create(&app); - if (!conn) { - std::cerr << "Failed to create LibInput integration" << std::endl; - ::exit(1); - } - conn->setScreenSize(QSize(100, 100)); - conn->setup(); - - QObject::connect(conn, &Connection::keyChanged, - [](uint32_t key, KWin::InputRedirection::KeyboardKeyState state) { - std::cout << "Got key event" << std::endl;; - if (key == KEY_Q && state == KWin::InputRedirection::KeyboardKeyReleased) { - QCoreApplication::instance()->quit(); - } - } - ); - QObject::connect(conn, &Connection::pointerButtonChanged, - [](uint32_t button, KWin::InputRedirection::PointerButtonState state) { - std::cout << "Got pointer button event" << std::endl; - if (button == BTN_MIDDLE && state == KWin::InputRedirection::PointerButtonReleased) { - QCoreApplication::instance()->quit(); - } - } - ); - QObject::connect(conn, &Connection::pointerMotion, - [](const QSizeF &delta) { - std::cout << "Got pointer motion: " << delta.width() << "/" << delta.height() << std::endl; - } - ); - QObject::connect(conn, &Connection::pointerAxisChanged, - [](KWin::InputRedirection::PointerAxis axis, qreal delta) { - std::cout << "Axis: " << axis << " with delta" << delta << std::endl; - } - ); - QObject::connect(conn, &Connection::touchDown, - [](qint32 id, const QPointF &position, quint32 time) { - std::cout << "Touch down at: " << position.x() << "/" << position.y() << " id " << id << " timestamp: " << time << std::endl; - } - ); - QObject::connect(conn, &Connection::touchMotion, - [](qint32 id, const QPointF &position, quint32 time) { - std::cout << "Touch motion at: " << position.x() << "/" << position.y() << " id " << id << " timestamp: " << time << std::endl; - } - ); - QObject::connect(conn, &Connection::touchUp, - [](qint32 id, quint32 time) { - std::cout << "Touch up for id " << id << " timestamp: " << time << std::endl; - } - ); - QObject::connect(conn, &Connection::touchCanceled, - []() { - std::cout << "Touch canceled" << std::endl; - } - ); - QObject::connect(conn, &Connection::touchFrame, - []() { - std::cout << "Touch frame " << std::endl; - } - ); - QObject::connect(&app, &QCoreApplication::aboutToQuit, [conn] { delete conn; }); - } - ); - - return app.exec(); -}