mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 18:18:03 +02:00
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
This commit is contained in:
parent
895c49a22b
commit
ad4f5f15f3
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue