diff options
Diffstat (limited to 'src/config/shared/actions/ConfigActions.cpp')
| -rw-r--r-- | src/config/shared/actions/ConfigActions.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/config/shared/actions/ConfigActions.cpp b/src/config/shared/actions/ConfigActions.cpp index 7111afd8..56fb88e9 100644 --- a/src/config/shared/actions/ConfigActions.cpp +++ b/src/config/shared/actions/ConfigActions.cpp @@ -94,7 +94,7 @@ static bool tryMoveFocusToMonitor(PHLMONITOR monitor) { const auto PNEWMAINWORKSPACE = monitor->m_activeWorkspace; const auto PNEWWORKSPACE = monitor->m_activeSpecialWorkspace ? monitor->m_activeSpecialWorkspace : PNEWMAINWORKSPACE; - const auto PNEWWINDOW = PNEWWORKSPACE->getLastFocusedWindow(); + auto PNEWWINDOW = PNEWWORKSPACE->getFocusCandidate(); if (PNEWWINDOW) { updateRelativeCursorCoords(); @@ -931,11 +931,13 @@ ActionResult Actions::changeWorkspace(PHLWORKSPACE ws) { PMONITORWORKSPACEOWNER->changeWorkspace(ws, false, true); if (PMONITOR != PMONITORWORKSPACEOWNER) { - Vector2D middle = PMONITORWORKSPACEOWNER->middle(); - if (const auto PLAST = ws->getLastFocusedWindow(); PLAST) { - Desktop::focusState()->fullWindowFocus(PLAST, Desktop::FOCUS_REASON_KEYBIND); + Vector2D middle = PMONITORWORKSPACEOWNER->middle(); + auto pWindow = ws->getFocusCandidate(); + + if (pWindow) { + Desktop::focusState()->fullWindowFocus(pWindow, Desktop::FOCUS_REASON_KEYBIND); if (*PWORKSPACECENTERON == 1) - middle = PLAST->middle(); + middle = pWindow->middle(); } g_pCompositor->warpCursorTo(middle); } |
