Keyboard layout changing randomly

Bug #1246272 reported by Lucas F.O.S.
532
This bug affects 114 people
Affects Status Importance Assigned to Milestone
gnome-settings-daemon (Ubuntu)
Confirmed
Low
Unassigned
unity-settings-daemon (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

Just upgraded from 12.04 (raring) to 12.10 (saucy) and keyboard layout keeps changing from pt_br to what I think is en_us.
It seems random so I don't know what trigger this, but sometimes just alt-tabbing is enough to mess with keyboard layout in one of the windows.
I already removed the en_us from my keyboard sources, double checked the use of one source for all windows, and even removed accelerators to switch between layouts but none have worked.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: gnome-control-center 1:3.6.3-0ubuntu44
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
Date: Wed Oct 30 09:12:48 2013
ExecutablePath: /usr/bin/gnome-control-center
InstallationDate: Installed on 2013-05-20 (163 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MarkForUpload: True
SourcePackage: gnome-control-center
UpgradeStatus: Upgraded to saucy on 2013-10-22 (8 days ago)
usr_lib_gnome-control-center:
 activity-log-manager 0.9.7-0ubuntu4
 deja-dup 27.3.1-0ubuntu1
 gnome-control-center-datetime 13.10.0+13.10.20131016.2-0ubuntu1
 gnome-control-center-signon 0.1.7~+13.10.20130724.1-0ubuntu1
 gnome-control-center-unity 1.3+13.10.20131004-0ubuntu1

Revision history for this message
Lucas F.O.S. (dissimulos-ubuntu) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, what desktop environment do you use? Do you get the issue if you assign the keyboard layout cycling to another keybinding (e.g ctrl-shift)?

affects: gnome-control-center (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Lucas F.O.S. (dissimulos-ubuntu) wrote :

Hello Sebastien :)

I'm using plain Ubuntu, i.e. Unity.
Since it's hard to reproduce the random changes I can't tell you if another keybinding do any better, I'll be trying trying. But I noted after boot the layout is always wrong.

Revision history for this message
Lars Ola Liavåg (l-liavag) wrote :

I've got the same problem. I don't even have the US keyboard layout installed and yet, upon each login, the layout is set to US. Manually setting it back to the correct one (Finnish in my case) works but after a reboot, it's wrong again. Very annoying indeed.

Revision history for this message
Lucas F.O.S. (dissimulos-ubuntu) wrote :

Hi.

Just to confirm I still get the issue changing keybinding.

Revision history for this message
Rafael Balthazar (rafael-control-lab) wrote :

This annoying keyboard layout changing started after upgrade from raring to saucy. It's not happening randomly. It happens after login, but not at the login screen, or when typing password to unlock the screen.

Revision history for this message
Lucas F.O.S. (dissimulos-ubuntu) wrote :

For me it also happens randomly during the session, even after re-setting keyboard layout many times. Alt-tabbing Skype with with, let's say, Firefox is sure it will happen.

Revision history for this message
Trevor H (hughes532001) wrote :

I also get this problem on two machines, one was a clean install and the other an upgrade.

Revision history for this message
Stephan Windmüller (stephan-windmueller) wrote :

Same problem here, the keyboard layout switches after a reboot/relogin.

There is also a matching question on askubuntu: http://askubuntu.com/questions/362973/keyboard-layout-switches-to-english-each-time-i-reboot

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Same here, on a new install of ubuntu 13.10 on a eee pc

reboot set layout to US keyboard instead of fr_ch

switching keyboard layout gives the good layout

Revision history for this message
Lucas F.O.S. (dissimulos-ubuntu) wrote :

Hello, Sebastian.

Any news about this bug?

Revision history for this message
Sebastien Bacher (seb128) wrote :

No, I've no offhand idea on the issue and I'm too busy to debug it (I can't reproduce it either which would make debugging difficult in any case), I guess somebody else is going to have to step up there

Changed in gnome-settings-daemon (Ubuntu):
status: Incomplete → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Revision history for this message
Jason Robinson (jaywink) wrote :

Did a clean saucy install on the laptop of my wife and she got affected by this. Would gladly help debug.

Not sure if it helped or not, since I only tried one reboot so far, but others could also try putting the keyboard layout in ~/.dmrc - at least for one login it helped but will need to check if happens again since it doesn't seem to happen every boot.

Attached output of ubuntu-bug.

So I put this in ~/.dmrc (for Finnish):

Layout=fi

Revision history for this message
Tom Chance (telex4) wrote :

Also affects me on fresh install, I have en_GB enabled but it keeps switching to en_US. Happy to help debug if you give instructions.

Revision history for this message
Bruce (brunces) wrote :

The problem also affects my Ubuntu 13.10 64-bit, however I'm using this workaround:

Go to "System Settings > Text Entry". Under "Input sources to use", add your keyboard layout if it still doesn't exist, then move it to the top of all layouts you already have. Or, if you prefer, you can simply delete all the layouts you don't need and keep only the one you want (that's what I've done here).

Now, open the "Startup Applications", click on Add and do the following:

Name: KeyLaySet (This is made up. Invent your own.)
Command: bash -c "sleep 5 && gsettings set org.gnome.desktop.input-sources current 0"
Comment: Sets keyboard layout to default

About Name: you can use whatever you want.
About Command: after the system starts up, it will wait for 5 seconds and then change the keyboard layout to the default one (that one you moved to the top in the "Input sources to use" box).

Click on "Save" and then "Close". Now, every time you start Ubuntu, your keyboard layout will be properly set.

I hope it's helpful. Cheers. :)

brunces

Revision history for this message
no!chance (ralf-fehlau) wrote :

This effect is also present in 14.04. It switches to english layout randomly. BUT, why could it switch to english, when there is no english layout present. I deleted the english layout, when I installed the german layout. (i got the backslash sign, when I pressed + key)

kind regards,
Ralf

ps: should it be bug-compatible with windows? ;-)

Revision history for this message
no!chance (ralf-fehlau) wrote :

Is there a way to disable this feature? I need only ONE keyboard layout.

Revision history for this message
Craig Wood (rijidij) wrote :

I can confirm this issue is also in 14.04 as reported in #17 by no!chance.

I have only 1 keyboard installed - English (UK) - but after every reboot, it seems to default to a US keyboard.
Clicking on the indicator in the menu bar switches to the correct (UK) input.

Like Ralf, I also only need one keyboard layout.

Revision history for this message
JockeTF (jocketf) wrote :

I can confirm this issue for Ubuntu GNOME 14.04.

It keeps switching keyboard layout to English even though I only have a single Swedish keyboard layout in the input sources. I haven't been able to see a pattern to the switching. It appears to be happening at random.

I use an external keyboard with my laptop. Messing around with the settings via gsettings switches it back to Swedish temporarily. Sometimes playing around with the input sources causes the system settings window to freeze.

summary: - Keyboard layout changing randomly in 13.10 (saucy)
+ Keyboard layout changing randomly
tags: added: trusty
Changed in unity-settings-daemon (Ubuntu):
status: New → Confirmed
Revision history for this message
Hendrik Schrieber (hennekn) wrote :

Some observations on Trusty:
The indicator always shows the correct layout even if the actual layout is not the same.
In /etc/default/keyboard the setting is correct. The X-Server log says it set the correct layout (de in my case).

Possible workaround:
Run "sudo dpkg-reconfigure keyboard-configuration" in a Terminal. This worked for one reboot at least. I will report back if the problem reoccurs.

Revision history for this message
Hendrik Schrieber (hennekn) wrote :

The workaround from #21 does not work. It just happend again.

Sometimes the wrong layout is already set right after boot and you have to change it before you are able to login or sometimes it happens when switching to another window.

I have two Acer laptops, both have been upgraded from 13.10 to 14.04 and both have this problem. One of them already had the problem in 13.10, not in 12.04 though.

Revision history for this message
utku yaman (utkuyaman) wrote :

The workaround from #21 does not work for me too.

I think I found a way to reproduce the bug.
- I use two layouts, US and TR
- other layout options:
- - `switch to next source using: Shift + Super L`
- - `switch to previous source using: Shift + Ctrl + Super L`
- - `allow different sources for each window`
- - `new windows use the default source` (EN is the default source)
- I change layout to secondary layout ( TR in my case )
- everything is normal until I `alt+tab` to another window
- then the layout goes back to US
- If i rapidly press `alt + tab` between two windows the keyboard layout randomly switches between US and TR

information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Santeri Savonlahti (shanttu) wrote :

Same problem with fresh install of Ubuntu Gnome 14.04. Happens also randomly, but I noticed that after gnome shell crashes, keyboard changes to something else (US?). Finnish keyboard is set to first priority, no other keyboard set on settings. System language is English.

1 comments hidden view all 113 comments
Revision history for this message
Simon Junga (simonthechipmunk) wrote :

Reproducing this Bug in Gnome-Shell: "Alt+F2" > r (after each restart the layout is set to eng:us)

Temporary Workaround for the running session:

dconf-editor:

desktop>ibus>general

key "engines-order" > set your desired keyboard layout at first position. However this setting will be reverted after reboot.

Revision history for this message
Simon Junga (simonthechipmunk) wrote :

Workaround:

create a shell script named kblayout.sh and paste the following in it (change the xkb-layout according to your preferred layout):

#!/bin/bash
gsettings set org.freedesktop.ibus.general engines-order "['xkb:de::ger', 'xkb:us:eng']"

now set the script to be executed at login by creating an entry in your start applications.

This worked for me and should be ok until this bug is fixed.

Revision history for this message
Hendrik Schrieber (hennekn) wrote :

Another workaround would be to put something like "unity-settings-daemon --replace" in one of the login/start scripts. Since the problem always only occurs once after each boot it will not occur again after replacing the daemon.

Revision history for this message
lusepuster (thoeger) wrote :

I have this problem on Trusty Tahr, but it doesn't only happen at login. I have three keyboard layouts installed - Danish, Swedish and US English (the actual keyboard layout is US english), and I often find that it happens while I'm in the middle of typing a sentence, suddenly writing ;, ', [ instead of Danish æ, ø, å or Swedish ö, ä, å, and special characters suddenly switching positions..

The indicator sometimes shows e.g. English layout wwhile the actual layout would be e.g. Swedish, but I have not been able to figure out if it is consistent or not, and I have not been able to figure out anything that could change the behaviour.

I have had Left Shift+CapsLock mapped to cycle between layouts and thought that maybe I simpoly hit that combination by accident, but after I have changed the mapping to Ctrl+Alt+Space, it still happens, and THAT combination is not easily hit by accident.

I have mostly been working in and therefore experiencing the problem in Firefox and GVim.

Revision history for this message
Jochen Fahrner (jofa) wrote :

I can confirm comment #29. I'm on Trusty with a german keyboard layout (qwertz). After login all is ok. But sometime later the layout suddenly switches to some englisch layout (qwerty). The indicator still is showing german. Manual switching to US and then back to DE restores the german layout.

Revision history for this message
Matthias Niess (mniess) wrote :

This also happens when there is only one keyboard layout installed. It still randomly switches to en_us. This shouldn't be classified as low importance since it is a major problem, especially in corporate environments. I have this happening on dozens of machines and have lots of annoyed users who have to use the workaround of switching layouts forth and back on a daily basis.

Revision history for this message
JockeTF (jocketf) wrote :

As a programmer, this is a very frustrating issue for me as well. Punctuation, brackets and other such characters are located in very different positions on sv_SE compared to en_US.

My keyboard layout always changes to en_US when GNOME Shell is restarted. Never on the initial startup though. The following command solves the issue temporarily for me:

gsettings set org.gnome.desktop.input-sources current 0

Revision history for this message
Steffen Eibicht (steffeneibicht-deactivatedaccount) wrote :

I am too affected by this bug.

I have a Laptop with Intel graphics (Intel Ironlake) and this machine is affected by this bug. But I also have another Laptop with an old Nvidia Geforce 7300GO and this one seems not to be affected. The same applies for my desktop machine (Nvidia Geforce 210). Both Nvidia-Machines are running the proprietary graphics driver. And all three machines are running Ubuntu Trusty, of course.

Maybe this helps?

cheers
Steffen

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

Could be this the upstream report?

https://bugzilla.gnome.org/show_bug.cgi?id=729423

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :
Revision history for this message
Steffen Eibicht (steffeneibicht-deactivatedaccount) wrote :

today, after boot, the Keyboard switched again. See attached logfiles. It is the boot from 16th of May, around 20:15pm.

Revision history for this message
Steffen Eibicht (steffeneibicht-deactivatedaccount) wrote :

just to be sure, the syslog too.

As I wrote above, the boot in question is the one from May 16 20:16:17

Revision history for this message
Toni Alfaro (toni-alfaro) wrote :

The possible solution mentioned in comment #35 did not work for me: a few days after, the issue has reappeared

Changed in unity-settings-daemon (Ubuntu):
importance: Undecided → Low
Revision history for this message
Santeri Savonlahti (shanttu) wrote :

I removed all other input methods than Finnish keyboard using ibus-setup (where only US layout was shown as an input device). Problem occured again and checked ibus-setup: Finnish keyboard layout was not an option as an input device anymore, US layout had made a comeback as the only option.

After restarting shell Finnish keyboard is still there, but as a second option after US.

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

@Alberto Low? Really?

Since 13.10, between this and https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1218322 Ubuntu has become a PITA if you have to write in more than one language (and even with just one, if that one is not en_US).

Your call, but I think this is _at least_ high.

33 comments hidden view all 113 comments
Revision history for this message
Edgaras (devoas) wrote :

By the way, there is no way this can be considered low priority, unless you are being incredibly US centric, and disregarding all other countries, and even then...

Revision history for this message
Mekk (marcin-kasperski) wrote :

As my case is slightly specific, let me describe it too. I use specific variant of Polish keyboard - pl(intl) instead of default pl (it is simply much better considering extra symbols). This variant is configured in unity settings (I finally removed all other keyboards from there), while fighting with the problem I also configured it in /etc/default/keyboard.

Since I updated to 14.04, at chaotic moments (at least a few times a day but I did not spot any rule yet), my layout silently switches back to 'pl'. Whenever I spot it, I issue "setxkbmap 'pl(intl)'" and get my keyboard back ……… for some time. And again, and again. Thing is not login/reboot related, one of my machines works continuously for weeks (and presents me this problem every day). I experience it both on „normal Unity desktop” and on somewhat specific machine with Gnome+Awesome.

I noticed that ~/.dmrc (I have no clue what it is and where it comes from, I checked it as it was mentioned above) has WRONG layout (Layout=pl without variant)

It may be of importance (someone above mentioned mixed language settings), that I have LANG=en_US.UTF-8 (and other locale similarly).

Revision history for this message
Mekk (marcin-kasperski) wrote :

Scanning via this bug I also noticed, that in dconf-editor desktop/ibus/general/ has some ugly values:
- engines-order is ['xkb:us::eng', 'xkb:pl::pol']
- preload-engines is ['xkb:pl::pol', 'xkp:pl(intl)::(null)']

I can play with those but I am not sure what do they mean.

Where can one read about ibus-settings ? Looks like GUI configuration not quite saves what I click, so I am OK with configuring those manually, but would not like to do it blindly…

Revision history for this message
Mekk (marcin-kasperski) wrote :

As I googled out http://osdir.com/ml/ubuntu-bugs/2014-05/msg08453.html let me also mention that I had „use-system-keyboard” disabled.

And short summary from my side: we have many sources of possible keyboard settings (~/.dmrc, dconf-editor settings, /etc/default/keyboard, keyboard settings in Xorg, maybe more). Those can be edited by various means (different preferences dialogs, *conf-editors, gsettigs) and it seems some of those happen to be generated from some others at not-so-clear (for me) moments by not-so-clear (for me) apps. While the system is executing, one can impact keyboard via setxkbmap or similar APIs, by keyboard switching shortcuts/panels and - it seems to me - by some background processes (IBUS?)

The result is that I have completely no idea where my settings are taken from, what impacts them and why do they change and when.

The bug as such looks like an effect of some inconsistency between those various settings.

Debugging it in detail could be hard, but if somebody clearly described what is the INTENDED priority of all those settings, it could be possible to examine whether it is respected.

Revision history for this message
Mekk (marcin-kasperski) wrote :

And one more link I googled out, somewhat related as it shows thise priority problems: .dmrc is read by display manager, but can also be generated by it, and if it exists it can be read, but need not if AccountsService is available, … Brrrrrr
https://afrantzis.wordpress.com/2012/06/11/changing-gdmlightdm-user-login-settings-programmatically/

Revision history for this message
Mekk (marcin-kasperski) wrote :

And some screenshot from my machine. I right clicked keyboard (ibus) icon in tray to open settings and picked Preferences, then left-clicked the same icon. Compare lists of keyboards on the left and on the (top) right http://tinypic.com/r/2ecnmt5/8 The app seems inconsistent with itself.

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

@Mekk I think that you nailed the problem in #77 (and you forgot all the settings via XKB in xorg.conf hierarchy, and /usr/share/X11/xkb/, and .Xmodmap, and IBus, and ....).

I have the sensation (mind you --- this is not at all an accusation to anyone; I tried to dig into it and failed) that no one has a clear idea of how the keyboard is configured, chosen and modyfied.

I found a solution for me (no switching, defined "use system keyboard layout" in IBus setup AND disabled IBus --- don't ask, and defininign my own keyboard). It's viable because I write in three langauges that have a similar character set; but I imagine that having for example to write in Russian and English have to be a nightmare.

Revision history for this message
Edgaras (devoas) wrote :

And so... considering information that was mentioned by previous posters, I did some investigation. First of I do not use any DM, I'm also big antifan of various useless deamons like gconf and dconf, and even before posting here I disabled them. I also do not run IBus. So that basically left me with very little files. So I used inotify on /etc/default/keyboard, and lo and behold something reads it, with no reason. Though getting the process that does that was a bit more difficult as inotify does not provide such information. I found that I can do this with auditd, so I setup fs audit:

auditctl -w /etc/default/keyboard -p war -k culprit

And after significant waiting [almost a day, I do not turn my machine off] (strangely moments before resets happened like once every 2-5 minutes, like 10 times in a row), I get keyboard reset, inotify reports file access, and here is what audit shows:

# ausearch -f /etc/default/keyboard
time->Thu Dec 4 09:16:47 2014
type=PATH msg=audit(1417677407.634:1120389): item=0 name="/etc/default/keyboard" inode=524629 dev=08:06 mode=0100664 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL
type=CWD msg=audit(1417677407.634:1120389): cwd="/"
type=SYSCALL msg=audit(1417677407.634:1120389): arch=c000003e syscall=2 success=yes exit=5 a0=7ffff3668ff0 a1=80000 a2=1b6 a3=0 items=1 ppid=9235 pid=8863 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="systemd-udevd" exe="/lib/systemd/systemd-udevd" key="culprit"

Now all I can say is that I suspected that something like that will be responsible for this. For a very long time now I have very hard time saying anything positive about systemd, this does not make it better. Considering that this is /dev related I'm pretty sure I can not simply nuke it without some unpeasant consequences. In any case, we now know what is causing it (well at least process-wise). Anyone has any suggestions how to work around this? And if fix can be expected?

Revision history for this message
Edgaras (devoas) wrote :

Looking further into it, I can see in /var/log/Xorg.0.log that there are significant number of entries about my keyboard beigin disconnected/connected. But there are are some serious weirdness there. For example how in the world does it come up with idea to set various mouse option on _keyboard_? I use trackball with mouse wheel emulation, but it seems that it adds those option on keyboard somehow, which is also weird. How it decides to reconect keyboard? I doubt this is any hardware issue, because nothing changed from when I had 10.04, and it was working well then.

Revision history for this message
Edgaras (devoas) wrote :

I want to report that it seems this bug got fixed in some update. Since no it is close to a weak and I did not have any occurances of it. But I can not helpt to pin down which update causes this, because I do not update all that often, it was something il past 2-3 months. Ether way it seems to be working correctly for now.

Revision history for this message
Edgaras (devoas) wrote :

#@* it's back again, and I haven't even restarted X since last comment! My X has been running from "Nov 25 10:35:54 2014" so even taking into account that at the time of a commen't it was week since last occurance of bug, it still seems that it somehow managed to get fixed and then break again all without X ever restarting. Maybe there was some regression in some update, but I think I haven't done any in last week (and it only started yersterday). So...

Revision history for this message
Pedro Antón González (pantongonzalez) wrote :

Most interesting-at least for me-is that the keyboard configuration works OK if, after login in with a gnome classic desktop -now the keyboard layout is WRONG, id est, USA while it should be SPANISH - I close the session, log in again with the standar Ubuntu desktop - the one i dont want to use - and the keyboard layout is OK, then I close the session again, and open it as gnome classic ... and it still works fine, with the spanish layout.
I wonder if other people have problems with the classic gnome desktop, or if it's just me.

Sorry for the typesetting, but right now the keyboard layout is wrong, and it is not easy task to discover the misplaced keys.

Revision history for this message
Edgaras (devoas) wrote :

I have fixed it for myself. As I said I had keyboard disconnect and reconnect logged in dmesg. So somehow I though this might have something to do with USB powersave (I think I looked to reasons why device might sponteously disconnect and reconnect (nevermind that I'm on desktop, and constantly typing, so nether kayboard nor machine should even want to try to sleep). So I looked for ways to disable USB powersave. I think I used this:

http://askubuntu.com/a/301416

I done this couple of weeks ago, I I did not have that problem anymore. Though reboot will likely be soon, and I'll have a chance to test this one more time. But I'm pretty sure it's that.

Revision history for this message
Szelcuzan Istvan (szelcuzanistvan) wrote :

I have fixedthe problem with check off Fcitx in Startup Applications.
 OR
playing with Fcitx configuration AND set Text Entry --->Use same source for all windows

I have ubuntu 14.04 -64bit. I've got the same problem. keyboard layout switches after go to another application windows and come back OR when press some key Alt Shift.... at first sight randomly.

Revision history for this message
miguelquiros (mquiros) wrote :

Hello.
I have bumped into this bug too. In the middle of a session (I do not remember doing anything special in that session, either installing new software or changing system settings or anything of that kind), the keyboard switched from Spanish to English and stayed like that even after rebooting the system.
The bug affected only GNOME, if I started session with Cinnamon or XFCE, the keyboard behaves as Spanish, but when I logged with GNOME again (either with Metacity or Compiz), the bug showed itself up!
With this information, I opened dconf-editor and start looking at keys related with GNOME and I found this one:
org -> gnome -> desktop -> input-sources
Here, I can see under "sources" the keyboard layouts present in the system (in my case, Spanish and English in this order) and the key "current" that had the value "1". Looking at the help in this screen "0" is the first layout, "1" the second, .... Hence, I changed "current" from "1" to "0" (which should be the predetermined value), closed the window, closed and reopened the session, and voila!, my keyboard was Spanish again.
What I cannot tell is which application or which action from my part has misconfigured the dconf settings, so perhaps the information I am giving here is not going to help too much in locating the bug but at least, I hope the solution I have found works also for others.
By the way, who has labelled this bug as "low importance"? For sure, it must be someone that only uses English keyboards. I do not think that anyone using a non-English keyboard can flag the importance of this bug as "low", it makes the use of the keyboard quite annoying!

Revision history for this message
Kenan Gutić (kenan-gutic) wrote :

To me this happens when I hide keyboard indicator from the top panel.
Using Ubuntu 14.04 with all updates.

Revision history for this message
Teme (teemu-koivisto) wrote :

I had suddenly my keyboard layout also changed but using the command to 'Switch to next source using: " in System settings > Text Entry I was able to switch back to finnish layout. (Although I had to use the command twice: first I guess to switch to english and then back to finnish)

So Super(windows button) + Space did the trick for me and currently it's working.

Revision history for this message
gbachot (geert-bachot) wrote :

Same here, unable to change the keyboard layout.
Ubuntu 14.04.2, Unity, 64 bit.

The indicator shows Be, which is correct, but the actual layout is wrong. Checked / changed system settings several times, un/installed languages, disabled and re-enabled ibus, did a systemupdate, logged out and restarted several times. Nothing helps.

Revision history for this message
gbachot (geert-bachot) wrote :

Edit: this command solved the issue for me. It let me reconfigure my keyboard setup, similar to how it's done during ubuntu installation.
All is back to normal now.

sudo dpkg-reconfigure keyboard-configuration

Revision history for this message
Quinn Plattel (qiet72) wrote :

Having similiar issues as well. Whenever I go out of suspend or hibernate, the keyboard changes to en-US. I have to use ibus to change back to Danish keyboard. Still trying out different solutions - nothing solid yet.

Revision history for this message
Selene ToyKeeper (toykeeper) wrote :

I've been running into this bug for months on a new notebook. At random times during my session, it changes the keyboard layout and I have to manually reset it.

I tried installing debian/testing on the same notebook, using a minimal install, then added Xorg and sawfish. No ibus packages, no GNOME packages, no display manager (startx + ~/.Xsession instead), but it does still have dconf because so many packages depend on it. The random keyboard layout switches still happen even in this minimal Debian configuration.

ibus was a problem before, because any time I typed too fast ibus would lock up and kill the app I was typing into... but getting rid of ibus fixed that. The layout issues are more resistant to investigation since I can't make it happen (or not happen) on purpose.

Revision history for this message
Fabrizio Cipriani (fabriziocip) wrote :

Enabling the "use-system-keyboard-layout" ibus setting solved the problem for me, as described in comment #23 in https://bugs.launchpad.net/ubuntu/+source/indicator-keyboard/+bug/1240198

Revision history for this message
Gustavo L (gustavo-lapido) wrote :

Same here.

Applaying gsettings set org.gnome.desktop.input-sources current 0 immediately fixes the problem.

I'm not going to put this command at startup because this issue arises randomly at any time (and not after boot).

Revision history for this message
Rokk (rocco-pietrini) wrote :

Same here, on Ubuntu 14.04, Acer Notebook. I have default It keyboard, sometimes and randomly switches in Us, but the indicator shows still It a workaround is to click again on Italian.
I tried solution proposed in comment #69 as I were missing some installation too, let's see if it fixes...

Revision history for this message
paxapy (paxapy) wrote :

same with ubuntu 14.04/gnome 3.12.2 (from staging ppa)
tried all suggested methods (removing settings ibus to use system layot, removing ibut etc) and nothing helps

Revision history for this message
Eloy Vallina (eloyvallina33) wrote :

Also happens here in my Ubuntu Gnome 14.04 with Spanish layout. Even though the top bar states that the keyboard layout is Spanish 1 (international), the real layout is wrong, probably en_US.

A workaround this issue is to have two favourite keyboard layouts that will appear in the drop-down when you click on the language icon on your top bar. In my case, I have two spanish layouts and I can easily change from es1 to es2 and then back to es1. The keyboard configuration is now truly es1 which what matches my hardware and I can keep working.

To add a keyboard layout in this drop-down menu just go to System>Keyboard>Layout settings!

Hope that helps until they come up with some true solution.

For a problem this stupid I sincerely don't understand it has been here so long.

Revision history for this message
Squiter (squiter85) wrote :

Also happens here! Im using Elementary OS, based on Ubuntu 14.04.
My Lenovo G40 has a BR layout keyboard that works fine until I bough a US layout mechanical keyboard, after that I cannot set the us layout as default in any way. It aways change to BR, after and after. A simple alt+tab is enough to reconfigure my keyboard settings.

I already tried to run:

* setxkbmap -rules evdev -model evdev -layout us -variant intl -option caps:ctrl_modifier
* gsettings set org.gnome.desktop.input-sources current 0
* sudo dpkg-reconfigure keyboard-configuration

Every command works fine until I change the current windows, that imediatly changes to br layout again. I was planing to go to Ubuntu, but I see that problem is not a Elementary exclusivity.

1 comments hidden view all 113 comments
Revision history for this message
Bradleygh (bradleygh92) wrote :

The following worked for me, although trivial, I hope that it works for others also.

Try either: Shift + Super + Space then try typing to see if it has changed the layout.
                       Super + Space then try typing to see if it has changed the layout.

For me this was the problem and it is very easy to press these particular keyboard commands on Ubuntu 14.04 if you are using multiple programs.

Why should this work? Well if you go to Settings - Keyboard - Text Entry - *The above commands and what they do shown on the right* will make the above self-explanatory.
Alternatively after clicking *Text Entry* highlight the Keyboard layouts that you do not want (on the left hand side) and then click the minus sign below.

I hope this helps.

Revision history for this message
Havard Sorli (havard-sorli) wrote :

#102 works :-) (The Super key was the "Windows" key on my Logitech K200 keyboard)

Revision history for this message
Erno Kuusela (erno-iki) wrote :

Happens on 16.04 too.

tags: added: xenial
Revision history for this message
Ville Ranki (ville-ranki) wrote :

After upgrading to 16.10 layout resets to English after every boot. Would render computer unusable unless it was always on HTPC. I didn't have this problem before upgrade.

Revision history for this message
xit-tester (xit-tester) wrote :

issue still happening with 16.04 but in my case, it changes to French from English US which is ridiculous since I don't have French installed on any of my servers (this is sitting in a Virtual environment, only server terminal mode. with nothing shared between physical and virtual servers) just throwing a brain fart out there... is it possible that one of the scheduled scripts that run every hour has something to do with this...???

Cheers!
G-Edge

Revision history for this message
Johan Holmberg (johan-idioti) wrote :

The issue is present in 17.10 (using GNOME) as well.

Revision history for this message
Marek Marczykowski-Górecki (marmarek) wrote :

I have similar problem. I found the only way to set defaults for a new input device (which also applies to Xorg re-adding the same devices at some arbitrary times like suspend) at runtime, without restarting Xorg to pick up modified xorg.conf, is to set xkb* udev properties on a device (for example by adding new rule and reloading udev).

More details: https://github.com/QubesOS/qubes-issues/issues/3352#issuecomment-400292279

Revision history for this message
Suncatcher (suncatcher) wrote :

I have kinda similar problem: whenever I change the layout, it changes not to the one specified by symbol, but to random one.

Revision history for this message
Vladymir (vladymir0) wrote :

7 years passed by and the problem is still here! (for me, on ubuntu 18.04) such a mess...

Revision history for this message
Vladymir (vladymir0) wrote :

I noticed that it's switching at the following moments:
1. switching terminal from console to xorg (ctrl+alt+f2 -> ctrl+alt+f7)
2. resume from hibernation
3. os boot
all these cases are related to console in some way.
probably console meddles to layout somehow...

Revision history for this message
Vladymir (vladymir0) wrote :

actually, it doesn't switch layout (at least for me), but it ADDS A NEW LAYOUT instead!
let me explain this.
I do not use a "plain" en_us layout, but use us+dvorak and ru+dvorak (custom created).
so, when "us+dvorak" is active, it adds "us" to the end of the list.
when "ru+dvorak" is active, it adds "ru" to the end of the list.
when added, new layout becomes selected.
also, new added layout is not visible in gui settings, but everyone can see it by command 'setxkbmap -query'.

also, I made a workaround for this crap.
1. set 'org.gnome.settings-daemon.plugins.keyboard active false' to switch off defective plugin.
2. to switch layouts, I created keybindinds EMBEDDED into my layout (a new modifier key).
3. installed gxkb to have an indicator of selected layout in the system tray.

I restored the lost multimedia keys and other keybindings in compiz settings.

Revision history for this message
Anton Alexandrenok (the-spyke) wrote :

I have a similar issue:

Ubuntu 19.04
Gnome 3 + Wayland
2 input sources (en-US and ru-RU)
"Allow different sources for each window" is on

When I alt-tab windows, their input sources may randomly change. Moreover, sometimes when I lock the screen even login screen's input method may change too.

Displaying first 40 and last 40 comments. View all 113 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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