In some cases, it's possible that libinput wrote device added events to
the file descriptor before the connection to handle those events was
in-place. This resulted in a compositor without any input devices.
Details
Details
- Reviewers
graesslin davidedmundson - Group Reviewers
Plasma - Commits
- R108:60b041383064: Merge branch 'Plasma/5.11'
R108:d7d78e2b5937: Fix race condition with libinput events on startup
Ran a wayland session. In about 60% of all cases, no input was
possible. kwin_libinput showed the enumeration of all devices correctly,
but KWin::LibInput::Context did not have any m_devices.
After this change, this did not appear anymore.
Diff Detail
Diff Detail
- Repository
- R108 KWin
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
input.cpp | ||
---|---|---|
1733–1737 | Doesn't it to be in setup? void Connection::setup(QObject *to) { connect(this, &LibInput::Connection::eventsRead, to, [this]() { processEvents(); }, Qt::QueuedConnection); QMetaObject::invokeMethod(this, "doSetup", Qt::QueuedConnection); } Caller should be conn->setup(this); Otherwise it looks inconvenience, no? |
Comment Actions
Should this go into Plasma/5.11 as well?
input.cpp | ||
---|---|---|
1733–1737 | IMO the connection should be made by the receiver, as it knows which threads are supposed to get which events. |