From abfe28f0143e03518ddcf1927765ea38472443b1 Mon Sep 17 00:00:00 2001 From: medanisjbara Date: Fri, 30 Jan 2026 13:57:48 +0100 Subject: [PATCH] managers: fix movefocus wrapping with reserved areas/gaps The movefocus dispatcher used the raw monitor logical box to calculate the "inverse edge" for wrapping. After the reserved area refactor, windows are strictly confined to the work area. When a bar or gaps are present, the search box spawned at the monitor edge would land in a "dead zone" (reserved space), failing to hit the window on the opposite side. This switches the dispatcher to use the layout's workAreaOnWorkspace, ensuring the wrapping search box aligns with the actual window boundaries. --- src/managers/KeybindManager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 74da3572b..3997bb333 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1538,7 +1538,12 @@ SDispatchResult CKeybindManager::moveFocusTo(std::string args) { } else if (STICKS(PLASTWINDOW->m_position.y, PMONITOR->m_position.y) && STICKS(PLASTWINDOW->m_size.y, PMONITOR->m_size.y)) return {.success = false, .error = "move does not make sense, would return back"}; - CBox box = PMONITOR->logicalBox(); + const auto PWORKSPACE = PLASTWINDOW->m_pWorkspace.lock(); + + CBox box = g_pLayoutManager->getCurrentLayout()->workAreaOnWorkspace(PWORKSPACE); + + if (box.width <= 0 || box.height <= 0) + box = PMONITOR->logicalBox(); switch (arg) { case 'l': box.x += box.w;