diff options
author | Wren Baxter <[email protected]> | 2023-11-30 20:12:08 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-01 01:12:08 +0000 |
commit | 8440a30231ea41a6b1dacc60a28837b265a6efec (patch) | |
tree | 256617a200ef0f0f10df1752a95f2e28741e67f3 | |
parent | ab40f240c3211412641fdf05b52bf0f1b033fa7d (diff) | |
download | Hyprland-8440a30231ea41a6b1dacc60a28837b265a6efec.tar.gz Hyprland-8440a30231ea41a6b1dacc60a28837b265a6efec.zip |
input: fix overzealous mouse capture on resize_on_border (#4010)
fixes #2456
-rw-r--r-- | src/managers/input/InputManager.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index fe7bb75b..77eabeb7 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -597,6 +597,9 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { const auto PASS = g_pKeybindManager->onMouseEvent(e); static auto* const PFOLLOWMOUSE = &g_pConfigManager->getConfigValuePtr("input:follow_mouse")->intValue; static auto* const PRESIZEONBORDER = &g_pConfigManager->getConfigValuePtr("general:resize_on_border")->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; + const auto BORDER_GRAB_AREA = *PRESIZEONBORDER ? *PBORDERSIZE + *PBORDERGRABEXTEND : 0; if (!PASS && !*PPASSMOUSE) return; @@ -621,7 +624,8 @@ void CInputManager::processMouseDownNormal(wlr_pointer_button_event* e) { if (*PRESIZEONBORDER && !m_bLastFocusOnLS) { if (w && !w->m_bIsFullscreen) { const CBox real = {w->m_vRealPosition.vec().x, w->m_vRealPosition.vec().y, w->m_vRealSize.vec().x, w->m_vRealSize.vec().y}; - if ((!real.containsPoint(mouseCoords) || w->isInCurvedCorner(mouseCoords.x, mouseCoords.y)) && !w->hasPopupAt(mouseCoords)) { + const CBox grab = {real.x - BORDER_GRAB_AREA, real.y - BORDER_GRAB_AREA, real.width + 2 * BORDER_GRAB_AREA, real.height + 2 * BORDER_GRAB_AREA}; + if ((grab.containsPoint(mouseCoords) && (!real.containsPoint(mouseCoords) || w->isInCurvedCorner(mouseCoords.x, mouseCoords.y))) && !w->hasPopupAt(mouseCoords)) { g_pKeybindManager->resizeWithBorder(e); return; } |