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.
This commit is contained in:
medanisjbara 2026-01-30 13:57:48 +01:00
parent b8fc0def97
commit abfe28f014

View file

@ -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;