summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-03 23:15:33 +0100
committervaxerski <43317083+vaxerski@users.noreply.github.com>2023-04-03 23:15:33 +0100
commit23001f6144bd4abb0a5b35558fd55f9cc0df2a6d (patch)
tree266b830c1a2b9113ebdc22f49c8db8749ba363e2 /src/managers/input/InputManager.cpp
parent55d585ce17b63126828071d685871159e8e74b0b (diff)
input: don't overset resize icons on drag
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index ad1093cd..947d8704 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -1462,14 +1462,19 @@ void CInputManager::setCursorIconOnBorder(CWindow* w) {
return;
}
- static auto* const PROUNDING = &g_pConfigManager->getConfigValuePtr("decoration:rounding")->intValue;
- static const auto* PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
+ 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;
// give a small leeway (10 px) for corner icon
- const auto CORNER = *PROUNDING + *PBORDERSIZE + 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;
- if (wlr_box_contains_point(&box, mouseCoords.x, mouseCoords.y)) {
+ const auto CORNER = *PROUNDING + *PBORDERSIZE + 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};
+
+ if (!wlr_box_contains_point(&boxFullGrabInput, mouseCoords.x, mouseCoords.y)) {
+ direction = BORDERICON_NONE;
+ } else if (wlr_box_contains_point(&box, mouseCoords.x, mouseCoords.y)) {
if (!w->isInCurvedCorner(mouseCoords.x, mouseCoords.y)) {
direction = BORDERICON_NONE;
} else {