From daeb0d341882f221029d1f608516a7fca7decfa7 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 16 Aug 2022 16:30:10 +0200 Subject: [PATCH] force sending size on setWindowFullscreen --- src/Compositor.cpp | 3 +++ src/managers/XWaylandManager.cpp | 4 ++-- src/managers/XWaylandManager.hpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 7c6566b7..5d6d65ec 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1391,11 +1391,14 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode g_pLayoutManager->getCurrentLayout()->fullscreenRequestForWindow(pWindow, mode, on); g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->m_bIsFullscreen && mode == FULLSCREEN_FULL); + // make all windows on the same workspace under the fullscreen window for (auto& w : g_pCompositor->m_vWindows) { if (w->m_iWorkspaceID == pWindow->m_iWorkspaceID) w->m_bCreatedOverFullscreen = false; } + + g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv(), true); } void CCompositor::moveUnmanagedX11ToWindows(CWindow* pWindow) { diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index cf8c224e..962fea03 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -120,9 +120,9 @@ void CHyprXWaylandManager::sendCloseWindow(CWindow* pWindow) { } } -void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size) { +void CHyprXWaylandManager::setWindowSize(CWindow* pWindow, const Vector2D& size, bool force) { - if ((pWindow->m_vReportedSize == size && pWindow->m_vRealPosition.vec() == pWindow->m_vReportedPosition) || (pWindow->m_vReportedSize == size && !pWindow->m_bIsX11)) + if (!force && ((pWindow->m_vReportedSize == size && pWindow->m_vRealPosition.vec() == pWindow->m_vReportedPosition) || (pWindow->m_vReportedSize == size && !pWindow->m_bIsX11))) return; pWindow->m_vReportedPosition = pWindow->m_vRealPosition.vec(); diff --git a/src/managers/XWaylandManager.hpp b/src/managers/XWaylandManager.hpp index 3d8f57f2..6ac1ffde 100644 --- a/src/managers/XWaylandManager.hpp +++ b/src/managers/XWaylandManager.hpp @@ -17,7 +17,7 @@ public: std::string getTitle(CWindow*); std::string getAppIDClass(CWindow*); void sendCloseWindow(CWindow*); - void setWindowSize(CWindow*, const Vector2D&); + void setWindowSize(CWindow*, const Vector2D&, bool force = false); void setWindowStyleTiled(CWindow*, uint32_t); void setWindowFullscreen(CWindow*, bool); wlr_surface* surfaceAt(CWindow*, const Vector2D&, Vector2D&);