mirror of
https://github.com/hyprwm/aquamarine.git
synced 2024-12-22 22:59:47 +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) {
|
static void libseatEnableSeat(struct libseat* seat, void* data) {
|
||||||
auto PSESSION = (Aquamarine::CSession*)data;
|
auto PSESSION = (Aquamarine::CSession*)data;
|
||||||
PSESSION->active = true;
|
PSESSION->active = true;
|
||||||
|
if (PSESSION->libinputHandle)
|
||||||
libinput_resume(PSESSION->libinputHandle);
|
libinput_resume(PSESSION->libinputHandle);
|
||||||
PSESSION->events.changeActive.emit();
|
PSESSION->events.changeActive.emit();
|
||||||
}
|
}
|
||||||
|
@ -73,6 +74,7 @@ static void libseatEnableSeat(struct libseat* seat, void* data) {
|
||||||
static void libseatDisableSeat(struct libseat* seat, void* data) {
|
static void libseatDisableSeat(struct libseat* seat, void* data) {
|
||||||
auto PSESSION = (Aquamarine::CSession*)data;
|
auto PSESSION = (Aquamarine::CSession*)data;
|
||||||
PSESSION->active = false;
|
PSESSION->active = false;
|
||||||
|
if (PSESSION->libinputHandle)
|
||||||
libinput_suspend(PSESSION->libinputHandle);
|
libinput_suspend(PSESSION->libinputHandle);
|
||||||
PSESSION->events.changeActive.emit();
|
PSESSION->events.changeActive.emit();
|
||||||
libseat_disable_seat(PSESSION->libseatHandle);
|
libseat_disable_seat(PSESSION->libseatHandle);
|
||||||
|
@ -269,6 +271,9 @@ void Aquamarine::CSession::onReady() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aquamarine::CSession::dispatchUdevEvents() {
|
void Aquamarine::CSession::dispatchUdevEvents() {
|
||||||
|
if (!udevHandle || !udevMonitor)
|
||||||
|
return;
|
||||||
|
|
||||||
auto device = udev_monitor_receive_device(udevMonitor);
|
auto device = udev_monitor_receive_device(udevMonitor);
|
||||||
|
|
||||||
if (!device)
|
if (!device)
|
||||||
|
@ -332,6 +337,9 @@ void Aquamarine::CSession::dispatchUdevEvents() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Aquamarine::CSession::dispatchLibinputEvents() {
|
void Aquamarine::CSession::dispatchLibinputEvents() {
|
||||||
|
if (!libinputHandle)
|
||||||
|
return;
|
||||||
|
|
||||||
if (int ret = libinput_dispatch(libinputHandle); ret) {
|
if (int ret = libinput_dispatch(libinputHandle); ret) {
|
||||||
backend->log(AQ_LOG_ERROR, std::format("Couldn't dispatch libinput events: {}", strerror(-ret)));
|
backend->log(AQ_LOG_ERROR, std::format("Couldn't dispatch libinput events: {}", strerror(-ret)));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue