From f7fb7e7e49e3b47f9b72c55fbf2d093e1a7981f5 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 21 Jul 2024 17:27:15 +0200 Subject: [PATCH] xwayland: avoid unfocusing on OR child focuses fixes #6698 --- src/xwayland/XWM.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp index b55df7fc..0eaa16be 100644 --- a/src/xwayland/XWM.cpp +++ b/src/xwayland/XWM.cpp @@ -398,10 +398,10 @@ void CXWM::focusWindow(SP surf) { focusedSurface = surf; - // send state to all surfaces, sometimes we might lose some + // send state to all toplevel surfaces, sometimes we might lose some // that could still stick with the focused atom for (auto& s : mappedSurfaces) { - if (!s) + if (!s || s->overrideRedirect) continue; sendState(s.lock()); @@ -879,7 +879,7 @@ void CXWM::activateSurface(SP surf, bool activate) { if ((surf == focusedSurface && activate) || (surf && surf->overrideRedirect)) return; - if (!activate || !surf) { + if (!surf || (!activate || !surf->overrideRedirect /* if we are focusing on an OR child, don't unfocus parent */)) { setActiveWindow((uint32_t)XCB_WINDOW_NONE); focusWindow(nullptr); } else {