You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.9 KiB
56 lines
1.9 KiB
From 112b1127178034a214e4585cef1e3516c6fa476c Mon Sep 17 00:00:00 2001
|
|
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
Date: Tue, 28 Sep 2021 18:24:12 +0300
|
|
Subject: [PATCH 3/4] wayland: Move ConnectionAdaptor to the same thread as
|
|
Connection
|
|
|
|
Connection deletes the ConnectionAdaptor, but they are in different
|
|
threads, which is weird.
|
|
|
|
CCBUG: 442104
|
|
|
|
|
|
(cherry picked from commit 6513c66ca6edb7d7bffcaec173eb1c12d2242aac)
|
|
---
|
|
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 104f2ea94..a7b068dda 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;
|
|
--
|
|
2.32.0
|
|
|