SUMMARY I am using "Switch to Windows to the Right" and "Switch to Windows to the Left" shortcuts to navigate between opened windows. Also, I am using two screens. When I have a few full screen windows open on each screen, sometimes I want to switch focus between my windows on the right screen to the windows on the left screen. So I use the shortcut "Switch to Windows to the Right", but it will switch to a window on the right desktop that is on the back, not the front window like I expect. Any idea how to fix this ? STEPS TO REPRODUCE 1. Have two screens. On left screen, open one window. On right screen, open two maxized window (we'll call them front and back window). 2. Focus on the window on the left screen. Then use the shortcut to "Switch to Windows to the Right". 3. OBSERVED RESULT The focus goes to the window that is was the back of the right screen (the back windows comes to front) EXPECTED RESULT The focus goes to the window that is already on the front of the right screen SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian 10 KDE Plasma Version: plasmashell 5.14.5 KDE Frameworks Version: Qt Version: ADDITIONAL INFORMATION
This problem happens because kwin traverses the stacking order from bottom to top and assigns a score to each client. A client with the best score will be activated next. The score function works purely in terms of geometry. So, if there are several maximized/fullscreen clients, their geometry will be identical and therefore kwin will pick only the bottom-most client.
Git commit 9102e41e71ce81ea72d6a2575c1b8cedd37087fb by Vlad Zagorodniy. Committed on 31/08/2019 at 10:47. Pushed by vladz into branch 'master'. Traverse the stacking order backwards when switching between windows Summary: In order to pick the next client to activate we traverse the stacking order from bottom to top and assign to each client a score. The client with the best score will be activated next. Function that assigns score bases its decisions purely on geometry. This may backfire if there are couple maximized or fullscreen clients on the screen - we'll activate the bottom-most client. This change toggles direction we traverse the stacking order. If there are several clients with an identical score, then prefer the top-most client, the one that the user most likely sees at the moment. FIXED-IN: 5.17.0 Test Plan: New tests pass. Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D23521 M +1 -0 autotests/integration/CMakeLists.txt A +585 -0 autotests/integration/activation_test.cpp [License: GPL (v2)] M +1 -1 useractions.cpp https://commits.kde.org/kwin/9102e41e71ce81ea72d6a2575c1b8cedd37087fb