From 0147975faf939db389bebaa95e3a12e5e5a8753f Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 23 Apr 2022 14:16:02 +0200 Subject: New animation system --- src/layout/DwindleLayout.cpp | 78 +++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 30 deletions(-) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index e7f4b87a..f5cf454c 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -155,6 +155,9 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode) { } } + PWINDOW->m_vRealSize = PWINDOW->m_vEffectiveSize; + PWINDOW->m_vRealPosition = PWINDOW->m_vEffectivePosition; + g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vEffectiveSize); } @@ -190,8 +193,8 @@ void CHyprDwindleLayout::onWindowCreated(CWindow* pWindow) { applyNodeDataToWindow(PNODE); - pWindow->m_vRealPosition = PNODE->position + PNODE->size / 2.f; - pWindow->m_vRealSize = Vector2D(5, 5); + pWindow->m_vRealPosition.setValue(PNODE->position + PNODE->size / 2.f); + pWindow->m_vRealSize.setValue(Vector2D(5, 5)); return; } @@ -265,8 +268,8 @@ void CHyprDwindleLayout::onWindowCreated(CWindow* pWindow) { applyNodeDataToWindow(OPENINGON); } - pWindow->m_vRealPosition = PNODE->position + PNODE->size / 2.f; - pWindow->m_vRealSize = Vector2D(5,5); + pWindow->m_vRealPosition.setValue(PNODE->position + PNODE->size / 2.f); + pWindow->m_vRealSize.setValue(Vector2D(5,5)); } void CHyprDwindleLayout::onWindowRemoved(CWindow* pWindow) { @@ -364,16 +367,16 @@ void CHyprDwindleLayout::changeWindowFloatingMode(CWindow* pWindow) { if (!PNODE) { // save real pos cuz the func applies the default 5,5 mid - const auto PSAVEDPOS = pWindow->m_vRealPosition; - const auto PSAVEDSIZE = pWindow->m_vRealSize; + const auto PSAVEDPOS = pWindow->m_vRealPosition.vec(); + const auto PSAVEDSIZE = pWindow->m_vRealSize.vec(); // if the window is pseudo, update its size - pWindow->m_vPseudoSize = pWindow->m_vRealSize; + pWindow->m_vPseudoSize = pWindow->m_vRealSize.vec(); onWindowCreated(pWindow); - pWindow->m_vRealPosition = PSAVEDPOS; - pWindow->m_vRealSize = PSAVEDSIZE; + pWindow->m_vRealPosition.setValue(PSAVEDPOS); + pWindow->m_vRealSize.setValue(PSAVEDSIZE); } else { onWindowRemoved(pWindow); @@ -409,8 +412,8 @@ void CHyprDwindleLayout::onBeginDragWindow() { } m_vBeginDragXY = g_pInputManager->getMouseCoordsInternal(); - m_vBeginDragPositionXY = DRAGGINGWINDOW->m_vRealPosition; - m_vBeginDragSizeXY = DRAGGINGWINDOW->m_vRealSize; + m_vBeginDragPositionXY = DRAGGINGWINDOW->m_vRealPosition.vec(); + m_vBeginDragSizeXY = DRAGGINGWINDOW->m_vRealSize.vec(); m_vLastDragXY = m_vBeginDragXY; g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); @@ -445,16 +448,16 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { g_pHyprRenderer->damageWindow(DRAGGINGWINDOW); if (g_pInputManager->dragButton == BTN_LEFT) { - DRAGGINGWINDOW->m_vRealPosition = m_vBeginDragPositionXY + DELTA; - DRAGGINGWINDOW->m_vEffectivePosition = DRAGGINGWINDOW->m_vRealPosition; + DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA); + DRAGGINGWINDOW->m_vEffectivePosition = DRAGGINGWINDOW->m_vRealPosition.vec(); } else { if (DRAGGINGWINDOW->m_bIsFloating) { - DRAGGINGWINDOW->m_vRealSize = m_vBeginDragSizeXY + DELTA; - DRAGGINGWINDOW->m_vRealSize = Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.x, (double)20, (double)999999), std::clamp(DRAGGINGWINDOW->m_vRealSize.y, (double)20, (double)999999)); + DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA); + DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)999999), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)999999))); - DRAGGINGWINDOW->m_vEffectiveSize = DRAGGINGWINDOW->m_vRealSize; + DRAGGINGWINDOW->m_vEffectiveSize = DRAGGINGWINDOW->m_vRealSize.vec(); - g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize); + g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.vec()); } else { // we need to adjust the splitratio @@ -515,7 +518,7 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { } // get middle point - Vector2D middle = DRAGGINGWINDOW->m_vRealPosition + DRAGGINGWINDOW->m_vRealSize / 2.f; + Vector2D middle = DRAGGINGWINDOW->m_vRealPosition.vec() + DRAGGINGWINDOW->m_vRealSize.vec() / 2.f; // and check its monitor const auto PMONITOR = g_pCompositor->getMonitorFromVector(middle); @@ -541,7 +544,7 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { if (desiredGeometry.width <= 0 || desiredGeometry.height <= 0) { const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); pWindow->m_vEffectiveSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height); - pWindow->m_vEffectivePosition = Vector2D(PMONITOR->vecPosition.x + (PMONITOR->vecSize.x - pWindow->m_vRealSize.x) / 2.f, PMONITOR->vecPosition.y + (PMONITOR->vecSize.y - pWindow->m_vRealSize.y) / 2.f); + pWindow->m_vEffectivePosition = Vector2D(PMONITOR->vecPosition.x + (PMONITOR->vecSize.x - pWindow->m_vRealSize.vec().x) / 2.f, PMONITOR->vecPosition.y + (PMONITOR->vecSize.y - pWindow->m_vRealSize.vec().y) / 2.f); } else { // we respect the size. @@ -562,14 +565,17 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { } if (!pWindow->m_bX11DoesntWantBorders) { - pWindow->m_vRealPosition = pWindow->m_vEffectivePosition + pWindow->m_vEffectiveSize / 2.f; - pWindow->m_vRealSize = Vector2D(5, 5); + pWindow->m_vRealPosition.setValue(pWindow->m_vEffectivePosition + pWindow->m_vEffectiveSize / 2.f); + pWindow->m_vRealSize.setValue(Vector2D(5, 5)); } else { - pWindow->m_vRealPosition = pWindow->m_vEffectivePosition; - pWindow->m_vRealSize = pWindow->m_vEffectiveSize; + pWindow->m_vRealPosition.setValue(pWindow->m_vEffectivePosition); + pWindow->m_vRealSize.setValue(pWindow->m_vEffectiveSize); } - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize); + pWindow->m_vRealPosition = pWindow->m_vEffectivePosition; + pWindow->m_vRealSize = pWindow->m_vEffectiveSize; + + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vEffectiveSize); g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); g_pCompositor->moveWindowToTop(pWindow); @@ -602,22 +608,22 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { pWindow->m_vEffectivePosition = pWindow->m_vPosition; pWindow->m_vEffectiveSize = pWindow->m_vSize; - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize); + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.vec()); } } else { // if it now got fullscreen, make it fullscreen // save position and size if floating if (pWindow->m_bIsFloating) { - pWindow->m_vPosition = pWindow->m_vRealPosition; - pWindow->m_vSize = pWindow->m_vRealSize; + pWindow->m_vPosition = pWindow->m_vRealPosition.vec(); + pWindow->m_vSize = pWindow->m_vRealSize.vec(); } // apply new pos and size being monitors' box pWindow->m_vEffectivePosition = PMONITOR->vecPosition; pWindow->m_vEffectiveSize = PMONITOR->vecSize; - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize); + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.vec()); } g_pCompositor->moveWindowToTop(pWindow); @@ -650,14 +656,20 @@ void CHyprDwindleLayout::toggleWindowGroup(CWindow* pWindow) { if (PGROUPPARENT) { // if there is a parent, release it - for (auto& node : PGROUPPARENT->groupMembers) + const auto INACTIVEBORDERCOL = CColor(g_pConfigManager->getInt("general:col.inactive_border")); + for (auto& node : PGROUPPARENT->groupMembers) { node->pGroupParent = nullptr; + node->pWindow->m_cRealBorderColor.setValueAndWarp(INACTIVEBORDERCOL); // no anim here because they pop in + } PGROUPPARENT->groupMembers.clear(); PGROUPPARENT->isGroup = false; PGROUPPARENT->recalcSizePosRecursive(); + + if (g_pCompositor->windowValidMapped(g_pCompositor->m_pLastWindow)) + g_pCompositor->m_pLastWindow->m_cRealBorderColor = CColor(g_pConfigManager->getInt("general:col.active_border")); } else { // if there is no parent, let's make one @@ -675,8 +687,14 @@ void CHyprDwindleLayout::toggleWindowGroup(CWindow* pWindow) { PPARENT->groupMembers = allChildren; - for (auto& c : PPARENT->groupMembers) + const auto GROUPINACTIVEBORDERCOL = CColor(g_pConfigManager->getInt("dwinle:col.group_border")); + for (auto& c : PPARENT->groupMembers) { c->pGroupParent = PPARENT; + c->pWindow->m_cRealBorderColor = GROUPINACTIVEBORDERCOL; + + if (c->pWindow == g_pCompositor->m_pLastWindow) + c->pWindow->m_cRealBorderColor = CColor(g_pConfigManager->getInt("dwindle:col.group_border_active")); + } PPARENT->groupMemberActive = 0; -- cgit v1.2.3 From f84294fe07d3442ca62302de491717ef6355e902 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 23 Apr 2022 14:35:34 +0200 Subject: fixed fullscreen, removed effective vars from windows --- src/layout/DwindleLayout.cpp | 72 ++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 39 deletions(-) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index f5cf454c..aae693a5 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -119,8 +119,8 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode) { PWINDOW->m_vSize = pNode->size; PWINDOW->m_vPosition = pNode->position; - PWINDOW->m_vEffectivePosition = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE); - PWINDOW->m_vEffectiveSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE); + auto calcPos = PWINDOW->m_vPosition + Vector2D(BORDERSIZE, BORDERSIZE); + auto calcSize = PWINDOW->m_vSize - Vector2D(2 * BORDERSIZE, 2 * BORDERSIZE); const auto OFFSETTOPLEFT = Vector2D(DISPLAYLEFT ? GAPSOUT : GAPSIN, DISPLAYTOP ? GAPSOUT : GAPSIN); @@ -128,37 +128,37 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode) { const auto OFFSETBOTTOMRIGHT = Vector2D(DISPLAYRIGHT ? GAPSOUT : GAPSIN, DISPLAYBOTTOM ? GAPSOUT : GAPSIN); - PWINDOW->m_vEffectivePosition = PWINDOW->m_vEffectivePosition + OFFSETTOPLEFT; - PWINDOW->m_vEffectiveSize = PWINDOW->m_vEffectiveSize - OFFSETTOPLEFT - OFFSETBOTTOMRIGHT; + calcPos = calcPos + OFFSETTOPLEFT; + calcSize = calcSize - OFFSETTOPLEFT - OFFSETBOTTOMRIGHT; if (PWINDOW->m_bIsPseudotiled) { // Calculate pseudo float scale = 1; // adjust if doesnt fit - if (PWINDOW->m_vPseudoSize.x > PWINDOW->m_vEffectiveSize.x || PWINDOW->m_vPseudoSize.y > PWINDOW->m_vEffectiveSize.y) { - if (PWINDOW->m_vPseudoSize.x > PWINDOW->m_vEffectiveSize.x) { - scale = PWINDOW->m_vEffectiveSize.x / PWINDOW->m_vPseudoSize.x; + if (PWINDOW->m_vPseudoSize.x > calcSize.x || PWINDOW->m_vPseudoSize.y > calcSize.y) { + if (PWINDOW->m_vPseudoSize.x > calcSize.x) { + scale = calcSize.x / PWINDOW->m_vPseudoSize.x; } - if (PWINDOW->m_vPseudoSize.y * scale > PWINDOW->m_vEffectiveSize.y) { - scale = PWINDOW->m_vEffectiveSize.y / PWINDOW->m_vPseudoSize.y; + if (PWINDOW->m_vPseudoSize.y * scale > calcSize.y) { + scale = calcSize.y / PWINDOW->m_vPseudoSize.y; } - auto DELTA = PWINDOW->m_vEffectiveSize - PWINDOW->m_vPseudoSize * scale; - PWINDOW->m_vEffectiveSize = PWINDOW->m_vPseudoSize * scale; - PWINDOW->m_vEffectivePosition = PWINDOW->m_vEffectivePosition + DELTA / 2.f; // center + auto DELTA = calcSize - PWINDOW->m_vPseudoSize * scale; + calcSize = PWINDOW->m_vPseudoSize * scale; + calcPos = calcPos + DELTA / 2.f; // center } else { - auto DELTA = PWINDOW->m_vEffectiveSize - PWINDOW->m_vPseudoSize; - PWINDOW->m_vEffectivePosition = PWINDOW->m_vEffectivePosition + DELTA / 2.f; // center - PWINDOW->m_vEffectiveSize = PWINDOW->m_vPseudoSize; + auto DELTA = calcSize - PWINDOW->m_vPseudoSize; + calcPos = calcPos + DELTA / 2.f; // center + calcSize = PWINDOW->m_vPseudoSize; } } - PWINDOW->m_vRealSize = PWINDOW->m_vEffectiveSize; - PWINDOW->m_vRealPosition = PWINDOW->m_vEffectivePosition; + PWINDOW->m_vRealSize = calcSize; + PWINDOW->m_vRealPosition = calcPos; - g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vEffectiveSize); + g_pXWaylandManager->setWindowSize(PWINDOW, calcSize); } void CHyprDwindleLayout::onWindowCreated(CWindow* pWindow) { @@ -449,14 +449,11 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { if (g_pInputManager->dragButton == BTN_LEFT) { DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA); - DRAGGINGWINDOW->m_vEffectivePosition = DRAGGINGWINDOW->m_vRealPosition.vec(); } else { if (DRAGGINGWINDOW->m_bIsFloating) { DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA); DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)999999), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)999999))); - DRAGGINGWINDOW->m_vEffectiveSize = DRAGGINGWINDOW->m_vRealSize.vec(); - g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.vec()); } else { // we need to adjust the splitratio @@ -543,12 +540,12 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { if (desiredGeometry.width <= 0 || desiredGeometry.height <= 0) { const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); - pWindow->m_vEffectiveSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height); - pWindow->m_vEffectivePosition = Vector2D(PMONITOR->vecPosition.x + (PMONITOR->vecSize.x - pWindow->m_vRealSize.vec().x) / 2.f, PMONITOR->vecPosition.y + (PMONITOR->vecSize.y - pWindow->m_vRealSize.vec().y) / 2.f); + pWindow->m_vRealSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height); + pWindow->m_vRealPosition = Vector2D(PMONITOR->vecPosition.x + (PMONITOR->vecSize.x - pWindow->m_vRealSize.vec().x) / 2.f, PMONITOR->vecPosition.y + (PMONITOR->vecSize.y - pWindow->m_vRealSize.vec().y) / 2.f); } else { // we respect the size. - pWindow->m_vEffectiveSize = Vector2D(desiredGeometry.width, desiredGeometry.height); + pWindow->m_vRealSize = Vector2D(desiredGeometry.width, desiredGeometry.height); // check if it's on the correct monitor! Vector2D middlePoint = Vector2D(desiredGeometry.x, desiredGeometry.y) + Vector2D(desiredGeometry.width, desiredGeometry.height) / 2.f; @@ -556,26 +553,23 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { // TODO: detect a popup in a more consistent way. if ((g_pCompositor->getMonitorFromVector(middlePoint) && g_pCompositor->getMonitorFromVector(middlePoint)->ID != pWindow->m_iMonitorID) || (desiredGeometry.x == 0 && desiredGeometry.y == 0)) { // if it's not, fall back to the center placement - pWindow->m_vEffectivePosition = PMONITOR->vecPosition + Vector2D((PMONITOR->vecSize.x - desiredGeometry.width) / 2.f, (PMONITOR->vecSize.y - desiredGeometry.height) / 2.f); + pWindow->m_vRealPosition = PMONITOR->vecPosition + Vector2D((PMONITOR->vecSize.x - desiredGeometry.width) / 2.f, (PMONITOR->vecSize.y - desiredGeometry.height) / 2.f); } else { // if it is, we respect where it wants to put itself. // most of these are popups - pWindow->m_vEffectivePosition = Vector2D(desiredGeometry.x, desiredGeometry.y); + pWindow->m_vRealPosition = Vector2D(desiredGeometry.x, desiredGeometry.y); } } if (!pWindow->m_bX11DoesntWantBorders) { - pWindow->m_vRealPosition.setValue(pWindow->m_vEffectivePosition + pWindow->m_vEffectiveSize / 2.f); + pWindow->m_vRealPosition.setValue(pWindow->m_vRealPosition.goalv() + pWindow->m_vRealSize.goalv() / 2.f); pWindow->m_vRealSize.setValue(Vector2D(5, 5)); } else { - pWindow->m_vRealPosition.setValue(pWindow->m_vEffectivePosition); - pWindow->m_vRealSize.setValue(pWindow->m_vEffectiveSize); + pWindow->m_vRealPosition.setValue(pWindow->m_vRealPosition.goalv()); + pWindow->m_vRealSize.setValue(pWindow->m_vRealSize.goalv()); } - pWindow->m_vRealPosition = pWindow->m_vEffectivePosition; - pWindow->m_vRealSize = pWindow->m_vEffectiveSize; - - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vEffectiveSize); + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); g_pCompositor->moveWindowToTop(pWindow); @@ -605,10 +599,10 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { applyNodeDataToWindow(PNODE); else { // get back its' dimensions from position and size - pWindow->m_vEffectivePosition = pWindow->m_vPosition; - pWindow->m_vEffectiveSize = pWindow->m_vSize; + pWindow->m_vRealPosition = pWindow->m_vPosition; + pWindow->m_vRealSize = pWindow->m_vSize; - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.vec()); + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); } } else { // if it now got fullscreen, make it fullscreen @@ -620,10 +614,10 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { } // apply new pos and size being monitors' box - pWindow->m_vEffectivePosition = PMONITOR->vecPosition; - pWindow->m_vEffectiveSize = PMONITOR->vecSize; + pWindow->m_vRealPosition = PMONITOR->vecPosition; + pWindow->m_vRealSize = PMONITOR->vecSize; - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.vec()); + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); } g_pCompositor->moveWindowToTop(pWindow); -- cgit v1.2.3 From 3ebe7d79722c1bdc333b236960ff136ab607a02c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 23 Apr 2022 21:47:16 +0200 Subject: Added bezier curves --- src/layout/DwindleLayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index aae693a5..f54bef7c 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -451,10 +451,10 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA); } else { if (DRAGGINGWINDOW->m_bIsFloating) { - DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA); + DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragSizeXY + DELTA); DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)999999), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)999999))); - g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.vec()); + g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv()); } else { // we need to adjust the splitratio -- cgit v1.2.3 From 8f3b4aa89c99b0148a7ff0cde28ff88eea76c4a6 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 23 Apr 2022 22:11:32 +0200 Subject: oops, small fix --- src/layout/DwindleLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index f54bef7c..a3fdeecb 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -451,7 +451,7 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragPositionXY + DELTA); } else { if (DRAGGINGWINDOW->m_bIsFloating) { - DRAGGINGWINDOW->m_vRealPosition.setValueAndWarp(m_vBeginDragSizeXY + DELTA); + DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(m_vBeginDragSizeXY + DELTA); DRAGGINGWINDOW->m_vRealSize.setValueAndWarp(Vector2D(std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().x, (double)20, (double)999999), std::clamp(DRAGGINGWINDOW->m_vRealSize.vec().y, (double)20, (double)999999))); g_pXWaylandManager->setWindowSize(DRAGGINGWINDOW, DRAGGINGWINDOW->m_vRealSize.goalv()); -- cgit v1.2.3