diff --git a/src/backend/Backend.cpp b/src/backend/Backend.cpp index b78226c..32651ac 100644 --- a/src/backend/Backend.cpp +++ b/src/backend/Backend.cpp @@ -166,6 +166,9 @@ bool Aquamarine::CBackend::start() { b->onReady(); } + if (session) + session->onReady(); + sessionFDs = session ? session->pollFDs() : std::vector>{}; return true; diff --git a/src/backend/Session.cpp b/src/backend/Session.cpp index 6465e5d..6d47aaa 100644 --- a/src/backend/Session.cpp +++ b/src/backend/Session.cpp @@ -264,24 +264,7 @@ static bool isDRMCard(const char* sysname) { } void Aquamarine::CSession::onReady() { - for (auto const& d : libinputDevices) { - if (d->keyboard) - backend->events.newKeyboard.emit(SP(d->keyboard)); - if (d->mouse) - backend->events.newPointer.emit(SP(d->mouse)); - if (d->touch) - backend->events.newTouch.emit(SP(d->touch)); - if (d->switchy) - backend->events.newSwitch.emit(SP(d->touch)); - if (d->tablet) - backend->events.newTablet.emit(SP(d->tablet)); - if (d->tabletPad) - backend->events.newTabletPad.emit(SP(d->tabletPad)); - - for (auto const& t : d->tabletTools) { - backend->events.newTabletTool.emit(SP(t)); - } - } + ; } void Aquamarine::CSession::dispatchUdevEvents() { @@ -377,7 +360,12 @@ void Aquamarine::CSession::dispatchLibseatEvents() { void Aquamarine::CSession::dispatchPendingEventsAsync() { dispatchLibseatEvents(); + + // only linux libudev allows us to asynchronously dispatch outstanding without blocking +#if defined(__linux__) dispatchUdevEvents(); +#endif + dispatchLibinputEvents(); }