From 0e083e886f02034c56b851649a6c27f55fe85e32 Mon Sep 17 00:00:00 2001 From: Bastien Souchu Date: Tue, 10 Mar 2026 20:36:47 +0100 Subject: algo/dwindle: fix precise mouse setting (#13678) --- src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/layout/algorithm/tiled') diff --git a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp index 531b54d8..d7eaa61f 100644 --- a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp +++ b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.cpp @@ -34,11 +34,12 @@ struct Layout::Tiled::SDwindleNodeData { void recalcSizePosRecursive(bool force = false, bool horizontalOverride = false, bool verticalOverride = false) { if (children[0]) { - static auto PSMARTSPLIT = CConfigValue("dwindle:smart_split"); - static auto PPRESERVESPLIT = CConfigValue("dwindle:preserve_split"); - static auto PFLMULT = CConfigValue("dwindle:split_width_multiplier"); + static auto PSMARTSPLIT = CConfigValue("dwindle:smart_split"); + static auto PPRESERVESPLIT = CConfigValue("dwindle:preserve_split"); + static auto PFLMULT = CConfigValue("dwindle:split_width_multiplier"); + static auto PPRECISEMOUSEMOVE = CConfigValue("dwindle:precise_mouse_move"); - if (*PPRESERVESPLIT == 0 && *PSMARTSPLIT == 0) + if (*PPRESERVESPLIT == 0 && *PSMARTSPLIT == 0 && *PPRECISEMOUSEMOVE == 0) splitTop = box.h * *PFLMULT > box.w; if (verticalOverride) @@ -159,6 +160,7 @@ void CDwindleAlgorithm::addTarget(SP target) { static auto PERMANENTDIRECTIONOVERRIDE = CConfigValue("dwindle:permanent_direction_override"); static auto PSMARTSPLIT = CConfigValue("dwindle:smart_split"); static auto PSPLITBIAS = CConfigValue("dwindle:split_bias"); + static auto PPRECISEMOUSEMOVE = CConfigValue("dwindle:precise_mouse_move"); bool horizontalOverride = false; bool verticalOverride = false; @@ -184,7 +186,7 @@ void CDwindleAlgorithm::addTarget(SP target) { // whether or not the override persists after opening one window if (*PERMANENTDIRECTIONOVERRIDE == 0) m_overrideDirection = Math::DIRECTION_DEFAULT; - } else if (*PSMARTSPLIT == 1) { + } else if (*PSMARTSPLIT == 1 || (*PPRECISEMOUSEMOVE == 1 && g_layoutManager->dragController()->wasDraggingWindow())) { const auto PARENT_CENTER = NEWPARENT->box.pos() + NEWPARENT->box.size() / 2; const auto PARENT_PROPORTIONS = NEWPARENT->box.h / NEWPARENT->box.w; const auto DELTA = MOUSECOORDS - PARENT_CENTER; -- cgit v1.2.3