diff --git a/src/Compositor.cpp b/src/Compositor.cpp index ec70bb68034..f2fcceffda5 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -924,6 +924,16 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) { g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow); + // TODO: implement this better + if (!PLASTWINDOW && pWindow->m_sGroupData.pNextWindow && pWindow->m_sGroupData.pNextWindow != pWindow) { + auto curr = pWindow; + do { + curr = curr->m_sGroupData.pNextWindow; + if (curr->m_phForeignToplevel) + wlr_foreign_toplevel_handle_v1_set_activated(curr->m_phForeignToplevel, false); + } while (curr->m_sGroupData.pNextWindow != pWindow); + } + if (pWindow->m_phForeignToplevel) wlr_foreign_toplevel_handle_v1_set_activated(pWindow->m_phForeignToplevel, true); diff --git a/src/Window.cpp b/src/Window.cpp index 1bd30f22d5e..7350f74c3c6 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -687,7 +687,7 @@ void CWindow::setGroupCurrent(CWindow* pWindow) { g_pCompositor->setWindowFullscreen(PCURRENT, false, WORKSPACE->m_efFullscreenMode); PCURRENT->setHidden(true); - pWindow->setHidden(false); + pWindow->setHidden(false); // can remove m_pLastWindow g_pLayoutManager->getCurrentLayout()->replaceWindowDataWith(PCURRENT, pWindow);