keyboard layouts plugin forgets all settings at random times

Bug #944468 reported by ElTomoLoco
146
This bug affects 28 people
Affects Status Importance Assigned to Milestone
Linux Mint
New
Undecided
Unassigned
xfce4-xkb-plugin
Unknown
Unknown
xfce4-xkb-plugin (Arch Linux)
New
Undecided
Unassigned
xfce4-xkb-plugin (Debian)
Confirmed
Unknown
xfce4-xkb-plugin (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I added the keyboard layouts plugin to the xfce4 panel and added the Czech QWERTY layout as the second layout after US English. Then I selected Left Win as the layout switcher key. After some time, let's say 40 minutes, the switcher key stops working and when I open the preferences of the keyboard layouts plugin, all the changes I made are gone, only the default preset US English keyboard is on the list and the Left Win switching key setting is also forgotten (not that there would be anything to switch to anymore). The same thing, i.e. all my settings being forgotten, also happens after every computer restart.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: xfce4-xkb-plugin 0.5.4.1-1
ProcVersionSignature: Ubuntu 3.0.0-16.28-generic-pae 3.0.17
Uname: Linux 3.0.0-16-generic-pae i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Fri Mar 2 01:45:06 2012
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: xfce4-xkb-plugin
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
ElTomoLoco (tomaspartl) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfce4-xkb-plugin (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel Richard G. (skunk) wrote :

ElTomoLoco, could you look in your /var/log/syslog file when this problem occurs?

I've run into what is likely the same bug, and it appears to be associated with USB glitches that cause my keyboard to become temporarily disconnected and then re-detected. A typical cycle of this appears as the following in syslog:

Mar 28 21:10:32 waterbridge kernel: [ 8400.176157] hub 5-0:1.0: port 1 disabled by hub (EMI?), re-enabling...
Mar 28 21:10:32 waterbridge kernel: [ 8400.176171] usb 5-1: USB disconnect, device number 5
Mar 28 21:10:32 waterbridge kernel: [ 8400.496143] usb 5-1: new low speed USB device number 6 using uhci_hcd
Mar 28 21:10:32 waterbridge kernel: [ 8400.688248] input: CHESEN USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.0/input/input22
Mar 28 21:10:32 waterbridge kernel: [ 8400.688516] generic-usb 0003:0A81:0101.0008: input,hidraw0: USB HID v1.10 Keyboard [CHESEN USB Keyboard] on usb-0000:00:1d.0-1/input0
Mar 28 21:10:32 waterbridge kernel: [ 8400.717814] input: CHESEN USB Keyboard as /devices/pci0000:00/0000:00:1d.0/usb5/5-1/5-1:1.1/input/input23
Mar 28 21:10:32 waterbridge kernel: [ 8400.717961] generic-usb 0003:0A81:0101.0009: input,hidraw1: USB HID v1.10 Device [CHESEN USB Keyboard] on usb-0000:00:1d.0-1/input1

Note that the keyboard's device number increments by one each time this occurs, as does the last component of the /devices/.../inputNN path. I've attached a copy of the full syslog, so you can see this for yourself.

The bug in xfce4-xkb-plugin, then, is that it forgets its configuration when the keyboard is disconnected [and reconnected].

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

After I had these problems with the xkb panel plugin, I stopped using it and simply made a startup script that called setxkbmap to set the layout options. When I read your post about the keyboard being disconnected and re-detected, I installed the xkb panel plugin again and started testing it. That was yesterday. So far, the only thing I've noticed is that it forgot the "Change Layout Option" after restart but the random forgetting of everything didn't occur yesterday afternoon. I will keep testing it and post the results later. Maybe it has to do with some interaction with some specific applications, such as LibreOffice or whatever. Thank you for taking care of this buggie.

P.S. And yes, I removed the makeshift script from my startup.

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

Okay, I've been using xkb keyboard panel plugin for the last two days and it's now forgetting its settings
only partially. Yesterday, I had three keyboard layouts installed (USA, CZECH qwerty and CZECH extended backslash) and Scroll Lock set as the switch-between key. This morning when I turned the computer on, the last keyboard layout was forgotten and the Scroll Lock switching option as well. /var/log/syslog says nothing about usb or keyboard or any other input device, just some cron stuff.
This bug is really good at hiding!
I'll post more info when I see it again.

Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :

I am experiencing this bug as well.

At first I thought it was after restarts and hibernation, but I can confirm it is not the case. Often, a logout and logging back in makes it work fine.

I am attaching a screenshot that shows that the settings are somehow not picked up properly.

Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :

Regarding Daniel Richard G.'s comment, I have checked syslog, and I could see a USB-related error as well, but it was 30 minutes before the bug hit...

Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :
Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :

I can confirm that the workaround does not work. After hibernation, the layout is back to US English only.

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

Hi!
After some weeks of observations, the bug still persists but it seems to strike less often.
Today, when I turned the computer on, it forgot the layout switching key
and the last of the three keyboard layouts I had set before.
Syslog showed nothing interesting, just three lines about cron:

--- syslog ---
Apr 18 09:24:40 Ponorka rsyslogd: [origin software="rsyslogd" swVersion="5.8.1" x-pid="975" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Apr 18 09:25:13 Ponorka anacron[1182]: Job `cron.daily' terminated
Apr 18 09:25:13 Ponorka anacron[1182]: Normal exit (1 job run)
---------------

"Ponorka" is the name of my computer :)

I am just thinking: where does the keyboard layout plugin store its preferences?
I got the impression from a comment somewhere that it actually reads a X.org config file
and modifies it. Isn't the culprit some component of the X.org system,
which regenerates that config file as a consequence of some completely unrelated
system (possible X.org) event?

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

Hi again!

I tried to catch the little beast, so I made a script to monitor xkb settings and scream
if they change. Well, since I added this script to my startup, the bug never showed -
in other words, the panel plugin works like a charm now.
Perhaps the problem was caused by some other programs (such as X or xfce)
and disappeared with an update but just in case it didn't,
here is the xkb watchdog script you can use to try to hunt the cunning little buxen down.
It barks at every system startup as the panel plugin loads its settings for the first time,
which is okay but if you hear from it at any other time, it's the bug!

Enjoy.

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

Okay, a part of the mystery is unveiled.
I installed xfce4.10 (from source) and the behavior of the keyboard panel plugin changed to consistently
forgetting all but the first two layouts (us, cz-qwerty) on every system startup. It also forgot the layout switching key.
Then it dawned on me that xfce has a keyboard preference app in the system settings
and it turned out to be set to use two keyboard layouts: us and cz-qwerty.
Sooo, it seems that the xfce settings daemon resets the xkb settings to the preferences set in the system settings
dialog at each startup and is totally unaware of the settings changed in the xkb-panel-plugin.
This would seemingly lead to a simple solution to the problem of xfce forgetting keyboard preferences
as I could simply set them in the system keyboard settings and all would be dandy,
except that the keyboard preferences in the system settigs don't let you set the layout switcher key.
The option is simply not there and the settings daemon always sets the layout switching key to none.

Would there be a way of making the xkb-panel-plugin aware of and able to change the system keyboard preferences?
That might just solve tho whole thing as at this point, is seems the problem is caused by an xfce settings daemon
and the keyboard panel plugin competing for the attention of the xkb module.

Fix it and you will put the smile on the faces of gazillions of international xfce users. :D

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

More info:

The problem is caused by the "official" xfce4 keyboard layout settings manager storing the preferences
in the xfconf registry (you can find them using the Settings Editor under "keyboard-layouts")
while the xkb-panel-plugin stores its preferences in xkb using libxklavier.
The two settings managers are unaware of each other and so they keep destroying each others work.

I think the best solution would be to add the missing options to the official xfce4 keyboard layout settings dialog
(the missing options are layout switching key and layout indicator) and make the xkb-panel-plugin use the same xfconf registry entry and open the official settings manager as its preferences.

I am using this thread as my bug investigation blog in hope somebody will actually fix it eventually...

Revision history for this message
Dmitri (ryba4) wrote :

Affects me too. I use US English Programmer Dvorak, Spanish Dvorak & Russian. This switches to Programmer Dvorak only at random time, usually after wakeup from suspending.

Revision history for this message
Dmitri (ryba4) wrote :

Forgot to write that I use Xubuntu 12.04

Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :

Arch people claim a patch. I don't know if that was merged into upstream or not.
Here is the thread with the details:
https://bbs.archlinux.org/viewtopic.php?pid=639451

Revision history for this message
Marc-André Laverdière (marc-andre-atc-deactivatedaccount) wrote :
Revision history for this message
vasdi (vasdi) wrote :

The bug occurs when I connect my joypad with xserver-xorg-input-joystick installed.

Revision history for this message
qji (qji) wrote :

It happens with me after every suspend (and only after suspend).

Revision history for this message
Alexei Colin (alexei.colin) wrote :

Re #13:
I think essentially what you suggest (to have Xfce keyboard settings own the persisted settings and xkb-plugin interact with Xkb without persisting), has been done on the plugin side in commit fb667951f66a05b87949b3eaf9e7c04697899fea which is not in 0.5.4.3. Perhaps it's time for a release of the plugin.

Side question: if we let Xfce control the layout (i.e. uncheck "Use system defaults" in Keyboard Settings), then how does one set the default layout? Is it the first in the list? But then, there are no re-ordering contols other than remove then re-add.

Revision history for this message
Abderraouf Adjal (abderraouf-adjal) wrote :

look:
http://cipricuslinux.blogspot.com/2012/03/keyboard-layouts-settings.html

we have to edit the file < /etc/default/keyboard >

Revision history for this message
Jaromír Cápík (tavvva) wrote :

Hello guys. In my case the plugin periodically forgets the settings due to the following USB error ...

Nov 3 13:24:17 Work kernel: [ 6966.224035] hub 8-0:1.0: port 1 disabled by hub (EMI?), re-enabling...

It appears approximately once a hour ....

The same happens when I unplug and re-plug the keyboard ... in that case the NumLock LED gets inverted when previously on ...

Revision history for this message
ElTomoLoco (tomaspartl) wrote :

Jaromír: What version of Xfce are you using? I'm on Xfce 4.10 that comes with Xubuntu 13.10 and it remembers all keyboard settings when my (remote) usb keyboard gets connected or disconnected.

Revision history for this message
Jaromír Cápík (tavvva) wrote :

After upgrading to Linux Mint 16 that comes with xfce4-session 4.10.1-1ubuntu1 and xfce4-xkb-plugin 1:0.5.6-1 the issue doesn't occur anymore. Just the Num Lock LED still gets inverted, but that's a different story related to the evdev driver. I reported that in the Red Hat Bugzilla and trying to resolve the issue with Peter Hutterer. Thank you.

Changed in xfce4-xkb-plugin (Debian):
status: Unknown → Confirmed
Revision history for this message
Rachel K (rachel-kronick) wrote :

I can confirm this bug. It is causing me to pull my hair out at times. I have had situations where I turned off the Caps Lock key during the interval where the bug had goofed up my settings, causing my system to be in Caps Lock mode with no way to turn it off. That necessitating rebooting the computer, because I had no way to re-log in (due to case sensitive passwords). And I keep worrying that I'm going to get stuck with an unknown keyboard layout while logged out, causing me to be completely unable to log in at all.

Possibly related: the Keyboard setting in Linux Mint is persistently detecting my keyboard as Japanese layout, even when I delete "Japanese" from the list of options. So not only is it ignoring my carefully curated xkb settings (and, perhaps needless to say, my xmodmap preferences), it is deciding to set its own keyboard layout.

This is a huge bug. Please, please, someone fix it.

Revision history for this message
Rachel K (rachel-kronick) wrote :

I'm using LM 17 with Mate and iBus for Chinese input, by the way.

Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

According to various upstream reports, settings should not be reset anymore when using version 0.7.0 or newer.

Changed in xfce4-xkb-plugin (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Zdenek Precek (zdenek-n) wrote :

Empire strikes back. :-(

My distro is Xubuntu-22.04, the xfce4 libraries version is 4.16.
A similar bug started to appear recently and so far it could be easily reproduced.

I have two user accounts logged in, first one on VC7 and second one on VC8.

There is no problem with the first user.

When the second user logs in or switches to it's VC, the XKB settings contain two layouts (us, cz) and it is possible to switch between layouts by pressing a hotkey (LWin). The panel indicator correctly shows the layout currently chosen. This could be also monitored with the xkbwatch(1) utility as well as with the script xkb_watchdog posted elsewhere above by ElTomoLoco.
Now, after clicking mouse anywhere on the desktop both monitoring tools as well as xfce panel indicator show switching to the us layout and log from xkb_watchdog shows that only us layout remains configured.

This can be repaired by temporarily switching to the first account's desktop (Ctrl-Alt-F7) and back (Ctrl-Alt-F8), but only until an another mouse click.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.