davidedmundson added a comment.
To expand on the DBus problem:
The connection object resides in a thread; but emits stuff from the main
thread.
DBus is generally thread safe, but QDBusAbstractAdaptor uses sender() in
relaying so isn't.
add in a bouncer, things work nicely:
connect(this, &Connection::deviceRemoved, this, [this](Device* device) {
emit deviceRemovedSysName(device->sysName());
});
this gets implicitly queuedconnection as this is emitted in another thread
and it all works. Huzzah
However, we still get a tonne of warnings because we're emitting a bunch of
other signals, and internally in QDBusAbstractAdaptor we have the warning about
checking for threads*before* we see if actually relays the signal.
The only solution I can see is to make an explicit adaptor.
(or we change the KCM side to use org.freedesktop.DBus.ObjectManager and
forget putting anything in here)
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D3479
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: subdiff, #kwin, #plasma, davidedmundson
Cc: graesslin, davidedmundson, plasma-devel, kwin, #kwin, lesliezhai,
ali-mohamed, jensreuterberg, abetts, sebas