Bug 453785 - XDG activation does not work when launching app from overview
Summary: XDG activation does not work when launching app from overview
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-overview (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-14 14:40 UTC by Nicolas Fella
Modified: 2022-05-18 14:41 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: Plasma 5.25 with Frameworks 5.95
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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