From a69fd21a1ac90c24cee659595d62329f8638d632 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 31 Oct 2022 12:26:07 +0000 Subject: Add an idleinhibit windowrule --- src/events/Windows.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/events/Windows.cpp') diff --git a/src/events/Windows.cpp b/src/events/Windows.cpp index 07835543..034a1005 100644 --- a/src/events/Windows.cpp +++ b/src/events/Windows.cpp @@ -201,6 +201,20 @@ void Events::listener_mapWindow(void* owner, void* data) { } else if (r.szRule.find("animation") == 0) { auto STYLE = r.szRule.substr(r.szRule.find_first_of(' ') + 1); PWINDOW->m_sAdditionalConfigData.animationStyle = STYLE; + } else if (r.szRule.find("idleinhibit") == 0) { + auto IDLERULE = r.szRule.substr(r.szRule.find_first_of(' ') + 1); + + if (IDLERULE == "none") { + PWINDOW->m_eIdleInhibitMode = IDLEINHIBIT_NONE; + } else if (IDLERULE == "always") { + PWINDOW->m_eIdleInhibitMode = IDLEINHIBIT_ALWAYS; + } else if (IDLERULE == "focus") { + PWINDOW->m_eIdleInhibitMode = IDLEINHIBIT_FOCUS; + } else if (IDLERULE == "fullscreen") { + PWINDOW->m_eIdleInhibitMode = IDLEINHIBIT_FULLSCREEN; + } else { + Debug::log(ERR, "Rule idleinhibit: unknown mode %s", IDLERULE.c_str()); + } } } -- cgit v1.2.3