xwayland: deactivate xwayland focus if wayland is focused (#7458)

* xwayland: deactivate xwayland focus if wayland is focused

* xwayland: deactivate last xwayland surface after focusing wayland
This commit is contained in:
trianta 2024-08-25 09:37:03 -05:00 committed by GitHub
parent aac90d9279
commit b672118f92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -43,8 +43,11 @@ void CHyprXWaylandManager::activateSurface(SP<CWLSurfaceResource> pSurface, bool
w->m_pXWaylandSurface->restackToTop();
}
w->m_pXWaylandSurface->activate(activate);
} else
} else {
w->m_pXDGSurface->toplevel->setActive(activate);
if (g_pCompositor->m_pLastFocus && g_pCompositor->m_pLastWindow->m_bIsX11)
activateSurface(g_pCompositor->m_pLastFocus.lock(), false);
}
}
}

View file

@ -897,7 +897,7 @@ void CXWM::activateSurface(SP<CXWaylandSurface> surf, bool activate) {
if ((surf == focusedSurface && activate) || (surf && surf->overrideRedirect))
return;
if (!surf) {
if (!surf || (!activate && g_pCompositor->m_pLastWindow && !g_pCompositor->m_pLastWindow->m_bIsX11)) {
setActiveWindow((uint32_t)XCB_WINDOW_NONE);
focusWindow(nullptr);
} else {