summaryrefslogtreecommitdiff
path: root/src/layout/MasterLayout.cpp
diff options
context:
space:
mode:
authorhillyu <hillyunews@gmail.com>2023-03-06 00:29:23 +0800
committerGitHub <noreply@github.com>2023-03-05 16:29:23 +0000
commit7ce92f93ad4d975396e273c30ba8e345cca379ee (patch)
treea16036688de38e8258c927bed2467d2dbaebd89e /src/layout/MasterLayout.cpp
parentb03c8970e698312e237fe176ee2654e819c5c202 (diff)
add mfact setting for master layout (#1666)
* add mfact setting for master layout --------- Co-authored-by: Hill <hillyu@live.com>
Diffstat (limited to 'src/layout/MasterLayout.cpp')
-rw-r--r--src/layout/MasterLayout.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/MasterLayout.cpp b/src/layout/MasterLayout.cpp
index 36169f03..f62d1add 100644
--- a/src/layout/MasterLayout.cpp
+++ b/src/layout/MasterLayout.cpp
@@ -84,7 +84,8 @@ void CHyprMasterLayout::onWindowCreatedTiling(CWindow* pWindow) {
static auto* const PNEWISMASTER = &g_pConfigManager->getConfigValuePtr("master:new_is_master")->intValue;
const auto WINDOWSONWORKSPACE = getNodesOnWorkspace(PNODE->workspaceID);
- float lastSplitPercent = 0.5f;
+ static auto* const PMFACT = &g_pConfigManager->getConfigValuePtr("master:mfact")->floatValue;
+ float lastSplitPercent = *PMFACT;
auto OPENINGON = isWindowTiled(g_pCompositor->m_pLastWindow) && g_pCompositor->m_pLastWindow->m_iWorkspaceID == pWindow->m_iWorkspaceID ?
getNodeFromWindow(g_pCompositor->m_pLastWindow) :
@@ -256,7 +257,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) {