aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorvaxerski <[email protected]>2023-11-03 12:19:23 +0000
committervaxerski <[email protected]>2023-11-03 12:19:23 +0000
commit0f6e53079864d411aa2de3262ba4c01eeeec4f5b (patch)
treec0a2d620b0a29e2ffa4eba98d8424f693fe707fa
parent88b47dfa833db2d230a2d6e6bbbf92c69afbdc28 (diff)
downloadHyprland-0f6e53079864d411aa2de3262ba4c01eeeec4f5b.tar.gz
Hyprland-0f6e53079864d411aa2de3262ba4c01eeeec4f5b.zip
layout: better storage for no fullscreen checks var
fixes #3731
-rw-r--r--src/layout/DwindleLayout.cpp19
-rw-r--r--src/layout/DwindleLayout.hpp2
-rw-r--r--src/layout/MasterLayout.cpp21
-rw-r--r--src/layout/MasterLayout.hpp13
4 files changed, 31 insertions, 24 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index ef7fc3c8..30568375 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -119,7 +119,7 @@ void CHyprDwindleLayout::applyNodeDataToWindow(SDwindleNodeData* pNode, bool for
// if user specified them in config
const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID));
- if (PWINDOW->m_bIsFullscreen && !force)
+ if (PWINDOW->m_bIsFullscreen && !pNode->ignoreFullscreenChecks)
return;
PWINDOW->updateSpecialRenderData();
@@ -557,14 +557,15 @@ void CHyprDwindleLayout::recalculateMonitor(const int& monid) {
PFULLWINDOW->m_vRealSize = PMONITOR->vecSize;
} else if (PWORKSPACE->m_efFullscreenMode == FULLSCREEN_MAXIMIZED) {
SDwindleNodeData 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, true);
+ 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;
+ fakeNode.ignoreFullscreenChecks = true;
+
+ applyNodeDataToWindow(&fakeNode);
}
return;
diff --git a/src/layout/DwindleLayout.hpp b/src/layout/DwindleLayout.hpp
index 47818536..7db9066f 100644
--- a/src/layout/DwindleLayout.hpp
+++ b/src/layout/DwindleLayout.hpp
@@ -30,6 +30,8 @@ struct SDwindleNodeData {
bool valid = true;
+ bool ignoreFullscreenChecks = false;
+
// For list lookup
bool operator==(const SDwindleNodeData& rhs) const {
return pWindow == rhs.pWindow && workspaceID == rhs.workspaceID && position == rhs.position && size == rhs.size && pParent == rhs.pParent &&
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index b5917eeb..be8da75e 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -566,7 +566,7 @@ void CHyprMasterLayout::calculateWorkspace(const int& ws) {
}
}
-void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode, bool force) {
+void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
CMonitor* PMONITOR = nullptr;
if (g_pCompositor->isWorkspaceSpecial(pNode->workspaceID)) {
@@ -596,7 +596,7 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode, bool force
// if user specified them in config
const auto WORKSPACERULE = g_pConfigManager->getWorkspaceRuleFor(g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID));
- if (PWINDOW->m_bIsFullscreen && !force)
+ if (PWINDOW->m_bIsFullscreen && !pNode->ignoreFullscreenChecks)
return;
PWINDOW->updateSpecialRenderData();
@@ -885,14 +885,15 @@ void CHyprMasterLayout::fullscreenRequestForWindow(CWindow* pWindow, eFullscreen
// To keep consistent with the settings without C+P code
SMasterNodeData fakeNode;
- fakeNode.pWindow = pWindow;
- fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
- fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight;
- fakeNode.workspaceID = pWindow->m_iWorkspaceID;
- pWindow->m_vPosition = fakeNode.position;
- pWindow->m_vSize = fakeNode.size;
-
- applyNodeDataToWindow(&fakeNode, true);
+ fakeNode.pWindow = pWindow;
+ fakeNode.position = PMONITOR->vecPosition + PMONITOR->vecReservedTopLeft;
+ fakeNode.size = PMONITOR->vecSize - PMONITOR->vecReservedTopLeft - PMONITOR->vecReservedBottomRight;
+ fakeNode.workspaceID = pWindow->m_iWorkspaceID;
+ pWindow->m_vPosition = fakeNode.position;
+ pWindow->m_vSize = fakeNode.size;
+ fakeNode.ignoreFullscreenChecks = true;
+
+ applyNodeDataToWindow(&fakeNode);
}
}
diff --git a/src/layout/MasterLayout.hpp b/src/layout/MasterLayout.hpp
index f0f72d6b..e316556a 100644
--- a/src/layout/MasterLayout.hpp
+++ b/src/layout/MasterLayout.hpp
@@ -10,8 +10,7 @@
enum eFullscreenMode : int8_t;
//orientation determines which side of the screen the master area resides
-enum eOrientation : uint8_t
-{
+enum eOrientation : uint8_t {
ORIENTATION_LEFT = 0,
ORIENTATION_TOP,
ORIENTATION_RIGHT,
@@ -32,7 +31,10 @@ struct SMasterNodeData {
int workspaceID = -1;
- bool operator==(const SMasterNodeData& rhs) const {
+ bool ignoreFullscreenChecks = false;
+
+ //
+ bool operator==(const SMasterNodeData& rhs) const {
return pWindow == rhs.pWindow;
}
};
@@ -41,7 +43,8 @@ struct SMasterWorkspaceData {
int workspaceID = -1;
eOrientation orientation = ORIENTATION_LEFT;
- bool operator==(const SMasterWorkspaceData& rhs) const {
+ //
+ bool operator==(const SMasterWorkspaceData& rhs) const {
return workspaceID == rhs.workspaceID;
}
};
@@ -76,7 +79,7 @@ class CHyprMasterLayout : public IHyprLayout {
void buildOrientationCycleVectorFromEOperation(std::vector<eOrientation>& cycle);
void runOrientationCycle(SLayoutMessageHeader& header, CVarList* vars, int next);
int getNodesOnWorkspace(const int&);
- void applyNodeDataToWindow(SMasterNodeData*, bool force = false);
+ void applyNodeDataToWindow(SMasterNodeData*);
SMasterNodeData* getNodeFromWindow(CWindow*);
SMasterNodeData* getMasterNodeOnWorkspace(const int&);
SMasterWorkspaceData* getMasterWorkspaceData(const int&);