aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-03-12 13:46:38 +0000
committervaxerski <[email protected]>2023-03-12 13:46:38 +0000
commit146d231ec5ea9059a64e34caeba06e790991e81a (patch)
tree7058bbc08f8073de0360227433ed8907315f3a5f
parent71ef1bde7e45f94ceaab925ae065f32f91510890 (diff)
downloadHyprland-146d231ec5ea9059a64e34caeba06e790991e81a.tar.gz
Hyprland-146d231ec5ea9059a64e34caeba06e790991e81a.zip
config: add key_press_enables_dpms
-rw-r--r--src/config/ConfigManager.cpp1
-rw-r--r--src/managers/input/InputManager.cpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 8361a8f1..cf882b0c 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -71,6 +71,7 @@ void CConfigManager::setDefaultVars() {
configValues["misc:vfr"].intValue = 1;
configValues["misc:vrr"].intValue = 0;
configValues["misc:mouse_move_enables_dpms"].intValue = 0;
+ configValues["misc:key_press_enables_dpms"].intValue = 0;
configValues["misc:always_follow_on_dnd"].intValue = 1;
configValues["misc:layers_hog_keyboard_focus"].intValue = 1;
configValues["misc:animate_manual_resizes"].intValue = 1;
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index bac3b83e..5b59f7f1 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -963,6 +963,12 @@ void CInputManager::onKeyboardKey(wlr_keyboard_key_event* e, SKeyboard* pKeyboar
if (!pKeyboard->enabled)
return;
+ static auto* const PDPMS = &g_pConfigManager->getConfigValuePtr("key_press_enables_dpms")->intValue;
+ if (*PDPMS && g_pCompositor->m_bDPMSStateON) {
+ // enable dpms
+ g_pKeybindManager->dpms("on");
+ }
+
bool passEvent = g_pKeybindManager->onKeyEvent(e, pKeyboard);
wlr_idle_notify_activity(g_pCompositor->m_sWLRIdle, g_pCompositor->m_sSeat.seat);