From 332fa8a802dd89f16848765cab8a1483e09e73aa Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 20 Mar 2022 13:37:07 +0100 Subject: XWayland floating --- src/layout/DwindleLayout.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/layout/DwindleLayout.cpp') diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 129c2142..9f97cece 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -303,4 +303,12 @@ void CHyprDwindleLayout::onMouseMove(const Vector2D& mousePos) { if (PMONITOR) DRAGGINGWINDOW->m_iMonitorID = PMONITOR->ID; +} + +void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { + const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(pWindow); + const auto PMONITOR = g_pCompositor->getMonitorFromID(pWindow->m_iMonitorID); + + pWindow->m_vRealSize = Vector2D(PWINDOWSURFACE->current.width, PWINDOWSURFACE->current.height); + pWindow->m_vRealPosition = 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); } \ No newline at end of file -- cgit v1.2.3