From 319c6a4cfa578da0e2d0e939d368e9ed72ec1180 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 15 Nov 2022 19:12:29 +0000 Subject: [PATCH] activation: Guard against not having any active window If we have no active window we shouldn't call lastUsageSerial. We may as well activate whatever client requested it. --- src/xdgactivationv1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xdgactivationv1.cpp b/src/xdgactivationv1.cpp index 88a42b0206..63ab5240da 100644 --- a/src/xdgactivationv1.cpp +++ b/src/xdgactivationv1.cpp @@ -128,7 +128,7 @@ void XdgActivationV1Integration::activateSurface(SurfaceInterface *surface, cons auto ownerWindow = waylandServer()->findWindow(m_currentActivationToken->surface); qCDebug(KWIN_CORE) << "activating" << window << surface << "on behalf of" << m_currentActivationToken->surface << "into" << ownerWindow; - if (ws->activeWindow() == ownerWindow || ws->activeWindow()->lastUsageSerial() < m_currentActivationToken->serial || m_currentActivationToken->isPrivileged) { + if (!ws->activeWindow() || ws->activeWindow() == ownerWindow || ws->activeWindow()->lastUsageSerial() < m_currentActivationToken->serial || m_currentActivationToken->isPrivileged) { ws->activateWindow(window); } else { qCWarning(KWIN_CORE) << "Activation requested while owner isn't active" << (ownerWindow ? ownerWindow->desktopFileName() : "null")