diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 0e461d8d..d2162de3 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -560,8 +560,10 @@ void findExtensionForVector2D(wlr_surface* surface, int x, int y, void* data) { } CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) { - const auto PMONITOR = getMonitorFromVector(pos); - const auto FOCUS_EXTENT = g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue ? g_pConfigManager->getConfigValuePtr("general:border_size")->intValue : 0; + const auto PMONITOR = getMonitorFromVector(pos); + static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue; + static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; + const auto FOCUS_EXTENT = *PRESIZEONBORDER ? *PBORDERSIZE : 0; // special workspace if (PMONITOR->specialWorkspaceID) { diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index f006a1dc..1ce4532a 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -32,12 +32,14 @@ void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) { } void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { - static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; - 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; - const auto FOCUS_EXTENT = g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue ? g_pConfigManager->getConfigValuePtr("general:border_size")->intValue : 0; + static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; + 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; + static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_borders")->intValue; + static auto* const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; + const auto FOCUS_EXTENT = *PRESIZEONBORDER ? *PBORDERSIZE : 0; m_pFoundSurfaceToFocus = nullptr; m_pFoundLSToFocus = nullptr;