fullscreen new window on fullscreen movefocus

This commit is contained in:
vaxerski 2022-08-03 15:33:55 +02:00
parent cd483a7a37
commit fff7534721

View file

@ -742,9 +742,20 @@ void CKeybindManager::moveFocusTo(std::string args) {
g_pCompositor->m_sSeat.mouse->constraintActive = false; g_pCompositor->m_sSeat.mouse->constraintActive = false;
auto switchToWindow = [&](CWindow* PWINDOWTOCHANGETO) { auto switchToWindow = [&](CWindow* PWINDOWTOCHANGETO) {
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); g_pCompositor->focusWindow(PWINDOWTOCHANGETO);
Vector2D middle = PWINDOWTOCHANGETO->m_vRealPosition.goalv() + PWINDOWTOCHANGETO->m_vRealSize.goalv() / 2.f; Vector2D middle = PWINDOWTOCHANGETO->m_vRealPosition.goalv() + PWINDOWTOCHANGETO->m_vRealSize.goalv() / 2.f;
g_pCompositor->warpCursorTo(middle); g_pCompositor->warpCursorTo(middle);
}
}; };
if (!g_pCompositor->windowValidMapped(PLASTWINDOW)) { if (!g_pCompositor->windowValidMapped(PLASTWINDOW)) {