From 575bfa40e5db57944e7d38e8561c17270ef9a635 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Mon, 22 Aug 2022 18:22:26 +0200 Subject: added misc:float_switch_override_focus --- src/config/ConfigManager.cpp | 1 + src/managers/input/InputManager.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b20e27c6..cb719419 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -131,6 +131,7 @@ void CConfigManager::setDefaultVars() { configValues["input:natural_scroll"].intValue = 0; configValues["input:numlock_by_default"].intValue = 0; configValues["input:force_no_accel"].intValue = 0; + configValues["input:float_switch_override_focus"].intValue = 1; configValues["input:touchpad:natural_scroll"].intValue = 0; configValues["input:touchpad:disable_while_typing"].intValue = 1; configValues["input:touchpad:clickfinger_behavior"].intValue = 0; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 43a1b5a5..81e16550 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -32,6 +32,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { static auto *const PMOUSEDPMS = &g_pConfigManager->getConfigValuePtr("misc:mouse_move_enables_dpms")->intValue; static auto *const PFOLLOWONDND = &g_pConfigManager->getConfigValuePtr("misc:always_follow_on_dnd")->intValue; static auto *const PHOGFOCUS = &g_pConfigManager->getConfigValuePtr("misc:layers_hog_keyboard_focus")->intValue; + static auto *const PFLOATBEHAVIOR = &g_pConfigManager->getConfigValuePtr("input:float_switch_override_focus")->intValue; if (!g_pCompositor->m_bReadyToProcess) return; @@ -248,7 +249,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { if (pFoundWindow) { if (*PFOLLOWMOUSE != 1 && !refocus) { - if (pFoundWindow != g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && (g_pCompositor->m_pLastWindow->m_bIsFloating != pFoundWindow->m_bIsFloating)) { + if (pFoundWindow != g_pCompositor->m_pLastWindow && g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow) && g_pCompositor->m_pLastWindow->m_bIsFloating != pFoundWindow->m_bIsFloating && *PFLOATBEHAVIOR) { // enter if change floating style if (*PFOLLOWMOUSE != 3 && allowKeyboardRefocus) g_pCompositor->focusWindow(pFoundWindow, foundSurface); -- cgit v1.2.3