]> Freerunner's - etc_portage_patches.git/commitdiff
add gui-wm/hyprland; add support for resizing the dwindle root node master
authorAndre Ramnitz <andre.ramnitz@mail.de>
Wed, 4 Nov 2026 10:02:04 +0000 (11:02 +0100)
committerAndre Ramnitz <andre.ramnitz@mail.de>
Wed, 4 Nov 2026 10:02:04 +0000 (11:02 +0100)
gui-wm/hyprland/hyprland-0.57.0-dwindle-splitratio-root.patch [new file with mode: 0644]

diff --git a/gui-wm/hyprland/hyprland-0.57.0-dwindle-splitratio-root.patch b/gui-wm/hyprland/hyprland-0.57.0-dwindle-splitratio-root.patch
new file mode 100644 (file)
index 0000000..e913a45
--- /dev/null
@@ -0,0 +1,27 @@
+--- hyprland-source/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp    2026-10-28 11:42:46.000000000 +0100
++++ hyprland-source-b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp  2026-11-04 10:49:14.858877434 +0100
+@@ -755,16 +755,19 @@
+ 
+         auto delta = getPlusMinusKeywordResult(std::string{ratio}, 0.F);
+ 
+-        if (!CURRENT_NODE || !CURRENT_NODE->pParent)
++        // By default, change the focused window's parent split.
++        // With "root", change the outermost split of this workspace.
++        auto targetNode = ARGS[3] == "root" ? getMasterNode() : (CURRENT_NODE ? CURRENT_NODE->pParent.lock() : nullptr);
++
++        if (!targetNode || !targetNode->isNode)
+             return Config::configError("cannot alter split ratio on no / single node", Config::eConfigErrorLevel::WARNING, Config::eConfigErrorCode::INVALID_STATE);
+ 
+         if (!delta)
+             return Config::configError(std::format("failed to parse \"{}\" as a delta", ratio), Config::eConfigErrorLevel::ERROR, Config::eConfigErrorCode::INVALID_ARGUMENT);
+ 
+-        const float newRatio              = exact ? *delta : CURRENT_NODE->pParent->splitRatio + *delta;
+-        CURRENT_NODE->pParent->splitRatio = std::clamp(newRatio, 0.1F, 1.9F);
+-
+-        CURRENT_NODE->pParent->recalcSizePosRecursive();
++        const float newRatio = exact ? *delta : targetNode->splitRatio + *delta;
++        targetNode->splitRatio = std::clamp(newRatio, 0.1F, 1.9F);
++        targetNode->recalcSizePosRecursive();
+     } else
+         return Config::configError(std::format("Unknown dwindle layoutmsg: {}", sv), Config::eConfigErrorLevel::ERROR, Config::eConfigErrorCode::INVALID_ARGUMENT);
+