From 813af393f1b61ecd0105e126681986e58e73ffee Mon Sep 17 00:00:00 2001 From: vaxerski Date: Tue, 2 Jan 2024 14:21:22 +0100 Subject: [PATCH] layout: update rules before applying fullscreen nodes in layouts --- src/Compositor.cpp | 1 - src/layout/DwindleLayout.cpp | 5 ++++- src/layout/MasterLayout.cpp | 3 +++ src/render/decorations/CHyprBorderDecoration.cpp | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 26bd56c4..af03e025 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -2284,7 +2284,6 @@ void CCompositor::setWindowFullscreen(CWindow* pWindow, bool on, eFullscreenMode g_pXWaylandManager->setWindowFullscreen(pWindow, pWindow->shouldSendFullscreenState()); - pWindow->updateDynamicRules(); updateWindowAnimatedDecorationValues(pWindow); // make all windows on the same workspace under the fullscreen window diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 53ddb86e..76b9aeb4 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -780,6 +780,9 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscree pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; + pWindow->updateDynamicRules(); + pWindow->updateWindowDecos(); + g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)}); EMIT_HOOK_EVENT("fullscreen", pWindow); @@ -824,7 +827,7 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscree pWindow->m_vPosition = fakeNode.box.pos(); pWindow->m_vSize = fakeNode.box.size(); - applyNodeDataToWindow(&fakeNode); + applyNodeDataToWindow(&fakeNode, true); } } diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 65f85691..63389c3a 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -883,6 +883,9 @@ void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreen pWindow->m_bIsFullscreen = on; PWORKSPACE->m_bHasFullscreenWindow = !PWORKSPACE->m_bHasFullscreenWindow; + pWindow->updateDynamicRules(); + pWindow->updateWindowDecos(); + g_pEventManager->postEvent(SHyprIPCEvent{"fullscreen", std::to_string((int)on)}); EMIT_HOOK_EVENT("fullscreen", pWindow); diff --git a/src/render/decorations/CHyprBorderDecoration.cpp b/src/render/decorations/CHyprBorderDecoration.cpp index 4e3e824e..77ebdd57 100644 --- a/src/render/decorations/CHyprBorderDecoration.cpp +++ b/src/render/decorations/CHyprBorderDecoration.cpp @@ -104,5 +104,5 @@ std::string CHyprBorderDecoration::getDisplayName() { } bool CHyprBorderDecoration::doesntWantBorders() { - return !m_pWindow->m_sSpecialRenderData.border || m_pWindow->m_bX11DoesntWantBorders; + return !m_pWindow->m_sSpecialRenderData.border || m_pWindow->m_bX11DoesntWantBorders || m_pWindow->getRealBorderSize() == 0; }