summaryrefslogtreecommitdiff
path: root/src/layout/DwindleLayout.cpp
diff options
context:
space:
mode:
authorMike Will <myQwil@gmail.com>2025-08-19 14:32:37 -0400
committerGitHub <noreply@github.com>2025-08-19 19:32:37 +0100
commit10cec2b7e2cd2781121c6ac6b7883cc6f1376d45 (patch)
tree2190f47a57c29c3fefbb6627822a4123e3d5a907 /src/layout/DwindleLayout.cpp
parentd0d728c6a6fada8e8c8bee6a5e2e2f76baeddd12 (diff)
dwindle: simplify split_bias logic and set of possible values. (#11448)
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
-rw-r--r--src/layout/DwindleLayout.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp
index 78ce1f19..513da47b 100644
--- a/src/layout/DwindleLayout.cpp
+++ b/src/layout/DwindleLayout.cpp
@@ -347,6 +347,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir
static auto PFORCESPLIT = CConfigValue<Hyprlang::INT>("dwindle:force_split");
static auto PERMANENTDIRECTIONOVERRIDE = CConfigValue<Hyprlang::INT>("dwindle:permanent_direction_override");
static auto PSMARTSPLIT = CConfigValue<Hyprlang::INT>("dwindle:smart_split");
+ static auto PSPLITBIAS = CConfigValue<Hyprlang::INT>("dwindle:split_bias");
bool horizontalOverride = false;
bool verticalOverride = false;
@@ -427,9 +428,7 @@ void CHyprDwindleLayout::onWindowCreatedTiling(PHLWINDOW pWindow, eDirection dir
}
// split in favor of a specific window
- const auto first = NEWPARENT->children[0];
- static auto PSPLITBIAS = CConfigValue<Hyprlang::INT>("dwindle:split_bias");
- if ((*PSPLITBIAS == 1 && first == PNODE) || (*PSPLITBIAS == 2 && first == OPENINGON))
+ if (*PSPLITBIAS && NEWPARENT->children[0] == PNODE)
NEWPARENT->splitRatio = 2.f - NEWPARENT->splitRatio;
// and update the previous parent if it exists