mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-17 01:05:59 +01:00
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
This commit is contained in:
parent
58669fef77
commit
2cf6e7862a
2 changed files with 8 additions and 1 deletions
|
@ -446,6 +446,7 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("dwindle:no_gaps_when_only", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("dwindle:no_gaps_when_only", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("dwindle:use_active_for_splits", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("dwindle:use_active_for_splits", Hyprlang::INT{1});
|
||||||
m_pConfig->addConfigValue("dwindle:default_split_ratio", {1.f});
|
m_pConfig->addConfigValue("dwindle:default_split_ratio", {1.f});
|
||||||
|
m_pConfig->addConfigValue("dwindle:split_bias", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("dwindle:smart_split", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("dwindle:smart_split", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("dwindle:smart_resizing", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("dwindle:smart_resizing", Hyprlang::INT{1});
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#include "DwindleLayout.hpp"
|
#include "DwindleLayout.hpp"
|
||||||
#include "../render/decorations/CHyprGroupBarDecoration.hpp"
|
|
||||||
#include "../Compositor.hpp"
|
#include "../Compositor.hpp"
|
||||||
#include "../config/ConfigValue.hpp"
|
#include "../config/ConfigValue.hpp"
|
||||||
|
#include "../render/decorations/CHyprGroupBarDecoration.hpp"
|
||||||
|
|
||||||
void SDwindleNodeData::recalcSizePosRecursive(bool force, bool horizontalOverride, bool verticalOverride) {
|
void SDwindleNodeData::recalcSizePosRecursive(bool force, bool horizontalOverride, bool verticalOverride) {
|
||||||
if (children[0]) {
|
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
|
// and update the previous parent if it exists
|
||||||
if (OPENINGON->pParent) {
|
if (OPENINGON->pParent) {
|
||||||
if (OPENINGON->pParent->children[0] == OPENINGON) {
|
if (OPENINGON->pParent->children[0] == OPENINGON) {
|
||||||
|
|
Loading…
Reference in a new issue