From 2fa2a5184dcdf54a7868d73418ed141713587969 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 21 Feb 2023 18:41:11 +0200 Subject: Client: Stop requesting activation on every focus object change Currently, windows with xdg-toplevel surface role request window activation every time the focus object changes. It conflicts with the compositor's activation and stacking order policies. For example, when a window is minimized, the compositor will start an animation and move focus to the next window. If that window activates itself, it can be raised in the stack and start covering the minimized window, thus making it look as if no animation is played at all. This activation logic was introduced as part of qt-shell activation model in d89c8920f3b82dd2098971b5a66c4b9c75da5af0. On the other hand, with the introduction of the xdg-activation-v1 protocol, there is a better way to pass input focus, so drop the qt-shell hack in favor of that. Fixes: QTBUG-111377 Pick-to: 6.5 Change-Id: I8ed19f1be17f49fa9748b1cb5fdd0070791d2ecd Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/client/qwaylandintegration.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src') diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index 9ee38118..13bacc9b 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -88,19 +88,6 @@ QWaylandIntegration::QWaylandIntegration() QWaylandWindow::fixedToplevelPositions = !qEnvironmentVariableIsSet("QT_WAYLAND_DISABLE_FIXED_POSITIONS"); - - // ### Not ideal... - // We don't want to use QPlatformWindow::requestActivate here, since that gives a warning - // for most shells. Also, we don't want to put this into the specific shells that can use - // it, since we want to support more than one shell in one client. - // In addition, this will send a new requestActivate when the focus object changes, even if - // the focus window stays the same. - QObject::connect(qApp, &QGuiApplication::focusObjectChanged, qApp, [](){ - QWindow *fw = QGuiApplication::focusWindow(); - auto *w = fw ? static_cast(fw->handle()) : nullptr; - if (w && w->shellSurface()) - w->shellSurface()->requestActivate(); - }); } QWaylandIntegration::~QWaylandIntegration() -- cgit v1.2.1