diff options
author | Kamikadze <[email protected]> | 2024-09-26 04:08:50 +0500 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-26 00:08:50 +0100 |
commit | b1ad2d806634edff656cb5ddc9850ae2c73324e8 (patch) | |
tree | 7877f963bfe0d99cbbb75850d388bb1c9819cab9 | |
parent | 22746b304614b313a78d740f4536e809a4df90e2 (diff) | |
download | Hyprland-b1ad2d806634edff656cb5ddc9850ae2c73324e8.tar.gz Hyprland-b1ad2d806634edff656cb5ddc9850ae2c73324e8.zip |
dispatchers: fixup dpms toggle (#7875)
now toggles every monitor individually
-rw-r--r-- | src/managers/KeybindManager.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 02e2f5e7..48c4517a 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -2403,9 +2403,7 @@ SDispatchResult CKeybindManager::dpms(std::string arg) { bool enable = arg.starts_with("on"); std::string port = ""; - if (arg.starts_with("toggle")) - enable = !std::any_of(g_pCompositor->m_vMonitors.begin(), g_pCompositor->m_vMonitors.end(), [&](const auto& other) { return !other->dpmsStatus; }); // enable if any is off - + bool isToggle = arg.starts_with("toggle"); if (arg.find_first_of(' ') != std::string::npos) port = arg.substr(arg.find_first_of(' ') + 1); @@ -2414,6 +2412,9 @@ SDispatchResult CKeybindManager::dpms(std::string arg) { if (!port.empty() && m->szName != port) continue; + if (isToggle) + enable = !m->dpmsStatus; + m->output->state->resetExplicitFences(); m->output->state->setEnabled(enable); |