From fff7534721738b49f8338537bde97d1443391dba Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:33:55 +0200 Subject: [PATCH] fullscreen new window on fullscreen movefocus --- src/managers/KeybindManager.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 895e7600..e54b2b88 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -742,9 +742,20 @@ void CKeybindManager::moveFocusTo(std::string args) { g_pCompositor->m_sSeat.mouse->constraintActive = false; auto switchToWindow = [&](CWindow* PWINDOWTOCHANGETO) { - g_pCompositor->focusWindow(PWINDOWTOCHANGETO); - Vector2D middle = PWINDOWTOCHANGETO->m_vRealPosition.goalv() + PWINDOWTOCHANGETO->m_vRealSize.goalv() / 2.f; - g_pCompositor->warpCursorTo(middle); + + if (PLASTWINDOW->m_iWorkspaceID == PWINDOWTOCHANGETO->m_iWorkspaceID && PLASTWINDOW->m_bIsFullscreen) { + const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PLASTWINDOW->m_iWorkspaceID); + const auto FSMODE = PWORKSPACE->m_efFullscreenMode; + g_pCompositor->setWindowFullscreen(PLASTWINDOW, false, FULLSCREEN_FULL); + + g_pCompositor->focusWindow(PWINDOWTOCHANGETO); + + g_pCompositor->setWindowFullscreen(PWINDOWTOCHANGETO, true, FSMODE); + } else { + g_pCompositor->focusWindow(PWINDOWTOCHANGETO); + Vector2D middle = PWINDOWTOCHANGETO->m_vRealPosition.goalv() + PWINDOWTOCHANGETO->m_vRealSize.goalv() / 2.f; + g_pCompositor->warpCursorTo(middle); + } }; if (!g_pCompositor->windowValidMapped(PLASTWINDOW)) {