From e7539d2ee8b356169c43f9029035f32d4299afc5 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 6 Nov 2024 17:13:17 +0200 Subject: [PATCH] Client: Avoid activating window on show if Qt::WindowDoesNotAcceptFocus is set The Qt::WindowDoesNotAcceptFocus flag provides one more clue regarding what the user intends to achieve. Technically though, the does not accept focus flag doesn't influence a lot in practice as it's not communicated back to the compositor, but it's still suitable for determining whether the window needs to be activated when it's shown. Change-Id: Idf80c1701966870b4bbe422ecb9c7cb33e3a6bc0 Reviewed-by: David Edmundson --- .../plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index 380c93bc9d1..1fced1af1db 100644 --- a/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/platforms/wayland/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -588,6 +588,10 @@ bool QWaylandXdgSurface::requestActivateOnShow() if (type == Qt::ToolTip || type == Qt::Popup || type == Qt::SplashScreen) return false; + const Qt::WindowFlags flags = m_window->window()->flags(); + if (flags & Qt::WindowDoesNotAcceptFocus) + return false; + if (m_window->window()->property("_q_showWithoutActivating").toBool()) return false;