Skip to content

Commit 40b7512

Browse files
committed
fix: fix wayland client dispatch loop
In previous commit d63a6b we dispatch wayland events purely inside the QSocketNotifier. This will cause server events that is send before the notifier created is not being dispatched, which is not what we want and will cause severe issue in the current interaction model of ddm & treeland, as treeland will send an event immediately after ddm is connected. Fix it by dispatch once before create notifier.
1 parent d63a6ba commit 40b7512

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/daemon/TreelandConnector.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ void TreelandConnector::connect(QString socketPath) {
205205

206206
wl_display_roundtrip(m_display);
207207

208+
wl_display_dispatch(m_display);
209+
wl_display_flush(m_display);
208210
m_notifier = new QSocketNotifier(wl_display_get_fd(m_display), QSocketNotifier::Read);
209211
QObject::connect(m_notifier, &QSocketNotifier::activated, this, [this] {
210212
if (wl_display_dispatch(m_display) == -1 || wl_display_flush(m_display) == -1) {

0 commit comments

Comments
 (0)