diff options
| author | Mike Will <myQwil@gmail.com> | 2024-09-27 20:49:40 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-28 01:49:40 +0100 |
| commit | 2cf6e7862a844ad96aa060d63f6774df7e2234a6 (patch) | |
| tree | 79986e652c3fab0da7bc3e5a75be33db84fd580d /src/layout/DwindleLayout.cpp | |
| parent | 58669fef77ac17ea205ce3570f48e17de736111f (diff) | |
dwindle: add config option `split_bias` (#7920)
If `default_split_ratio` is greater than 1.0, `split_bias` will give the
bigger half to a specific window:
0 - positional (default)
1 - current window
2 - opening window
Diffstat (limited to 'src/layout/DwindleLayout.cpp')
| -rw-r--r-- | src/layout/DwindleLayout.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/layout/DwindleLayout.cpp b/src/layout/DwindleLayout.cpp index c936d59c..69b044b4 100644 --- a/src/layout/DwindleLayout.cpp +++ b/src/layout/DwindleLayout.cpp @@ -1,7 +1,7 @@ #include "DwindleLayout.hpp" -#include "../render/decorations/CHyprGroupBarDecoration.hpp" #include "../Compositor.hpp" #include "../config/ConfigValue.hpp" +#include "../render/decorations/CHyprGroupBarDecoration.hpp" void SDwindleNodeData::recalcSizePosRecursive(bool force, bool horizontalOverride, bool verticalOverride) { if (children[0]) { @@ -459,6 +459,12 @@ 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)) + NEWPARENT->splitRatio = 2.f - NEWPARENT->splitRatio; + // and update the previous parent if it exists if (OPENINGON->pParent) { if (OPENINGON->pParent->children[0] == OPENINGON) { |
