https://bugs.kde.org/show_bug.cgi?id=476831
Vlad Zahorodnii <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Latest Commit|https://invent.kde.org/plas |https://invent.kde.org/plas |ma/kwin/-/commit/a9b33800eb |ma/kwin/-/commit/07db8db46d |e5dbd191292addeb87a92772a1e |b5a51e8b987a04d416596b54855 |9ae |6ec --- Comment #7 from Vlad Zahorodnii <[email protected]> --- Git commit 07db8db46db5a51e8b987a04d416596b548556ec by Vlad Zahorodnii. Committed on 27/10/2026 at 08:43. Pushed by vladz into branch 'Plasma/6.8'. keyboard_layout: Keep an application's layout after its last window closes In System Settings -\> Keyboard -\> Keyboard -\> Configure Switching, "Switching layout affects" is set to "All windows of current application". It works for regular applications, and yet in Yakuake (terminal emulator), every time I switch the layout to English while the Yakuake window is open, then switch to some other application and back to Yakuake, Yakuake gets the system default (Slovak) layout back. It works as expected on X11. The cause is that ApplicationPolicy keeps layouts by window and drops the entry when the window closes. Yakuake (with "Keep window open when it loses focus" setting off) hides its window when it lose focus, which on Wayland destroys it so every time it is shown again it is a new window and nothing is there to inherit the layout from. The same happens to any application after its last window is closed. On X11 it was handled by kded keyboard module that kept layouts by window class, so it worked. This change keeps the layout of an application's last window under its desktop file name when the window closes (in m_layoutsRestored) which is already used when an application's first window is activated. Those entries are also saved with the session so the layout also survives logout when the session is restored. How to test it: - added integration test testApplicationPolicyLastWindowClosed (closes an application's last window, opens a new one, and checks the layout comes back, also across a session save and restore), it fails on un-patched KWin and pass with this patch - have at least 2 keyboard layouts set in System Settings, non-English with higher priority, then launch Yakuake, switch to keyboard layout to English, focus another application so Yakuake hides, show Yakuake again - layout stays English - close some application on English layout, log out and back in, open it again - layout would be English - running it on Plasma 6.8.0 (KDE Neon) Related: bug 452445 (cherry picked from commit a9b33800ebe5dbd191292addeb87a92772a1e9ae) Co-authored-by: Marián Kadaňka <[email protected]> M +39 -0 autotests/integration/keyboard_layout_test.cpp M +28 -1 src/keyboard_layout_switching.cpp M +1 -0 src/keyboard_layout_switching.h https://invent.kde.org/plasma/kwin/-/commit/07db8db46db5a51e8b987a04d416596b548556ec -- You are receiving this mail because: You are watching all bug changes.
