From 6513c66ca6edb7d7bffcaec173eb1c12d2242aac Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 28 Sep 2021 18:24:12 +0300 Subject: [PATCH] wayland: Move ConnectionAdaptor to the same thread as Connection Connection deletes the ConnectionAdaptor, but they are in different threads, which is weird. CCBUG: 442104 --- src/libinput/connection.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libinput/connection.cpp b/src/libinput/connection.cpp index 93017005d5..fa646b26e4 100644 --- a/src/libinput/connection.cpp +++ b/src/libinput/connection.cpp @@ -51,10 +51,11 @@ private: public: ConnectionAdaptor(Connection *con) - : m_con(con) + : QObject(con) + , m_con(con) { - connect(con, &Connection::deviceAddedSysName, this, &ConnectionAdaptor::deviceAdded, Qt::QueuedConnection); - connect(con, &Connection::deviceRemovedSysName, this, &ConnectionAdaptor::deviceRemoved, Qt::QueuedConnection); + connect(con, &Connection::deviceAddedSysName, this, &ConnectionAdaptor::deviceAdded); + connect(con, &Connection::deviceRemovedSysName, this, &ConnectionAdaptor::deviceRemoved); QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/KWin/InputDevice"), QStringLiteral("org.kde.KWin.InputDeviceManager"), @@ -68,15 +69,12 @@ public: } QStringList devicesSysNames() { - // TODO: is this allowed? directly calling function of object in another thread!? - // otherwise use signal-slot mechanism return m_con->devicesSysNames(); } Q_SIGNALS: void deviceAdded(QString sysName); void deviceRemoved(QString sysName); - }; Connection *Connection::s_self = nullptr;