Bug 482129

Summary: Windows won't take focus on wayland
Product: [Plasma] kwin Reporter: Riku <riku>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED LATER    
Severity: normal Keywords: qt6
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Riku 2024-03-01 09:09:29 UTC
SUMMARY 
On wayland, some programs won't take focus if they were already running.
This happens a lot with programs bound to shortcuts or opening files for example.

STEPS TO REPRODUCE
Run systemsettings and minimize it, then run systemsettings again.
The window isn't raised. It does get highlighted on the taskbar though.

SOFTWARE/OS VERSIONS
Linux: Arch Linux
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION
Kwin version: 6.0.0 (wasn't listed in the form)
Comment 1 Vlad Zahorodnii 2024-03-01 09:15:30 UTC
if an app is launched in konsole, no xdg-activation token is going to be provided so the app will remain in the demand attention state. Something to look into later. I'm not sure that konsole can do anything about it. There probably needs to be a special wrapper to launch apps that also provides an activation token.
Comment 2 Riku 2024-03-01 11:51:28 UTC
(In reply to Vlad Zahorodnii from comment #1)
> Something to look into later.
Hopefully not too much later? While this has been more or less the only major issue I've ran into with plasma 6 on wayland it is extremely frustrating.

So, kwin sees an application wants focus but won't actually do anything because you didn't ask nicely? Is this just yet another case of wayland being stupid and user hostile? And to be clear this is not limited to konsole. It seems to happen with most programs that can only have a single "instance", regardless of how they're launched. I have programs bound to global shortcuts like qalculate or sublime text, just to name a few.

I noticed Bug 479491 also describes a similar problem.