mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-12-22 11:39:49 +01:00
session: fixup a few missing nullchecks
This commit is contained in:
parent
1e4fd47865
commit
c8c1e6ae3f
1 changed files with 10 additions and 2 deletions
|
@ -66,14 +66,16 @@ static void libinputLog(libinput*, libinput_log_priority level, const char* fmt,
|
|||
static void libseatEnableSeat(struct libseat* seat, void* data) {
|
||||
auto PSESSION = (Aquamarine::CSession*)data;
|
||||
PSESSION->active = true;
|
||||
libinput_resume(PSESSION->libinputHandle);
|
||||
if (PSESSION->libinputHandle)
|
||||
libinput_resume(PSESSION->libinputHandle);
|
||||
PSESSION->events.changeActive.emit();
|
||||
}
|
||||
|
||||
static void libseatDisableSeat(struct libseat* seat, void* data) {
|
||||
auto PSESSION = (Aquamarine::CSession*)data;
|
||||
PSESSION->active = false;
|
||||
libinput_suspend(PSESSION->libinputHandle);
|
||||
if (PSESSION->libinputHandle)
|
||||
libinput_suspend(PSESSION->libinputHandle);
|
||||
PSESSION->events.changeActive.emit();
|
||||
libseat_disable_seat(PSESSION->libseatHandle);
|
||||
}
|
||||
|
@ -269,6 +271,9 @@ void Aquamarine::CSession::onReady() {
|
|||
}
|
||||
|
||||
void Aquamarine::CSession::dispatchUdevEvents() {
|
||||
if (!udevHandle || !udevMonitor)
|
||||
return;
|
||||
|
||||
auto device = udev_monitor_receive_device(udevMonitor);
|
||||
|
||||
if (!device)
|
||||
|
@ -332,6 +337,9 @@ void Aquamarine::CSession::dispatchUdevEvents() {
|
|||
}
|
||||
|
||||
void Aquamarine::CSession::dispatchLibinputEvents() {
|
||||
if (!libinputHandle)
|
||||
return;
|
||||
|
||||
if (int ret = libinput_dispatch(libinputHandle); ret) {
|
||||
backend->log(AQ_LOG_ERROR, std::format("Couldn't dispatch libinput events: {}", strerror(-ret)));
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue