idle: ignore if inhibit locked

This commit is contained in:
Vaxry 2024-02-18 14:58:39 +00:00
parent f6dd1ef9d6
commit afcef912d6

View file

@ -258,6 +258,11 @@ static void spawn(const std::string& args) {
void CHypridle::onIdled(SIdleListener* pListener) {
Debug::log(LOG, "Idled: rule {:x}", (uintptr_t)pListener);
if (g_pHypridle->m_iInhibitLocks > 0) {
Debug::log(LOG, "Ignoring, inhibit locks: {}", g_pHypridle->m_iInhibitLocks);
return;
}
if (pListener->onTimeout.empty()) {
Debug::log(LOG, "Ignoring, onTimeout is empty.");
return;
@ -270,6 +275,11 @@ void CHypridle::onIdled(SIdleListener* pListener) {
void CHypridle::onResumed(SIdleListener* pListener) {
Debug::log(LOG, "Resumed: rule {:x}", (uintptr_t)pListener);
if (g_pHypridle->m_iInhibitLocks > 0) {
Debug::log(LOG, "Ignoring, inhibit locks: {}", g_pHypridle->m_iInhibitLocks);
return;
}
if (pListener->onRestore.empty()) {
Debug::log(LOG, "Ignoring, onRestore is empty.");
return;