Bug 88882 - keyboard layout switching fails after a while
Summary: keyboard layout switching fails after a while
Status: RESOLVED FIXED
Alias: None
Product: kxkb
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Andriy Rysin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-05 13:36 UTC by Toby Dickenson
Modified: 2004-10-11 01:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch to kxkb.cpp to recover gracefully if precompiled layout cache file does not work (1.57 KB, patch)
2004-09-05 16:05 UTC, Toby Dickenson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toby Dickenson 2004-09-05 13:36:34 UTC
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.
Comment 1 Toby Dickenson 2004-09-05 16:05:50 UTC
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?
Comment 2 Toby Dickenson 2004-09-21 08:56:56 UTC
This patch is working great so far
Comment 3 Andriy Rysin 2004-10-11 01:37:09 UTC
thanks for the patch, I've applied it with some tweaks so kxkb now also have lazy layouts compilation