handle fullscreen in dwindle groups better

This commit is contained in:
Vaxry 2022-08-09 18:37:50 +02:00
parent a6d4a4d5f3
commit 862722412f

View file

@ -657,6 +657,11 @@ void CHyprDwindleLayout::toggleWindowGroup(CWindow* pWindow) {
if (!PNODE) if (!PNODE)
return; // reject return; // reject
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PNODE->workspaceID);
if (PWORKSPACE->m_bHasFullscreenWindow)
fullscreenRequestForWindow(g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID), FULLSCREEN_FULL, false);
const auto PGROUPPARENT = PNODE->pGroupParent; const auto PGROUPPARENT = PNODE->pGroupParent;
if (PGROUPPARENT) { if (PGROUPPARENT) {
@ -752,6 +757,8 @@ void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow, bool forward) {
if (!PNODE->pGroupParent) if (!PNODE->pGroupParent)
return; // reject return; // reject
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PNODE->workspaceID);
if (forward) if (forward)
PNODE->pGroupParent->groupMemberActive++; PNODE->pGroupParent->groupMemberActive++;
else else
@ -763,6 +770,13 @@ void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow, bool forward) {
if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size()) if ((long unsigned int)PNODE->pGroupParent->groupMemberActive >= PNODE->pGroupParent->groupMembers.size())
PNODE->pGroupParent->groupMemberActive = 0; PNODE->pGroupParent->groupMemberActive = 0;
bool restoreFullscreen = false;
if (PNODE->pWindow->m_bIsFullscreen) {
fullscreenRequestForWindow(PNODE->pWindow, PWORKSPACE->m_efFullscreenMode, false);
restoreFullscreen = true;
}
PNODE->pGroupParent->recalcSizePosRecursive(); PNODE->pGroupParent->recalcSizePosRecursive();
for (auto& gm : PNODE->pGroupParent->groupMembers) { for (auto& gm : PNODE->pGroupParent->groupMembers) {
@ -773,6 +787,10 @@ void CHyprDwindleLayout::switchGroupWindow(CWindow* pWindow, bool forward) {
// focus // focus
g_pCompositor->focusWindow(PNODE->pGroupParent->groupMembers[PNODE->pGroupParent->groupMemberActive]->pWindow); g_pCompositor->focusWindow(PNODE->pGroupParent->groupMembers[PNODE->pGroupParent->groupMemberActive]->pWindow);
if (restoreFullscreen) {
fullscreenRequestForWindow(PNODE->pGroupParent->groupMembers[PNODE->pGroupParent->groupMemberActive]->pWindow, PWORKSPACE->m_efFullscreenMode, true);
}
} }
SWindowRenderLayoutHints CHyprDwindleLayout::requestRenderHints(CWindow* pWindow) { SWindowRenderLayoutHints CHyprDwindleLayout::requestRenderHints(CWindow* pWindow) {