From 10cec2b7e2cd2781121c6ac6b7883cc6f1376d45 Mon Sep 17 00:00:00 2001 From: Mike Will Date: Tue, 19 Aug 2025 14:32:37 -0400 Subject: dwindle: simplify split_bias logic and set of possible values. (#11448) --- src/config/ConfigDescriptions.hpp | 4 ++-- src/layout/DwindleLayout.cpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index 23252c91..1b3e412d 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -1827,9 +1827,9 @@ inline static const std::vector CONFIG_OPTIONS = { }, SConfigOptionDescription{ .value = "dwindle:split_bias", - .description = "specifies which window will receive the larger half of a split. positional - 0, current window - 1, opening window - 2 [0/1/2]", + .description = "specifies which window will receive the split ratio. 0 -> directional (the top or left window), 1 -> the current window", .type = CONFIG_OPTION_CHOICE, - .data = SConfigOptionDescription::SChoiceData{0, "positional,current,opening"}, + .data = SConfigOptionDescription::SChoiceData{0, "directional,current"}, }, SConfigOptionDescription{ .value = "dwindle:precise_mouse_move", 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("dwindle:force_split"); static auto PERMANENTDIRECTIONOVERRIDE = CConfigValue("dwindle:permanent_direction_override"); static auto PSMARTSPLIT = CConfigValue("dwindle:smart_split"); + static auto PSPLITBIAS = CConfigValue("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("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 -- cgit v1.2.3