Bug 482129 - Windows won't take focus on wayland
Summary: Windows won't take focus on wayland
Status: RESOLVED LATER
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-03-01 09:09 UTC by Riku
Modified: 2024-03-01 11:51 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

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