I installed plasma 6.5 beta, and kwin’s window focus behaviour changed in a bad way.
First the set up (what I thought of that might be relevant):
Window activation policy - focus follows mouse
Delay focus - 300ms
click raises window - enabled
raise on hover - disabled
Window placement - under mouse.
The issue:
Mainly in web browsers (both chromium and firefox) : opening a new window opens it under the current window.
Popups/new windows don’t have focus by default. (pinentry-qt6), some don’t appear under mouse (libvirt related windows, gajim’s popup. Actually the common thing between these 2 is GTK + python) .
sometimes krunner (alt+F2) won’t appear, yakuake (F12) doesn’t appear most of the time, and when it does, it’s under the active window.
it’s all a very weird experience, and I’m not sure how to report this as a useful bug report, so starting here… Any information you need, I’ll happily provide.
And all this started the moment I upgraded to the beta.
I fiddled with that because of an issue (unsolved) from 6.4 and previous:
on login, kwallet tries to open using my GPG key, and that launches pinentry-qt6. Pinentry then remains in the foreground, but its focus is stolen by all the restored windows from the previous session. This requires me to wait until all windows appear, before I focus it and enter the passphrase, hoping nothing else will pop up while I’m typing.
setting to “low” makes things work properly. Haven’t tried pinentry on login yet…
And strike the yakuake issue: “never” was actually just under fullscreen windows. All this is a focus issue, apparently…
I’m not surprised then. I implemented proper focus stealing prevention for the Wayland session, and it uncovered a mess of application issues. Most issues that we found are already fixed and waiting for new releases (like in Firefox), but some are still pending (like in Chromium). Focus stealing prevention is “low” by default until we figure out the remaining issues.
Krunner not activating I can’t explain though; that had some issues but I fixed them (with a matching autotest) before the beta. Did you notice any pattern for when it didn’t appear?
I’ve run into this issue with Jetbrains IntelliJ IDEA on Plasma 6.5.2 (using their experimental Wayland support) as well, with focus prevention set to Medium or above – Plasma prevents in-app popups from receiving the focus. With focus prevention set to “Low”, it works as expected.
Should I create a KDE Plasma bug for this, or this something that the Jetbrains folks need to look at?
It’s an application bug, so please report it to Jetbrains. They can’t assume new windows to get focus, they need to use xdg activation to activate windows.
Yeah, but using the protocol wrongly doesn’t really help, even if that happens to work on Gnome. I commented on that issue, hopefully it can be fixed properly.
@Zamundaaa Thank you for commenting / explaining there. Can you also comment on https://youtrack.jetbrains.com/issue/JBR-9645, looking at the last 3 or 4 comments which talk about using the activation protocol for popups? Jetbrains is under the assumption that xdg-activation can only be used for top-level windows (per the spec), and not popups. However with 6.5.2 and Medium focus stealing prevention, popups in IDEA don’t work. If they should be using xdg-activation for popups, they might need to be educated on that. If they shouldn’t, then an alternative solution is needed.