diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index 7b694d48..06ea0fa5 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -603,6 +603,12 @@ void CMonitor::changeWorkspace(CWorkspace* const pWorkspace, bool internal, bool g_pConfigManager->ensureVRR(this); g_pCompositor->updateSuspendedStates(); + + if (specialWorkspaceID) { + const auto PSPECIALWS = g_pCompositor->getWorkspaceByID(specialWorkspaceID); + if (PSPECIALWS->m_bHasFullscreenWindow) + g_pCompositor->updateFullscreenFadeOnWorkspace(PSPECIALWS); + } } void CMonitor::changeWorkspace(const int& id, bool internal, bool noMouseMove, bool noFocus) { @@ -649,6 +655,10 @@ void CMonitor::setSpecialWorkspace(CWorkspace* const pWorkspace) { PMONITORWORKSPACEOWNER->specialWorkspaceID = 0; g_pLayoutManager->getCurrentLayout()->recalculateMonitor(PMONITORWORKSPACEOWNER->ID); g_pEventManager->postEvent(SHyprIPCEvent{"activespecial", "," + PMONITORWORKSPACEOWNER->szName}); + + const auto PACTIVEWORKSPACE = g_pCompositor->getWorkspaceByID(PMONITORWORKSPACEOWNER->activeWorkspace); + g_pCompositor->updateFullscreenFadeOnWorkspace(PACTIVEWORKSPACE); + animate = false; } diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 02a3dfbe..2f66482a 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -549,6 +549,27 @@ void CHyprDwindleLayout::recalculateMonitor(const int& monid) { g_pHyprRenderer->damageMonitor(PMONITOR); if (PMONITOR->specialWorkspaceID) { + const auto PSPECIALWS = g_pCompositor->getWorkspaceByID(PMONITOR->specialWorkspaceID); + + if (PSPECIALWS->m_bHasFullscreenWindow) { + const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PSPECIALWS->m_iID); + + if (PSPECIALWS->m_efFullscreenMode == FULLSCREEN_FULL) { + PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition; + PFULLWINDOW->m_vRealSize = PMONITOR->vecSize; + } else if (PSPECIALWS->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) { + SDwindleNodeData fakeNode; + fakeNode.pWindow = PFULLWINDOW; + fakeNode.box = {PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft, PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight}; + fakeNode.workspaceID = PSPECIALWS->m_iID; + PFULLWINDOW->m_vPosition = fakeNode.box.pos(); + PFULLWINDOW->m_vSize = fakeNode.box.size(); + fakeNode.ignoreFullscreenChecks = true; + + applyNodeDataToWindow(&fakeNode); + } + } + const auto TOPNODE = getMasterNodeOnWorkspace(PMONITOR->specialWorkspaceID); if (TOPNODE && PMONITOR) { diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp index 4cff8bed..d266d816 100644 --- a/src/layout/MasterLayout.cpp +++ b/src/layout/MasterLayout.cpp @@ -296,6 +296,28 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) { g_pHyprRenderer->damageMonitor(PMONITOR); if (PMONITOR->specialWorkspaceID) { + const auto PSPECIALWS = g_pCompositor->getWorkspaceByID(PMONITOR->specialWorkspaceID); + + if (PSPECIALWS->m_bHasFullscreenWindow) { + const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PSPECIALWS->m_iID); + + if (PSPECIALWS->m_efFullscreenMode == FULLSCREEN_FULL) { + PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition; + PFULLWINDOW->m_vRealSize = PMONITOR->vecSize; + } else if (PSPECIALWS->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) { + SMasterNodeData fakeNode; + fakeNode.pWindow = PFULLWINDOW; + fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; + fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight; + fakeNode.workspaceID = PSPECIALWS->m_iID; + PFULLWINDOW->m_vPosition = fakeNode.position; + PFULLWINDOW->m_vSize = fakeNode.size; + fakeNode.ignoreFullscreenChecks = true; + + applyNodeDataToWindow(&fakeNode); + } + } + calculateWorkspace(PMONITOR->specialWorkspaceID); }