From e1e3b122ddae61b91604d3e81390b7042e57505b Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Fri, 20 Jan 2023 15:56:57 +0100 Subject: [PATCH] add option to toggle cursor icons when hovering over border --- src/config/ConfigManager.cpp | 1 + src/managers/input/InputManager.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index d0c7f3ef..1dd9d6cf 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -48,6 +48,7 @@ void CConfigManager::setDefaultVars() { configValues["general:no_cursor_warps"].intValue = 0; configValues["general:resize_on_borders"].intValue = 0; configValues["general:extend_border_grab_area"].intValue = 15; + configValues["general:hover_icon_on_border"].intValue = 1; configValues["general:layout"].strValue = "dwindle"; diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 7a864f26..3995c5b8 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -40,6 +40,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue; static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; static auto* const PBORDERGRABEXTEND = &g_pConfigManager->getConfigValuePtr("general:extend_border_grab_area")->intValue; + static auto* const PRESIZECURSORICON = &g_pConfigManager->getConfigValuePtr("general:hover_icon_on_border")->intValue; const auto BORDER_GRAB_AREA = *PRESIZEONBORDER ? *PBORDERSIZE + *PBORDERGRABEXTEND : 0; m_pFoundSurfaceToFocus = nullptr; @@ -308,8 +309,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { g_pCompositor->focusWindow(pFoundWindow, foundSurface); } - // change cursor icon if hovering over border - if (*PRESIZEONBORDER && !pFoundWindow->m_bIsFullscreen && !g_pKeybindManager->m_bIsMouseBindActive) { + // change cursor icon if hovering over border, skip if mouse bind (resize or move operations) is active + if (*PRESIZEONBORDER && *PRESIZECURSORICON && !pFoundWindow->m_bIsFullscreen && !g_pKeybindManager->m_bIsMouseBindActive) { setCursorIconOnBorder(pFoundWindow); }