Bug 453785

Summary: XDG activation does not work when launching app from overview
Product: [Plasma] kwin Reporter: Nicolas Fella <nicolas.fella>
Component: effects-overviewAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, nate, postix
Priority: NOR    
Version: master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: Plasma 5.25 with Frameworks 5.95

Description Nicolas Fella 2022-05-14 14:40:07 UTC
STEPS TO REPRODUCE
1. Open an xdg-activation enables single-instance app (e.g. NeoChat) 
2. Open it a second time from the overview effect result list

OBSERVED RESULT
The existing window is not brought to the front

EXPECTED RESULT
The existing window is brought to the front

This works fine when launching e.g. from Kickoff

The lauch happens via KIO::ApplicationLauncherJob, which requests an activation token via KWindowSystem

The problem is that the overview effect runs in the kwin process, which has a custom KWindowSystem backend which does not have the xdg activation part wired up. We need to implement that part of the KWindowSystem API in kwin's impl and have kwin request a token from itself

See https://bugs.kde.org/show_bug.cgi?id=453748 for a similar problem
Comment 1 Nate Graham 2022-05-14 15:07:01 UTC
Can confirm.
Comment 2 Aleix Pol 2022-05-16 17:04:50 UTC
This should address it: https://invent.kde.org/plasma/kwin/-/merge_requests/2404
Comment 3 Nate Graham 2022-05-18 14:33:34 UTC
Git commit 1176f31e0d4735ee56f95e828af161eb0d3120ef by Nate Graham, on behalf of Aleix Pol.
Committed on 18/05/2022 at 13:48.
Pushed by ngraham into branch 'master'.

Support KWindowSystem interface with activation support

Allow internal uses of KWindowSystem to support activating other
clients.
Related: bug 453748

M  +33   -1    src/plugins/windowsystem/windowsystem.cpp
M  +5    -1    src/plugins/windowsystem/windowsystem.h
M  +1    -1    src/wayland_server.cpp
M  +7    -0    src/wayland_server.h
M  +23   -16   src/xdgactivationv1.cpp
M  +3    -1    src/xdgactivationv1.h

https://invent.kde.org/plasma/kwin/commit/1176f31e0d4735ee56f95e828af161eb0d3120ef