Bug 509990

Summary: With focus stealing prevention set to "Medium", some newly spawned windows don't get focus anymore
Product: [Plasma] kwin Reporter: Jonas Rakebrandt <xarblu>
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: CONFIRMED ---    
Severity: minor CC: akselmo, nate, xaver.hugl
Priority: NOR Keywords: regression
Version First Reported In: 6.4.90   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Jonas Rakebrandt 2025-09-27 10:16:02 UTC
SUMMARY
Some windows stopped being focussed/raised after upgrading to 6.4.90 (in 6.4.5 this still worked without any change in settings).
I personally can consistently reproduce this with polkit dialogs (example seen here: https://youtu.be/5Y8XCpnnUl0) and when launching Vesktop from the application launcher.
Focus stealing prevention is set to "medium" which - as far as I know - should automatically raise those windows when they're spawned.

STEPS TO REPRODUCE
1. In a terminal execute `pkexec echo`

OBSERVED RESULT
The polkit dialog appears in the task manager but the window is not raised.


EXPECTED RESULT
The window should be raised (at least on "medium" focus stealing prevention).


SOFTWARE/OS VERSIONS
Operating System: Gentoo 2.18
KDE Plasma Version: 6.4.90
KDE Frameworks Version: 6.18.0
Qt Version: 6.10.0
Kernel Version: 6.17.0-rc7-cachyos (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 7950X3D 16-Core Processor
Memory: 64 GiB of RAM (62.5 GiB usable)
Graphics Processor: Intel® Arc
Manufacturer: ASUS

ADDITIONAL INFORMATION
- I'm currently running the Qt 6.10.0 RC but the same issue existed with 6.9.2
- The system I'm using is compiled with LLVM (and their libc++)
Comment 1 Akseli Lahtinen 2025-09-29 11:40:48 UTC
I am unable to repro this

Operating System: Fedora Linux 42
KDE Plasma Version: 6.5.80
KDE Frameworks Version: 6.19.0
Qt Version: 6.9.2
Kernel Version: 6.16.8-200.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600
Comment 2 Akseli Lahtinen 2025-09-29 11:41:38 UTC
Oh nevermind I'm dumb. I had the prevention set to "low" instead of "medium"

Can confirm after all.
Comment 3 Nate Graham 2025-09-29 21:57:11 UTC
The default is Low. Can confirm the issue with it set to Medium.
Comment 4 Zamundaaa 2025-10-02 11:26:56 UTC
> In a terminal
That's expected, see https://invent.kde.org/plasma/kwin/-/issues/290

About Vesktop, that means it's neither activating itself nor setting the app id properly (we have a heuristic for activation if the app id matches the app you started).
The former issue is a Chromium / Electron thing, which is being fixed upstream, the latter is something Vesktop needs to fix, so please report that to the app.
Comment 5 Jonas Rakebrandt 2025-10-02 12:39:09 UTC
> That's expected, see https://invent.kde.org/plasma/kwin/-/issues/290
Hmm interesting - I just noticed the behaviour change compared to 6.4 where things like those polkit dialogs would just get raised anyway.
Might just go back to "low" focus stealing prevention then.

> we have a heuristic for activation if the app id matches the app you started
Thanks for the pointer - that seems to be the issue. Although it's more likely Gentoo packaging a bad .desktop file that doesn't match the ID Vesktop sets.