summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVlad Zahorodnii <vlad.zahorodnii@kde.org>2023-02-21 18:41:11 +0200
committerVlad Zahorodnii <vlad.zahorodnii@kde.org>2023-02-22 16:55:02 +0200
commit2fa2a5184dcdf54a7868d73418ed141713587969 (patch)
tree609561af3b1d875d905cb0eb2fd903b3a465134a /src
parent45ec1362f8fcb5ade92f4d2d4985b1c24e78c8ba (diff)
downloadqtwayland-2fa2a5184dcdf54a7868d73418ed141713587969.tar.gz
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 <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/client/qwaylandintegration.cpp13
1 files changed, 0 insertions, 13 deletions
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<QWaylandWindow*>(fw->handle()) : nullptr;
- if (w && w->shellSurface())
- w->shellSurface()->requestActivate();
- });
}
QWaylandIntegration::~QWaylandIntegration()