From 491b99c61ea19f2e9048f215eace07e126af890b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 11:24:07 +0200 Subject: handle unmanaged X11 setGeometry --- src/layout/IHyprLayout.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/layout/IHyprLayout.cpp') diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index a7f2facf..73771e41 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -45,7 +45,7 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) { Vector2D middlePoint = Vector2D(desiredGeometry.x, desiredGeometry.y) + Vector2D(desiredGeometry.width, desiredGeometry.height) / 2.f; // TODO: detect a popup in a more consistent way. - if (!g_pCompositor->isPointOnAnyMonitor(middlePoint) || (desiredGeometry.x == 0 && desiredGeometry.y == 0)) { + if ((desiredGeometry.x == 0 && desiredGeometry.y == 0)) { // if it's not, fall back to the center placement pWindow->m_vRealPosition = PMONITOR->vecPosition + Vector2D((PMONITOR->vecSize.x - desiredGeometry.width) / 2.f, (PMONITOR->vecSize.y - desiredGeometry.height) / 2.f); } else { @@ -65,10 +65,12 @@ void IHyprLayout::onWindowCreatedFloating(CWindow* pWindow) { pWindow->m_vRealSize.setValue(pWindow->m_vRealSize.goalv()); } - g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); - g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); + if (pWindow->m_iX11Type != 2) { + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); + g_pCompositor->fixXWaylandWindowsOnWorkspace(PMONITOR->activeWorkspace); - g_pCompositor->moveWindowToTop(pWindow); + g_pCompositor->moveWindowToTop(pWindow); + } } void IHyprLayout::onBeginDragWindow() { -- cgit v1.2.3 From e6872bddf4c78ebaddbc3de2aa073afc948faf6b Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 8 Jul 2022 21:52:52 +0200 Subject: fix minor issues with floating windows and fullscreen --- src/layout/IHyprLayout.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/layout/IHyprLayout.cpp') diff --git a/src/layout/IHyprLayout.cpp b/src/layout/IHyprLayout.cpp index 73771e41..9f258b44 100644 --- a/src/layout/IHyprLayout.cpp +++ b/src/layout/IHyprLayout.cpp @@ -212,9 +212,23 @@ void IHyprLayout::changeWindowFloatingMode(CWindow* pWindow) { // fix pseudo leaving artifacts g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)); } else { + pWindow->m_vSize = pWindow->m_vRealSize.vec(); + pWindow->m_vPosition = pWindow->m_vRealPosition.vec(); + onWindowRemovedTiling(pWindow); g_pCompositor->moveWindowToTop(pWindow); + + const auto POS = pWindow->m_vRealPosition.goalv(); + const auto SIZ = pWindow->m_vRealSize.goalv(); + + pWindow->m_vRealPosition.setValueAndWarp(POS + Vector2D(5, 5)); + pWindow->m_vRealSize.setValueAndWarp(SIZ - Vector2D(10, 10)); + + pWindow->m_vRealPosition = POS; + pWindow->m_vRealSize = SIZ; + + g_pHyprRenderer->damageMonitor(g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID)); } } -- cgit v1.2.3