mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 00:15:59 +01:00
Session: only dispatch udev in dispatchPendingEventsAsync if on linux (#86)
This commit is contained in:
parent
752d0fbd14
commit
8b728612a9
2 changed files with 9 additions and 18 deletions
|
@ -166,6 +166,9 @@ bool Aquamarine::CBackend::start() {
|
||||||
b->onReady();
|
b->onReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (session)
|
||||||
|
session->onReady();
|
||||||
|
|
||||||
sessionFDs = session ? session->pollFDs() : std::vector<Hyprutils::Memory::CSharedPointer<SPollFD>>{};
|
sessionFDs = session ? session->pollFDs() : std::vector<Hyprutils::Memory::CSharedPointer<SPollFD>>{};
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -264,24 +264,7 @@ static bool isDRMCard(const char* sysname) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aquamarine::CSession::onReady() {
|
void Aquamarine::CSession::onReady() {
|
||||||
for (auto const& d : libinputDevices) {
|
;
|
||||||
if (d->keyboard)
|
|
||||||
backend->events.newKeyboard.emit(SP<IKeyboard>(d->keyboard));
|
|
||||||
if (d->mouse)
|
|
||||||
backend->events.newPointer.emit(SP<IPointer>(d->mouse));
|
|
||||||
if (d->touch)
|
|
||||||
backend->events.newTouch.emit(SP<ITouch>(d->touch));
|
|
||||||
if (d->switchy)
|
|
||||||
backend->events.newSwitch.emit(SP<ITouch>(d->touch));
|
|
||||||
if (d->tablet)
|
|
||||||
backend->events.newTablet.emit(SP<ITablet>(d->tablet));
|
|
||||||
if (d->tabletPad)
|
|
||||||
backend->events.newTabletPad.emit(SP<ITabletPad>(d->tabletPad));
|
|
||||||
|
|
||||||
for (auto const& t : d->tabletTools) {
|
|
||||||
backend->events.newTabletTool.emit(SP<ITabletTool>(t));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aquamarine::CSession::dispatchUdevEvents() {
|
void Aquamarine::CSession::dispatchUdevEvents() {
|
||||||
|
@ -377,7 +360,12 @@ void Aquamarine::CSession::dispatchLibseatEvents() {
|
||||||
|
|
||||||
void Aquamarine::CSession::dispatchPendingEventsAsync() {
|
void Aquamarine::CSession::dispatchPendingEventsAsync() {
|
||||||
dispatchLibseatEvents();
|
dispatchLibseatEvents();
|
||||||
|
|
||||||
|
// only linux libudev allows us to asynchronously dispatch outstanding without blocking
|
||||||
|
#if defined(__linux__)
|
||||||
dispatchUdevEvents();
|
dispatchUdevEvents();
|
||||||
|
#endif
|
||||||
|
|
||||||
dispatchLibinputEvents();
|
dispatchLibinputEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue