aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlisuke <[email protected]>2023-03-21 00:07:18 +0800
committerGitHub <[email protected]>2023-03-20 16:07:18 +0000
commitdc78c58c77d634f690a6f6f74b54a0c4f17ea5a0 (patch)
treecc70183f66017628c88027ce244b064e023f7ef9
parent22721a37d5f4b9fadbc34cfe58f364e36c2c6712 (diff)
downloadHyprland-dc78c58c77d634f690a6f6f74b54a0c4f17ea5a0.tar.gz
Hyprland-dc78c58c77d634f690a6f6f74b54a0c4f17ea5a0.zip
fix: a fullscreen bug. (#1821) (#1831)
-rw-r--r--src/layout/DwindleLayout.cpp15
-rw-r--r--src/layout/MasterLayout.cpp28
2 files changed, 21 insertions, 22 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 37a7bf81..e05e9a7a 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -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_efFullscreenMode == FULLSCREEN_FULL)
- return;
-
// massive hack from the fullscreen func
const auto PFULLWINDOW = g_pCompositor->getFullscreenWindowOnWorkspace(PWORKSPACE->m_iID);
- if (!PFULLWINDOW) { // ????
- PWORKSPACE->m_bHasFullscreenWindow = false;
- } else {
+ if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
+ PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
+ PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
+ } else if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
SDwindleNodeData fakeNode;
fakeNode.pWindow = PFULLWINDOW;
fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
@@ -482,9 +479,9 @@ void CHyprDwindleLayout::recalculateMonitor(const int& monid) {
PFULLWINDOW->m_vSize = fakeNode.size;
applyNodeDataToWindow(&fakeNode);
-
- return;
}
+
+ return;
}
const auto TOPNODE = getMasterNodeOnWorkspace(PMONITOR->activeWorkspace);
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 929e8271..eebe787e 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -203,21 +203,23 @@ void CHyprMasterLayout::recalculateMonitor(const int& monid) {
}
if (PWORKSPACE->m_bHasFullscreenWindow) {
- if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL)
- return;
-
// 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;
- fakeNode.pWindow = PFULLWINDOW;
- 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;
+ if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_FULL) {
+ PFULLWINDOW->m_vRealPosition = PMONITOR->vecPosition;
+ PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
+ } else if (PWORKSPACE->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 = PWORKSPACE->m_iID;
+ PFULLWINDOW->m_vPosition = fakeNode.position;
+ PFULLWINDOW->m_vSize = fakeNode.size;
- applyNodeDataToWindow(&fakeNode);
+ applyNodeDataToWindow(&fakeNode);
+ }
return;
}
@@ -258,7 +260,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
if (getNodesOnWorkspace(PWORKSPACE->m_iID) < 2 && !centerMasterWindow) {
PMASTERNODE->position = PMONITOR->vecReservedTopLeft + PMONITOR->vecPosition;
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);
return;
} else if (orientation == ORIENTATION_LEFT || orientation == ORIENTATION_RIGHT) {