mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-11-17 02:35:59 +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,6 +66,7 @@ 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;
|
||||
if (PSESSION->libinputHandle)
|
||||
libinput_resume(PSESSION->libinputHandle);
|
||||
PSESSION->events.changeActive.emit();
|
||||
}
|
||||
|
@ -73,6 +74,7 @@ static void libseatEnableSeat(struct libseat* seat, void* data) {
|
|||
static void libseatDisableSeat(struct libseat* seat, void* data) {
|
||||
auto PSESSION = (Aquamarine::CSession*)data;
|
||||
PSESSION->active = false;
|
||||
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