From 5ba33f846129f3e6c0505b19f94634b24505e828 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:16:36 +0100 Subject: config/lua: init lua config manager, use lua if available (#13817) Adds a new lua config manager, which will automatically be used if there is a lua config present. --- .../algorithm/tiled/dwindle/DwindleAlgorithm.hpp | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp') diff --git a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp index 043f8738..9216e843 100644 --- a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp +++ b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp @@ -5,7 +5,25 @@ namespace Layout { } namespace Layout::Tiled { - struct SDwindleNodeData; + struct SDwindleNodeData { + WP pParent; + bool isNode = false; + WP pTarget; + std::array, 2> children = {}; + WP self; + bool splitTop = false; // for preserve_split + CBox box = {0}; + float splitRatio = 1.f; + bool valid = true; + bool ignoreFullscreenChecks = false; + + // For list lookup + bool operator==(const SDwindleNodeData& rhs) const { + return pTarget.lock() == rhs.pTarget.lock() && box == rhs.box && pParent == rhs.pParent && children[0] == rhs.children[0] && children[1] == rhs.children[1]; + } + + void recalcSizePosRecursive(bool force = false, bool horizontalOverride = false, bool verticalOverride = false); + }; class CDwindleAlgorithm : public ITiledAlgorithm { public: @@ -27,6 +45,8 @@ namespace Layout::Tiled { virtual void swapTargets(SP a, SP b); virtual void moveTargetInDirection(SP t, Math::eDirection dir, bool silent); + SP getNodeFromWindow(PHLWINDOW w); + private: std::vector> m_dwindleNodesData; @@ -42,7 +62,6 @@ namespace Layout::Tiled { void addTarget(SP target); void calculateWorkspace(); SP getNodeFromTarget(SP); - SP getNodeFromWindow(PHLWINDOW w); int getNodes(); SP getFirstNode(); SP getClosestNode(const Vector2D&, SP skip = nullptr); -- cgit v1.2.3