diff options
| author | Mihail Costea <cmihail@proton.me> | 2026-03-09 18:47:50 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-09 16:47:50 +0000 |
| commit | e172a26b5b6ee9d38107fa648f7b3a9acaca2e54 (patch) | |
| tree | ad180e0752d2c0b47d2f541c392d11fb04502e3f /src/layout | |
| parent | 5cf53f581b8b383fe7b1bf9bb9e28c72394e2e16 (diff) | |
layout: fix drag_threshold window snap regression (rebased for #12890) (#13140)
Guard position assignments in updateDragWindow() behind m_dragThresholdReached
to prevent windows from snapping to cursor before drag_threshold is exceeded.
Fixes: https://github.com/hyprwm/Hyprland/pull/13140
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/supplementary/DragController.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout/supplementary/DragController.cpp b/src/layout/supplementary/DragController.cpp index be70f4ac..4257c913 100644 --- a/src/layout/supplementary/DragController.cpp +++ b/src/layout/supplementary/DragController.cpp @@ -58,15 +58,15 @@ bool CDragStateController::updateDragWindow() { m_draggingTiled = false; m_draggingWindowOriginalFloatSize = DRAGGINGTARGET->lastFloatingSize(); - if (WAS_FULLSCREEN && DRAGGINGTARGET->floating()) { + if (WAS_FULLSCREEN && DRAGGINGTARGET->floating() && m_dragThresholdReached) { const auto MOUSECOORDS = g_pInputManager->getMouseCoordsInternal(); DRAGGINGTARGET->setPositionGlobal(CBox{MOUSECOORDS - DRAGGINGTARGET->position().size() / 2.F, DRAGGINGTARGET->position().size()}); } else if (!DRAGGINGTARGET->floating() && m_dragMode == MBIND_MOVE) { Vector2D MINSIZE = DRAGGINGTARGET->minSize().value_or(Vector2D{MIN_WINDOW_SIZE, MIN_WINDOW_SIZE}); DRAGGINGTARGET->rememberFloatingSize((DRAGGINGTARGET->position().size() * 0.8489).clamp(MINSIZE, Vector2D{}).floor()); - DRAGGINGTARGET->setPositionGlobal(CBox{g_pInputManager->getMouseCoordsInternal() - DRAGGINGTARGET->position().size() / 2.F, DRAGGINGTARGET->position().size()}); if (m_dragThresholdReached) { + DRAGGINGTARGET->setPositionGlobal(CBox{g_pInputManager->getMouseCoordsInternal() - DRAGGINGTARGET->position().size() / 2.F, DRAGGINGTARGET->position().size()}); g_layoutManager->changeFloatingMode(DRAGGINGTARGET); m_draggingTiled = true; } |
