Version: (using KDE KDE 3.3.0) Installed from: Gentoo Packages layout switching work great for a while. I can click on the system tray button to switch between qwerty and dvorak. After a while it stops working. clicking the button changes it to indicate "err", and the layout does not change. I can make it start working again by changing the keyboard layout configuration. I note that KXKBApp::precompileLayouts is caching some information in /tmp/. I can provoke identical symptoms by manually deleting /tmp/kde-toby/dvorak.xkm. I suspect this file is getting deleted after a while as part of normal /tmp/ maintenance.
Created attachment 7417 [details] patch to kxkb.cpp to recover gracefully if precompiled layout cache file does not work Patch to change the behaviour for setting layouts. If using a precompiled layout fails for any reason, it falls back to using the original method as if there are no precompiled layouts. It then updates the precompiled layout file ready for next time. This certainly fixes the symptoms if I manually delete the cache files from /tmp/..... I will report back in a few weeks whether it fixes the original symptoms too. Thinking aloud: Does it make sense to still precompute all layouts? or would it be better to use this same mechanism to store them lazily on first use?
This patch is working great so far
thanks for the patch, I've applied it with some tweaks so kxkb now also have lazy layouts compilation