fix: a fullscreen bug. (#1821) (#1831)

This commit is contained in:
lisuke 2023-03-21 00:07:18 +08:00 committed by GitHub
parent 22721a37d5
commit dc78c58c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 22 deletions

View file

@ -462,17 +462,14 @@ void CHyprDwindleLayout::recalculateMonitor(const int& monid) {
} }
} }
// Ignore any recalc events if we have a fullscreen window, but process if fullscreen mode 2
if (PWORKSPACE->m_bHasFullscreenWindow) { if (PWORKSPACE->m_bHasFullscreenWindow) {
if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL)
return;
// massive hack from the fullscreen func // massive hack from the fullscreen func
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
if (!PFULLWINDOW) { // ???? if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
PWORKSPACE->m_bHasFullscreenWindow = false; PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
} else { PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
} else if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
SDwindleNodeData fakeNode; SDwindleNodeData fakeNode;
fakeNode.pWindow = PFULLWINDOW; fakeNode.pWindow = PFULLWINDOW;
fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
@ -482,9 +479,9 @@ void CHyprDwindleLayout::recalculateMonitor(const int& monid) {
PFULLWINDOW->m_vSize = fakeNode.size; PFULLWINDOW->m_vSize = fakeNode.size;
applyNodeDataToWindow(&fakeNode); applyNodeDataToWindow(&fakeNode);
return;
} }
return;
} }
const auto TOPNODE = getMasterNodeOnWorkspace(PMONITOR->activeWorkspace); const auto TOPNODE = getMasterNodeOnWorkspace(PMONITOR->activeWorkspace);

View file

@ -203,21 +203,23 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) {
} }
if (PWORKSPACE->m_bHasFullscreenWindow) { if (PWORKSPACE->m_bHasFullscreenWindow) {
if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL)
return;
// massive hack from the fullscreen func // massive hack from the fullscreen func
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID); const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
SMasterNodeData fakeNode; if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
fakeNode.pWindow = PFULLWINDOW; PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft; PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight; } else if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
fakeNode.workspaceID = PWORKSPACE->m_iID; SMasterNodeData fakeNode;
PFULLWINDOW->m_vPosition = fakeNode.position; fakeNode.pWindow = PFULLWINDOW;
PFULLWINDOW->m_vSize = fakeNode.size; fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight;
fakeNode.workspaceID = PWORKSPACE->m_iID;
PFULLWINDOW->m_vPosition = fakeNode.position;
PFULLWINDOW->m_vSize = fakeNode.size;
applyNodeDataToWindow(&fakeNode); applyNodeDataToWindow(&fakeNode);
}
return; return;
} }
@ -258,7 +260,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && !centerMasterWindow) { if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && !centerMasterWindow) {
PMASTERNODE->position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition; PMASTERNODE->position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition;
PMASTERNODE->size = Vector2D(PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x, PMASTERNODE->size = Vector2D(PMONITOR->vecSize.x - PMONITOR->vecReservedTopLeft.x - PMONITOR->vecReservedBottomRight.x,
PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PMONITOR->vecReservedTopLeft.y); PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PMONITOR->vecReservedTopLeft.y);
applyNodeDataToWindow(PMASTERNODE); applyNodeDataToWindow(PMASTERNODE);
return; return;
} else if (orientation == ORIENTATION_LEFT || orientation == ORIENTATION_RIGHT) { } else if (orientation == ORIENTATION_LEFT || orientation == ORIENTATION_RIGHT) {