igor.slepchin at gmail.com
Sat Jul 28 08:12:45 CEST 2012
So I've finally gotten tired of xfce4-xkb-plugin losing its config
(there are quite a few open bugs about this) and decided to take a look
into it. This ended up in some reworking of the way plugin behaves...
The root cause of losing the layout config is X resetting keyboard
configuration to system defaults (normally in /etc/defaults/keyboard)
whenever a new keyboard is detected. xkb-plugin listens to keyboard
config updates from libxklavier and quietly updates its own settings
whenever a config change happens; these new settings are then saved to
.rc file when the panel issues the "save" signal.
Forgetting about xkb-plugin for a moment, somebody needs to reset the
configured keyboard settings whenever X changes them underneath.
xkb-plugin could do that itself but it seems to make more sense to make
xfsettingsd responsible for that since it's always there and xkb-plugin
may or may not be used; besides, xfce4-keyboard-settings already allows
setting up keyboard layouts and xkb-plugin effectively duplicates that.
My changes follow along these lines. Keyboard layout settings are now
fully controlled by xfce4-keyboard-settings; xfsettingsd listens to
system keyboard config changes (through xklavier) and resets them if
necessary (it also takes care to only update the parts of the config it
controls, unlike the old xkb-plugin). The "new" xkb-plugin acts mostly
as just a keyboard layout indicator, i.e., layouts are set up through
xfce4-keyboard-settings only (xkb-plugin still controls changing layout
per window/app atm but it learns about the configured set from xklavier
rather than its own config). I've also made a number of other
fixes/improvements while at it - the commit messages are hopefully
fairly self-explanatory so I won't duplicate them here.
I'd appreciate if you guys could take a look at
https://github.com/igors/xfce4-xkb-plugin and let me if you're ok with
these changes or prefer any of them done differently. And please let me
know if you'd rather have me submit the patches in a different form.
More information about the Xfce4-dev