mirror of
https://github.com/hyprwm/hypridle.git
synced 2026-05-07 05:38:02 +02:00
core: guard against dbus logind interface not existing
This commit is contained in:
parent
ecf2a3649d
commit
be173c50be
1 changed files with 5 additions and 0 deletions
|
|
@ -576,6 +576,11 @@ void CHypridle::handleInhibitOnDbusSleep(bool toSleep) {
|
|||
}
|
||||
|
||||
void CHypridle::inhibitSleep() {
|
||||
if (!m_sDBUSState.login) {
|
||||
Debug::log(WARN, "Can't inhibit sleep. Dbus logind interface is not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_sDBUSState.sleepInhibitFd.isValid()) {
|
||||
Debug::log(WARN, "Called inhibitSleep, but previous sleep inhibitor is still active!");
|
||||
m_sDBUSState.sleepInhibitFd.reset();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue