Created attachment 166205 [details] keyboardlayout-focus.patch SUMMARY When Keyboard Layout widget is on the panel, it steals focus from the current app on layout change. Both by hotkey or mouse click. STEPS TO REPRODUCE 1. Add "Keyboard Layout" widget on the panel. 2. Focus a text field in any app. 3. Switch layout. OBSERVED RESULT Widget (panel) steals focus from the app. EXPECTED RESULT Focues should remain in the current app / text field. 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 I actually managed to workaround it by editing 'main.qml' file of the applet. Removing 'onLayoutChanged' function fixes the issue. The patch is attached. I don't know why this function exists and why such widget ever need to "activate" itself on layout change, but for me it works just fine without it.
Thanks, is it regression since Plasma 5? About the onLayoutChanged(), it's used for "push in" effect for the applet to make the layout change more noticeable. Either way, we need to find out if it's a regression or not.
(In reply to Andrey from comment #1) > Thanks, is it regression since Plasma 5? Yeah, it was fine in Plasma 5. So it is kind of a regression. Although, as I see from the commit history, the function was there for years. So it is not a direct regression in the applet.
OK, so it's more fundamental problem then which can explode in many places. Not sure if it's KWin or some Qt/Framework guilty.
I recall someone reported about OSD steal focus, it might be the same problem.
I also suspected OSD initially, but disabling it changed nothing. And focus visibly appears on the panel, so I narrowed it down to the applet itself. Btw, the problem only appears on a standalone widget. It does not do that as a System Tray built-in. Forgot to mention, I reproduce it in Wayland session, not tested in X.
Could you check if volume OSD produces the same effect? Maybe test with standalone widget too, if possible.
I don't see any issues with the volume widget or volume OSD.
Can trivially reproduce the issue. It's a regression in Plasma 6 caused by Panel focus changes. I suspect it'll end being a similar issue to Bug 479084.
Can confirm this issue, I tried to disable OSD but it still happens. The attached patch with removing onLayoutChanged did help in resolving it. Although Wayland and X11 seem to behave differently with this function present. On Wayland I clearly see that focus gets taken away on layout switch, but on X11 everything works fine at first but after some time I can't focus in any window anymore and focus disappears right after I click on a window, maybe it happens after I switch layout several times or open several windows at once, couldn't pinpoint the exact moment. SOFTWARE/OS VERSIONS Linux: Endeavour OS KDE Plasma Version: 6.0.1 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel: 6.7.8-arch1-1 (64-bit) Graphics Platform: Wayland and X11
*** This bug has been marked as a duplicate of bug 482653 ***
Why closed as duplicate? This report was created way earlier. Shouldn't it be vice versa?
Probably should be, yeah, but what's done is done, sorry.
*** This bug has been marked as a duplicate of bug 479084 ***