diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-29 15:44:30 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-05-29 15:44:30 +0200 |
| commit | 9842730f570b118275191fd2b3e8910648ab7b05 (patch) | |
| tree | e7e8d4e410ce41f0c1af00372dc45d0fa5ea09d0 /src/layout/DwindleLayout.cpp | |
| parent | d0ff0c0990db230999cc918f1d6230c4a18d08c8 (diff) | |
Added fullscreen types, maximize and full
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index 8117622c..79c08571 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -620,7 +620,7 @@ void CHyprDwindleLayout::onWindowCreatedFloating(CWindow* pWindow) { g_pCompositor->moveWindowToTop(pWindow); } -void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { +void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreenMode fullscreenMode) { if (!g_pCompositor->windowValidMapped(pWindow)) return; @@ -650,6 +650,8 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { } else { // if it now got fullscreen, make it fullscreen + PWORKSPACE->m_efFullscreenMode = fullscreenMode; + // save position and size if floating if (pWindow->m_bIsFloating) { pWindow->m_vPosition = pWindow->m_vRealPosition.vec(); @@ -657,8 +659,22 @@ void CHyprDwindleLayout::fullscreenRequestForWindow(CWindow* pWindow) { } // apply new pos and size being monitors' box - pWindow->m_vRealPosition = PMONITOR->vecPosition; - pWindow->m_vRealSize = PMONITOR->vecSize; + if (fullscreenMode == FULLSCREEN_FULL) { + pWindow->m_vRealPosition = PMONITOR->vecPosition; + pWindow->m_vRealSize = PMONITOR->vecSize; + } else { + // This is a massive hack. + // We make a fake "only" node and apply + // To keep consistent with the settings without C+P code + + SDwindleNodeData fakeNode; + fakeNode.pWindow = pWindow; + fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; + fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight; + fakeNode.workspaceID = pWindow->m_iWorkspaceID; + + applyNodeDataToWindow(&fakeNode); + } } g_pXWaylandManager->setWindowSize(pWindow, pWindow->m_vRealSize.goalv()); |
