summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2022-03-02 22:16:39 +0100
committerRobert Griebl <robert.griebl@qt.io>2022-03-17 19:40:26 +0100
commit7c7d7b18def270e4a6508419eff2b10ac4313a85 (patch)
tree7fb50daea99f8115155daa3ed4dffa55ca0cc36f
parentc6b74e43b2b7b43e9404658bd16cbe52b46103e8 (diff)
downloadqtapplicationmanager-7c7d7b18def270e4a6508419eff2b10ac4313a85.tar.gz
Remove the touch emulation feature
This feature was implemented before Qt's pointer handlers were introduced and thanks to those it really isn't needed nowadays. Plus, it was only ever working on X11, limiting its usefulness. Change-Id: Icb03e2e8ede4fc5b62564fc70c20a460fe2d0134 Reviewed-by: Dominik Holland <dominik.holland@qt.io>
-rw-r--r--src/main-lib/configuration.cpp17
-rw-r--r--src/main-lib/configuration.h1
-rw-r--r--src/main-lib/configuration_p.h1
-rw-r--r--src/main-lib/main.cpp21
-rw-r--r--src/main-lib/main.h1
-rw-r--r--src/window-lib/CMakeLists.txt11
-rw-r--r--src/window-lib/configure.cmake8
-rw-r--r--src/window-lib/touchemulation.cpp88
-rw-r--r--src/window-lib/touchemulation.h61
-rw-r--r--src/window-lib/touchemulation_x11.cpp298
-rw-r--r--src/window-lib/touchemulation_x11_p.h75
-rw-r--r--tests/auto/configuration/data/config1.yaml1
-rw-r--r--tests/auto/configuration/data/config2.yaml1
-rw-r--r--tests/auto/configuration/tst_configuration.cpp5
-rw-r--r--util/bash/appman-prompt2
15 files changed, 6 insertions, 585 deletions
diff --git a/src/main-lib/configuration.cpp b/src/main-lib/configuration.cpp
index b9b152de..c17f2ca0 100644
--- a/src/main-lib/configuration.cpp
+++ b/src/main-lib/configuration.cpp
@@ -191,7 +191,7 @@ Configuration::Configuration(const QStringList &defaultConfigFilePaths,
m_clp.addOption({ qSL("single-app"), qSL("Runs a single application only (ignores the database)"), qSL("info.yaml file") }); // rename single-package
m_clp.addOption({ qSL("logging-rule"), qSL("Adds a standard Qt logging rule."), qSL("rule") });
m_clp.addOption({ qSL("qml-debug"), qSL("Enables QML debugging and profiling.") });
- m_clp.addOption({ qSL("enable-touch-emulation"), qSL("Enables the touch emulation, converting mouse to touch events.") });
+ m_clp.addOption({ qSL("enable-touch-emulation"), qSL("Deprecated (ignored).") });
}
QVariant Configuration::buildConfig() const
@@ -386,7 +386,7 @@ void Configuration::parseWithArguments(const QStringList &arguments)
}
-const quint32 ConfigurationData::DataStreamVersion = 6;
+const quint32 ConfigurationData::DataStreamVersion = 7;
ConfigurationData *ConfigurationData::loadFromCache(QDataStream &ds)
@@ -431,7 +431,6 @@ ConfigurationData *ConfigurationData::loadFromCache(QDataStream &ds)
>> cd->ui.pluginPaths
>> cd->ui.iconThemeName
>> cd->ui.loadDummyData
- >> cd->ui.enableTouchEmulation
>> cd->ui.iconThemeSearchPaths
>> cd->ui.opengl
>> cd->applications.builtinAppsManifestDir
@@ -494,7 +493,6 @@ void ConfigurationData::saveToCache(QDataStream &ds) const
<< ui.pluginPaths
<< ui.iconThemeName
<< ui.loadDummyData
- << ui.enableTouchEmulation
<< ui.iconThemeSearchPaths
<< ui.opengl
<< applications.builtinAppsManifestDir
@@ -594,7 +592,6 @@ void ConfigurationData::mergeFrom(const ConfigurationData *from)
MERGE_FIELD(ui.pluginPaths);
MERGE_FIELD(ui.iconThemeName);
MERGE_FIELD(ui.loadDummyData);
- MERGE_FIELD(ui.enableTouchEmulation);
MERGE_FIELD(ui.iconThemeSearchPaths);
MERGE_FIELD(ui.opengl);
MERGE_FIELD(applications.builtinAppsManifestDir);
@@ -767,8 +764,9 @@ ConfigurationData *ConfigurationData::loadFromSource(QIODevice *source, const QS
}); } },
{ "ui", false, YamlParser::Map, [&cd](YamlParser *p) {
p->parseFields({
- { "enableTouchEmulation", false, YamlParser::Scalar, [&cd](YamlParser *p) {
- cd->ui.enableTouchEmulation = p->parseScalar().toBool(); } },
+ { "enableTouchEmulation", false, YamlParser::Scalar, [](YamlParser *p) {
+ qCDebug(LogDeployment) << "ignoring 'enableTouchEmulation'";
+ (void) p->parseScalar(); } },
{ "iconThemeSearchPaths", false, YamlParser::Scalar | YamlParser::List, [&cd](YamlParser *p) {
cd->ui.iconThemeSearchPaths = p->parseStringOrStringList(); } },
{ "iconThemeName", false, YamlParser::Scalar, [&cd](YamlParser *p) {
@@ -1147,11 +1145,6 @@ QStringList Configuration::iconThemeSearchPaths() const
return m_data->ui.iconThemeSearchPaths;
}
-bool Configuration::enableTouchEmulation() const
-{
- return value("enable-touch-emulation", m_data->ui.enableTouchEmulation);
-}
-
QString Configuration::dltId() const
{
return value<QString>(nullptr, m_data->logging.dlt.id);
diff --git a/src/main-lib/configuration.h b/src/main-lib/configuration.h
index 64eb040e..dce0baa3 100644
--- a/src/main-lib/configuration.h
+++ b/src/main-lib/configuration.h
@@ -95,7 +95,6 @@ public:
QString style() const;
QString iconThemeName() const;
QStringList iconThemeSearchPaths() const;
- bool enableTouchEmulation() const;
QString dltId() const;
QString dltDescription() const;
QString dltLongMessageBehavior() const;
diff --git a/src/main-lib/configuration_p.h b/src/main-lib/configuration_p.h
index 671cbf82..1195c4fb 100644
--- a/src/main-lib/configuration_p.h
+++ b/src/main-lib/configuration_p.h
@@ -113,7 +113,6 @@ struct ConfigurationData
struct {
QVariantMap opengl;
- bool enableTouchEmulation = false;
QStringList iconThemeSearchPaths;
QString iconThemeName;
QString style;
diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp
index e5b4df13..1fc545a3 100644
--- a/src/main-lib/main.cpp
+++ b/src/main-lib/main.cpp
@@ -101,7 +101,6 @@
#if defined(QT_DBUS_LIB) && !defined(AM_DISABLE_EXTERNAL_DBUS_INTERFACES)
# include "windowmanagerdbuscontextadaptor.h"
#endif
-#include "touchemulation.h"
#include "windowframetimer.h"
#include "gpustatus.h"
@@ -246,7 +245,6 @@ void Main::setup(const Configuration *cfg) Q_DECL_NOEXCEPT_EXPR(false)
setupWindowTitle(QString(), cfg->windowIcon());
setupWindowManager(cfg->waylandSocketName(), cfg->waylandExtraSockets(),
cfg->slowAnimations(), cfg->noUiWatchdog());
- setupTouchEmulation(cfg->enableTouchEmulation());
setupDBus(std::bind(&Configuration::dbusRegistration, cfg, std::placeholders::_1),
std::bind(&Configuration::dbusPolicy, cfg, std::placeholders::_1));
@@ -723,25 +721,6 @@ void Main::setupWindowManager(const QString &waylandSocketName, const QVariantLi
m_windowManager, &WindowManager::raiseApplicationWindow);
}
-void Main::setupTouchEmulation(bool enableTouchEmulation)
-{
- if (enableTouchEmulation) {
- if (TouchEmulation::isSupported()) {
- if (TouchEmulation::hasPhysicalTouchscreen()) {
- TouchEmulation::createInstance();
- qCDebug(LogGraphics) << "Touch emulation is enabled: all mouse events will be "
- "converted to touch events.";
- } else {
- qCDebug(LogGraphics) << "Touch emulation is disabled, because at least one touch "
- "input device was detected";
- }
- } else {
- qCWarning(LogGraphics) << "Touch emulation cannot be enabled. Either it was disabled at "
- "build time or the platform does not support it.";
- }
- }
-}
-
void Main::loadQml(bool loadDummyData) Q_DECL_NOEXCEPT_EXPR(false)
{
for (auto iface : qAsConst(m_startupPlugins))
diff --git a/src/main-lib/main.h b/src/main-lib/main.h
index 69777fc1..1cfe6218 100644
--- a/src/main-lib/main.h
+++ b/src/main-lib/main.h
@@ -116,7 +116,6 @@ protected:
void setupQmlEngine(const QStringList &importPaths, const QString &quickControlsStyle = QString());
void setupWindowTitle(const QString &title, const QString &iconPath);
void setupWindowManager(const QString &waylandSocketName, const QVariantList &waylandExtraSockets, bool slowAnimations, bool uiWatchdog);
- void setupTouchEmulation(bool enableTouchEmulation);
enum SystemProperties {
SP_ThirdParty = 0,
diff --git a/src/window-lib/CMakeLists.txt b/src/window-lib/CMakeLists.txt
index 9f35631f..48901d3c 100644
--- a/src/window-lib/CMakeLists.txt
+++ b/src/window-lib/CMakeLists.txt
@@ -9,7 +9,6 @@ qt_internal_add_module(AppManWindowPrivate
INTERNAL_MODULE
SOURCES
inprocesswindow.cpp inprocesswindow.h
- touchemulation.cpp touchemulation.h
window.cpp window.h
windowitem.cpp windowitem.h
windowmanager.cpp windowmanager.h windowmanager_p.h
@@ -45,13 +44,3 @@ if(QT_FEATURE_am_multi_process)
Qt::WaylandCompositor
)
endif()
-
-qt_internal_extend_target(AppManWindowPrivate CONDITION QT_FEATURE_am_touch_emulation
- SOURCES
- touchemulation_x11.cpp touchemulation_x11_p.h
- LIBRARIES
- Qt::GuiPrivate
- PUBLIC_LIBRARIES
- Qt::Test
- X11::Xi
-)
diff --git a/src/window-lib/configure.cmake b/src/window-lib/configure.cmake
index ea6c5a30..e51ef2ee 100644
--- a/src/window-lib/configure.cmake
+++ b/src/window-lib/configure.cmake
@@ -8,13 +8,6 @@ qt_find_package(X11)
#### Features
-qt_feature("am-touch-emulation" PRIVATE
- LABEL "Touch emulation support on X11"
- CONDITION X11_Xi_FOUND AND LINUX
- EMIT_IF LINUX
-)
-qt_feature_definition("am-touch-emulation" "AM_ENABLE_TOUCH_EMULATION")
-
qt_feature("am-widgets-support" PRIVATE PUBLIC
LABEL "Enable support for Qt widgets"
CONDITION TARGET Qt::Widgets
@@ -24,7 +17,6 @@ qt_feature("am-widgets-support" PRIVATE PUBLIC
qt_feature_definition("am-widgets-support" "AM_WIDGETS_SUPPORT")
qt_configure_add_summary_section(NAME "Qt Application Manager [Window module]")
-qt_configure_add_summary_entry(ARGS "am-touch-emulation")
qt_configure_add_summary_entry(ARGS "am-widgets-support")
qt_configure_end_summary_section() # end of "Qt ApplicationManger" section
diff --git a/src/window-lib/touchemulation.cpp b/src/window-lib/touchemulation.cpp
deleted file mode 100644
index 825b8481..00000000
--- a/src/window-lib/touchemulation.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Copyright (C) 2019 Luxoft Sweden AB
-** Copyright (C) 2018 Pelagicore AG
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtApplicationManager module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtAppManCommon/global.h>
-#include <QGuiApplication>
-#include <QInputDevice>
-#include "touchemulation.h"
-#if defined(AM_ENABLE_TOUCH_EMULATION)
-# include "touchemulation_x11_p.h"
-#endif
-
-QT_BEGIN_NAMESPACE_AM
-
-TouchEmulation *TouchEmulation::s_instance = nullptr;
-
-TouchEmulation::~TouchEmulation()
-{
- s_instance = nullptr;
-}
-
-TouchEmulation *TouchEmulation::instance()
-{
- return s_instance;
-}
-
-TouchEmulation *TouchEmulation::createInstance()
-{
- if (Q_UNLIKELY(s_instance))
- qFatal("TouchEmulation::createInstance() was called a second time.");
-
-#if defined(AM_ENABLE_TOUCH_EMULATION)
- if (isSupported())
- s_instance = new TouchEmulationX11();
-#endif
-
- return s_instance;
-}
-
-bool TouchEmulation::isSupported()
-{
-#if defined(AM_ENABLE_TOUCH_EMULATION)
- if (QGuiApplication::platformName() == qL1S("xcb"))
- return true;
-#endif
- return false;
-}
-
-bool QtAM::TouchEmulation::hasPhysicalTouchscreen()
-{
- const auto devs = QInputDevice::devices();
- for (auto dev : devs) {
- if (dev->type() == QInputDevice::DeviceType::TouchScreen)
- return true;
- }
- return false;
-}
-
-QT_END_NAMESPACE_AM
-
-#include "moc_touchemulation.cpp"
diff --git a/src/window-lib/touchemulation.h b/src/window-lib/touchemulation.h
deleted file mode 100644
index 111d6205..00000000
--- a/src/window-lib/touchemulation.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Copyright (C) 2019 Luxoft Sweden AB
-** Copyright (C) 2018 Pelagicore AG
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtApplicationManager module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <QtAppManCommon/global.h>
-#include <QObject>
-
-QT_BEGIN_NAMESPACE_AM
-
-/*
- Converts native mouse events into touch events
-
- Useful for emulating touch interaction using a mouse device since touch input
- follows a completely different code path from mouse events in Qt.
-*/
-class TouchEmulation : public QObject
-{
- Q_OBJECT
-
-public:
- virtual ~TouchEmulation();
- static TouchEmulation *createInstance();
- static TouchEmulation *instance();
-
- static bool isSupported();
- static bool hasPhysicalTouchscreen();
-
-private:
- static TouchEmulation *s_instance;
-};
-
-QT_END_NAMESPACE_AM
diff --git a/src/window-lib/touchemulation_x11.cpp b/src/window-lib/touchemulation_x11.cpp
deleted file mode 100644
index db72906f..00000000
--- a/src/window-lib/touchemulation_x11.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Copyright (C) 2019 Luxoft Sweden AB
-** Copyright (C) 2018 Pelagicore AG
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtApplicationManager module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtAppManCommon/global.h>
-
-#include "touchemulation_x11_p.h"
-
-#include <QGuiApplication>
-#include <QMouseEvent>
-#include <QPointingDevice>
-#include <QWindow>
-#include <QTest>
-
-#include <QtAppManCommon/logging.h>
-
-#include <qpa/qplatformnativeinterface.h>
-#include <qpa/qwindowsysteminterface.h>
-
-#include <xcb/xcb.h>
-#include <X11/extensions/XInput2.h>
-#include <X11/extensions/XI2proto.h>
-
-// this event type was added in libxcb 1.10,
-// but we support also older version
-#ifndef XCB_GE_GENERIC
-# define XCB_GE_GENERIC 35
-#endif
-
-#if defined None
-# undef None
-#endif
-
-QT_BEGIN_NAMESPACE_AM
-
-using QTest::QTouchEventSequence;
-
-
-static Qt::MouseButton xcbButtonToQtMouseButton(xcb_button_t detail)
-{
- switch (detail) {
- case 1: return Qt::LeftButton;
- case 2: return Qt::MiddleButton;
- case 3: return Qt::RightButton;
- // don't care about the rest
- default: return Qt::NoButton;
- }
-}
-
-// Function copied from the XCB QPA
-static void xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event)
-{
- // xcb event structs contain stuff that wasn't on the wire, the full_sequence field
- // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes.
- // Move this data back to have the same layout in memory as it was on the wire
- // and allow casting, overwriting the full_sequence field.
- memmove(reinterpret_cast<char *>(event) + 32, reinterpret_cast<char*>(event) + 36, event->length * 4);
-}
-
-static qreal fixed1616ToReal(FP1616 val)
-{
- return qreal(val) / 0x10000;
-}
-
-
-TouchEmulationX11::TouchEmulationX11()
-{
- qGuiApp->installNativeEventFilter(this);
-
- // Create a fake touch device to deliver our synthesized events
- m_touchDevice = new QPointingDevice(qSL("Fake Touch"), -1, QInputDevice::DeviceType::TouchScreen,
- QPointingDevice::PointerType::Finger,
- QInputDevice::Capability::None, 0, 0);
- QWindowSystemInterface::registerInputDevice(m_touchDevice);
-
- queryForXInput2();
-}
-
-void TouchEmulationX11::queryForXInput2()
-{
- QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface();
- Display *xDisplay = static_cast<Display*>(nativeInterface->nativeResourceForIntegration("Display"));
-
- int xiOpCode, xiEventBase, xiErrorBase;
- if (xDisplay && XQueryExtension(xDisplay, "XInputExtension", &xiOpCode, &xiEventBase, &xiErrorBase)) {
- // 2.0 is enough for our needs
- int xiMajor = 2;
- int xi2Minor = 0;
- m_haveXInput2 = XIQueryVersion(xDisplay, &xiMajor, &xi2Minor) != BadRequest;
- }
-}
-
-bool TouchEmulationX11::nativeEventFilter(const QByteArray &eventType, void *message, qintptr * /*result*/)
-{
- if (eventType != "xcb_generic_event_t")
- return false; // just ignore non-XCB-native events
-
- xcb_generic_event_t *xcbEvent = static_cast<xcb_generic_event_t *>(message);
-
- switch (xcbEvent->response_type & ~0x80) {
- case XCB_BUTTON_PRESS: {
- auto xcbPress = reinterpret_cast<xcb_button_press_event_t *>(xcbEvent);
- return handleButtonPress(static_cast<WId>(xcbPress->event), xcbPress->detail, 0,
- xcbPress->event_x, xcbPress->event_y);
- }
- case XCB_BUTTON_RELEASE: {
- auto xcbRelease = reinterpret_cast<xcb_button_release_event_t *>(xcbEvent);
- return handleButtonRelease(static_cast<WId>(xcbRelease->event), xcbRelease->detail, 0,
- xcbRelease->event_x, xcbRelease->event_y);
- }
- case XCB_MOTION_NOTIFY: {
- auto xcbMotion = reinterpret_cast<xcb_motion_notify_event_t *>(xcbEvent);
- return handleMotionNotify(static_cast<WId>(xcbMotion->event), 0,
- xcbMotion->event_x, xcbMotion->event_y);
- }
- case XCB_GE_GENERIC: {
- if (!m_haveXInput2)
- return false;
-
- auto xcbGeneric = reinterpret_cast<xcb_ge_event_t *>(xcbEvent);
-
- // Because xi2PrepareXIGenericDeviceEvent modifies data inplace
- backupEventData(xcbGeneric);
-
- xi2PrepareXIGenericDeviceEvent(xcbGeneric);
- auto xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(xcbGeneric);
- xXIDeviceEvent *xiDeviceEvent = nullptr;
-
- switch (xiEvent->evtype) {
- case XI_ButtonPress:
- case XI_ButtonRelease:
- case XI_Motion:
- xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(xcbGeneric);
- break;
- default:
- break;
- }
-
- bool result = false;
-
- if (xiDeviceEvent) {
- switch (xiDeviceEvent->evtype) {
- case XI_ButtonPress:
- result = handleButtonPress(
- static_cast<WId>(xiDeviceEvent->event),
- xiDeviceEvent->detail,
- xiDeviceEvent->mods.base_mods,
- fixed1616ToReal(xiDeviceEvent->event_x),
- fixed1616ToReal(xiDeviceEvent->event_y));
- break;
- case XI_ButtonRelease:
- result = handleButtonRelease(
- static_cast<WId>(xiDeviceEvent->event),
- xiDeviceEvent->detail,
- xiDeviceEvent->mods.base_mods,
- fixed1616ToReal(xiDeviceEvent->event_x),
- fixed1616ToReal(xiDeviceEvent->event_y));
- break;
- case XI_Motion:
- handleMotionNotify(
- static_cast<WId>(xiDeviceEvent->event),
- xiDeviceEvent->mods.base_mods,
- fixed1616ToReal(xiDeviceEvent->event_x),
- fixed1616ToReal(xiDeviceEvent->event_y));
- result = true;
- break;
- default:
- break;
- }
- }
-
- // Put the event back in its original state so that the XCB QPA can process it normally
- restoreEventData(xcbGeneric);
- return result;
- }
- default:
- return false;
- };
-}
-
-bool TouchEmulationX11::handleButtonPress(WId windowId, uint32_t detail, uint32_t /*modifiers*/, qreal x, qreal y)
-{
- Qt::MouseButton button = xcbButtonToQtMouseButton(static_cast<xcb_button_t>(detail));
-
- // Filter out the other mouse buttons
- if (button != Qt::LeftButton)
- return true;
-
- QWindow *targetWindow = findQWindowWithXWindowID(windowId);
-
- QPointF windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
-
- QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false /* autoCommit */);
- touchEvent.press(0 /* touchId */, windowPos.toPoint(), targetWindow);
- touchEvent.commit(false /* processEvents */);
-
- m_leftButtonIsPressed = true;
- return true;
-}
-
-bool TouchEmulationX11::handleButtonRelease(WId windowId, uint32_t detail, uint32_t, qreal x, qreal y)
-{
- Qt::MouseButton button = xcbButtonToQtMouseButton(static_cast<xcb_button_t>(detail));
-
- // Don't eat the event if it wasn't a left mouse press
- if (button != Qt::LeftButton)
- return false;
-
- QWindow *targetWindow = findQWindowWithXWindowID(windowId);
-
- QPointF windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
-
- QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false /* autoCommit */);
- touchEvent.release(0 /* touchId */, windowPos.toPoint(), targetWindow);
- touchEvent.commit(false /* processEvents */);
-
- m_leftButtonIsPressed = false;
- return true;
-}
-
-bool TouchEmulationX11::handleMotionNotify(WId windowId, uint32_t /*modifiers*/, qreal x, qreal y)
-{
- if (!m_leftButtonIsPressed)
- return true;
-
- QWindow *targetWindow = findQWindowWithXWindowID(windowId);
-
- QPointF windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
-
- QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false /* autoCommit */);
- touchEvent.move(0 /* touchId */, windowPos.toPoint(), targetWindow);
- touchEvent.commit(false /* processEvents */);
-
- return true;
-}
-
-QWindow *TouchEmulationX11::findQWindowWithXWindowID(WId windowId)
-{
- QWindowList windowList = QGuiApplication::topLevelWindows();
- QWindow *foundWindow = nullptr;
-
- int i = 0;
- while (!foundWindow && (i < windowList.count())) {
- QWindow *window = windowList[i];
- if (window->winId() == windowId)
- foundWindow = window;
- else
- ++i;
- }
-
- Q_ASSERT(foundWindow);
- return foundWindow;
-}
-
-
-// backup event data before a xi2PrepareXIGenericDeviceEvent() call
-void TouchEmulationX11::backupEventData(void *event)
-{
- memcpy(reinterpret_cast<char *>(m_xiEventBackupData), reinterpret_cast<char *>(event) + 32, 4);
-}
-
-// restore event data after a xi2PrepareXIGenericDeviceEvent() call
-void TouchEmulationX11::restoreEventData(void *ev)
-{
- auto *event = static_cast<xcb_ge_event_t *>(ev);
-
- memmove(reinterpret_cast<char *>(event) + 36, reinterpret_cast<char *>(event) + 32, event->length * 4);
- memcpy(reinterpret_cast<char *>(event) + 32, reinterpret_cast<char *>(m_xiEventBackupData), 4);
-}
-
-QT_END_NAMESPACE_AM
diff --git a/src/window-lib/touchemulation_x11_p.h b/src/window-lib/touchemulation_x11_p.h
deleted file mode 100644
index 3d6385dd..00000000
--- a/src/window-lib/touchemulation_x11_p.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2021 The Qt Company Ltd.
-** Copyright (C) 2019 Luxoft Sweden AB
-** Copyright (C) 2018 Pelagicore AG
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtApplicationManager module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#pragma once
-
-#include <QtAppManCommon/global.h>
-#include <QtAppManWindow/qtappman_window-config.h>
-#include "touchemulation.h"
-
-#if defined(AM_ENABLE_TOUCH_EMULATION)
-
-#include <QAbstractNativeEventFilter>
-#include <QObject>
-#include <QWindow>
-
-QT_FORWARD_DECLARE_CLASS(QPointingDevice)
-QT_FORWARD_DECLARE_CLASS(QWindow)
-
-QT_BEGIN_NAMESPACE_AM
-
-class TouchEmulationX11 : public TouchEmulation, public QAbstractNativeEventFilter
-{
-public:
- TouchEmulationX11();
- bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
-
-private:
- void queryForXInput2();
- bool handleButtonPress(WId windowId, uint32_t detail, uint32_t modifiers, qreal x, qreal y);
- bool handleButtonRelease(WId windowId, uint32_t detail, uint32_t, qreal x, qreal y);
- bool handleMotionNotify(WId windowId, uint32_t modifiers, qreal x, qreal y);
- QWindow *findQWindowWithXWindowID(WId windowId);
-
- void backupEventData(void *event);
- void restoreEventData(void *event);
-
- QPointingDevice *m_touchDevice = nullptr;
- bool m_haveXInput2 = false;
- bool m_leftButtonIsPressed = false;
-
- quint8 m_xiEventBackupData[4];
-};
-
-QT_END_NAMESPACE_AM
-
-#endif // AM_ENABLE_TOUCH_EMULATION
-// We mean it. Dummy comment since syncqt needs this also for completely private Qt modules.
diff --git a/tests/auto/configuration/data/config1.yaml b/tests/auto/configuration/data/config1.yaml
index 77e9ad8b..2f6289b9 100644
--- a/tests/auto/configuration/data/config1.yaml
+++ b/tests/auto/configuration/data/config1.yaml
@@ -48,7 +48,6 @@ ui:
desktopProfile: 'compatibility'
esMajorVersion: 5
esMinorVersion: 15
- enableTouchEmulation: true
iconThemeSearchPaths: [ itsp1, itsp2 ]
iconThemeName: mytheme
style: mystyle
diff --git a/tests/auto/configuration/data/config2.yaml b/tests/auto/configuration/data/config2.yaml
index e18a0863..763f40d5 100644
--- a/tests/auto/configuration/data/config2.yaml
+++ b/tests/auto/configuration/data/config2.yaml
@@ -55,7 +55,6 @@ ui:
desktopProfile: 'classic'
esMajorVersion: 1
esMinorVersion: 0
- enableTouchEmulation: true
iconThemeSearchPaths: [ itsp3 ]
iconThemeName: mytheme2
style: mystyle2
diff --git a/tests/auto/configuration/tst_configuration.cpp b/tests/auto/configuration/tst_configuration.cpp
index aa506312..ba0eae75 100644
--- a/tests/auto/configuration/tst_configuration.cpp
+++ b/tests/auto/configuration/tst_configuration.cpp
@@ -102,7 +102,6 @@ void tst_Configuration::defaultConfig()
QCOMPARE(c.style(), qSL(""));
QCOMPARE(c.iconThemeName(), qSL(""));
QCOMPARE(c.iconThemeSearchPaths(), {});
- QCOMPARE(c.enableTouchEmulation(), false);
QCOMPARE(c.dltId(), qSL(""));
QCOMPARE(c.dltDescription(), qSL(""));
QCOMPARE(c.resources(), {});
@@ -186,7 +185,6 @@ void tst_Configuration::simpleConfig()
QCOMPARE(c.style(), qSL("mystyle"));
QCOMPARE(c.iconThemeName(), qSL("mytheme"));
QCOMPARE(c.iconThemeSearchPaths(), QStringList({ qSL("itsp1"), qSL("itsp2") }));
- QCOMPARE(c.enableTouchEmulation(), true);
QCOMPARE(c.dltId(), qSL("dltid"));
QCOMPARE(c.dltDescription(), qSL("dltdesc"));
QCOMPARE(c.dltLongMessageBehavior(), qSL("split"));
@@ -317,7 +315,6 @@ void tst_Configuration::mergedConfig()
QCOMPARE(c.style(), qSL("mystyle2"));
QCOMPARE(c.iconThemeName(), qSL("mytheme2"));
QCOMPARE(c.iconThemeSearchPaths(), QStringList({ qSL("itsp1"), qSL("itsp2"), qSL("itsp3") }));
- QCOMPARE(c.enableTouchEmulation(), true);
QCOMPARE(c.dltId(), qSL("dltid2"));
QCOMPARE(c.dltDescription(), qSL("dltdesc2"));
QCOMPARE(c.dltLongMessageBehavior(), qSL("truncate"));
@@ -445,7 +442,6 @@ void tst_Configuration::commandLineConfig()
<< "--logging-rule" << "cl-lr1"
<< "--logging-rule" << "cl-lr2"
<< "--qml-debug"
- << "--enable-touch-emulation"
<< "main-cl.qml";
QStringList strCommandLine;
@@ -495,7 +491,6 @@ void tst_Configuration::commandLineConfig()
QCOMPARE(c.style(), qSL(""));
QCOMPARE(c.iconThemeName(), qSL(""));
QCOMPARE(c.iconThemeSearchPaths(), {});
- QCOMPARE(c.enableTouchEmulation(), true);
QCOMPARE(c.dltId(), qSL(""));
QCOMPARE(c.dltDescription(), qSL(""));
QCOMPARE(c.resources(), {});
diff --git a/util/bash/appman-prompt b/util/bash/appman-prompt
index aecc2180..16c78a4b 100644
--- a/util/bash/appman-prompt
+++ b/util/bash/appman-prompt
@@ -34,7 +34,7 @@ _appman()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
opts="-c -h -o -v -I --build-config --builtin-apps-manifest-dir --clear-cache --clear-config-cache --config-file \
---development-mode --dbus --disable-installer --disable-intents --document-dir --enable-touch-emulation \
+--development-mode --dbus --disable-installer --disable-intents --document-dir \
--force-multi-process --force-single-process --fullscreen --help --load-dummydata --log-instant --logging-rule \
--no-cache --no-config-cache --no-dlt-logging --no-fullscreen --no-security --no-ui-watchdog --option --qml-debug \
--single-app --slow-animations --verbose --version --wayland-socket-name"