Skip to content

Commit

Permalink
idle: ignore if inhibit locked
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 18, 2024
1 parent f6dd1ef commit afcef91
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/Hypridle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit afcef91

Please sign in to comment.