One of worst behavior of KWin for me is that the focus of window changes after switching to some desktop then switch back to the original desktop. I expect that the last top window has the focus, but sometimes other window has the focus even if the original top window exists there. Reproducible: Always Steps to Reproduce: 1. Have more than one desktops. 2. Open multiple windows in a desktop. 3. Switch to some desktop. 4. Open/close windows many times. 5. Go back to the original desktop. Then, you can see the top front window loses keyboard focus. Actual Results: The old/original top window sometimes loses focus, but it's painted on the front. Expected Results: The old/original top window has focus after switching back to the desktop. I have written a simple KWin script to fix this problem. I hope this behavior becomes default in future versions. Refer to the script for further details. https://github.com/Mikiya/fixkdewindoworder
Oops. I had a mistake. It's not reproducible always. Several challenges are required.
I have never experienced such behavior and it shouldn't happen. Feel free to test 4.11 which includes a refactored focus chain handling. And yes I spent hours switching desktops and looking that the correct window has focus ;-) Be aware that the focus policy might affect the window which gets selected.
- please attach the output of "qdbus org.kde.kwin /KWin supportInformation" - is a fullscreen (konsole?) window involved? - how do you change the desktop (pager, shortcut, mousewheel etc) - any pattern on which window has the focus?
Created attachment 81800 [details] qdbus org.kde.kwin /KWin supportInformation
Martin, Thank you for your comments. I'll test 4.11. It will come to my distro soon :) Thomas, - please attach the output of "qdbus org.kde.kwin /KWin supportInformation" Yes! Please find it in the Attachments section. - is a fullscreen (konsole?) window involved? No. It happens when only non-fullscreen windows are opened. For example, I open Kopete and Konversation on Desktop 4 and start a new chat using Kopete, then switch to Desktop 5 and spend some time using Chromium browser, finally switch back to Desktop 4 and find that Kopete chat window is placed at the top, but Konversation has focus. - how do you change the desktop (pager, shortcut, mousewheel etc) I usually use a keyboard shortcut assigned to KWin global shortcut. I assign Ctrl+1 to "Switch to Desktop 1" and so forth. And I use "Slide" effect for switching desktops. - any pattern on which window has the focus? No. It's at random. Kind regards, Mikiya
> nextFocusPrefersMouse: true Uncheck that -> still a "problem"?
Hi Thomas, Thank you for your advise. I've changed the setting. The problem has not happened yet. I'll test further and report again. Kind regards, Mikiya
Ok, i'll pre-emptively tag this invalid then. Passing the focus to the window under the mouse after changing the virtual desktop (if there's a window) is intended by this setting (which primarily existst to make FocusFollowsMouse more like FocusUnderMouse) Please re-open the bug as soon as you get "wrong" focus (ie. w/o this setting checked) inb4: 4.11 already has a nicer Focus strategy selection interface ;-)