From 7155b4c26606d7681bacb2517b1d19495336c6c3 Mon Sep 17 00:00:00 2001 From: MightyPlaza <123664421+MightyPlaza@users.noreply.github.com> Date: Thu, 17 Aug 2023 08:13:19 +0000 Subject: renderer: Border improvements (#2986) * simplify getting border size modified: src/Window.cpp modified: src/Window.hpp modified: src/layout/DwindleLayout.cpp modified: src/layout/MasterLayout.cpp modified: src/render/decorations/CHyprGroupBarDecoration.cpp * fix border damage and input box modified: src/Window.cpp modified: src/managers/AnimationManager.cpp * add border size in resize_on_border box modified: src/managers/input/InputManager.cpp * simplify border (fixes possible typo) modified: src/Window.cpp * use updateSpecialRenderData() modified: Window.cpp modified: Window.hpp modified: events/Windows.cpp modified: layout/DwindleLayout.cpp modified: layout/IHyprLayout.cpp modified: layout/MasterLayout.cpp modified: render/Renderer.cpp * update window workspace rule data on reload modified: src/config/ConfigManager.cpp * use rounding() modified: src/Window.cpp --- src/managers/input/InputManager.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/managers/input/InputManager.cpp') diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index bee83388..c4490f3c 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1531,14 +1531,16 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) { } static auto* const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue; - static const auto* PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; static const auto* PEXTENDBORDERGRAB = &g_pConfigManager->getConfigValuePtr("general:extend_border_grab_area")->intValue; + const int BORDERSIZE = w->getRealBorderSize(); + // give a small leeway (10 px) for corner icon - const auto CORNER = *PROUNDING + *PBORDERSIZE + 10; + const auto CORNER = *PROUNDING + BORDERSIZE + 10; const auto mouseCoords = getMouseCoordsInternal(); wlr_box box = {w->m_vRealPosition.vec().x, w->m_vRealPosition.vec().y, w->m_vRealSize.vec().x, w->m_vRealSize.vec().y}; eBorderIconDirection direction = BORDERICON_NONE; - wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB, box.y - *PEXTENDBORDERGRAB, box.width + 2 * *PEXTENDBORDERGRAB, box.height + 2 * *PEXTENDBORDERGRAB}; + wlr_box boxFullGrabInput = {box.x - *PEXTENDBORDERGRAB - BORDERSIZE, box.y - *PEXTENDBORDERGRAB - BORDERSIZE, box.width + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE), + box.height + 2 * (*PEXTENDBORDERGRAB + BORDERSIZE)}; if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y) || (!m_lCurrentlyHeldButtons.empty() && !currentlyDraggedWindow)) { direction = BORDERICON_NONE; -- cgit v1.2.3