internal: Make part of CCompositor::focusWindow a bit easier to read. (#3356)

This commit is contained in:
Dickby 2023-09-19 12:37:30 +02:00 committed by GitHub
parent c50072b108
commit d8d0cd75c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -917,13 +917,11 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow); g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow);
// TODO: implement this better // TODO: implement this better
if (!PLASTWINDOW && pWindow->m_sGroupData.pNextWindow && pWindow->m_sGroupData.pNextWindow != pWindow) { if (!PLASTWINDOW && pWindow->m_sGroupData.pNextWindow) {
auto curr = pWindow; for (auto curr = pWindow->m_sGroupData.pNextWindow; curr != pWindow; curr = curr->m_sGroupData.pNextWindow) {
do {
curr = curr->m_sGroupData.pNextWindow;
if (curr->m_phForeignToplevel) if (curr->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(curr->m_phForeignToplevel, false); wlr_foreign_toplevel_handle_v1_set_activated(curr->m_phForeignToplevel, false);
} while (curr->m_sGroupData.pNextWindow != pWindow); }
} }
if (pWindow->m_phForeignToplevel) if (pWindow->m_phForeignToplevel)