Bug 1657826 - Keyboard layout mismatch between native and non-native GNOME apps
Summary: Keyboard layout mismatch between native and non-native GNOME apps
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-10 14:13 UTC by Henry
Modified: 2018-12-21 03:32 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-21 03:32:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Henry 2018-12-10 14:13:19 UTC
Description of problem:
Even though in Region & Language I have only one keyboard layout (English (UK)) I often find that the installed layout is US. If I click around randomly in Region & Language, or mash Super+Space shortcut a few times, I can get the UK layout back, but then after an unknown amount of time, I find my keyboard is back to US. This only started happening after I upgraded to Fedora 29.

Version-Release number of selected component (if applicable):
Fedora 29

How reproducible:
Every time I use my computer

Steps to Reproduce:
(Unknown exactly, but)
1. Select English (UK) keyboard layout, remove all other layouts.
2. Note that the chosen layout is working
3. Wait some unknown amount of time

Actual results:
The keyboard layout is back to US

Expected results:
The keyboard layout never changes until I tell it to

Additional info:

Comment 1 Henry 2018-12-10 14:13:48 UTC
Component probably wrong, had no idea where this should be placed.

Comment 2 Parag Nemade 2018-12-12 04:25:43 UTC
Let's get review of this bug by ibus maintainers.

Comment 3 fujiwara 2018-12-12 09:45:23 UTC
I think your desktop is GNOME.

Can you show the result of the command `gsettings get org.gnome.desktop.input-sources sources` ?

I guess you might type Alt-Shift and you could confirm the shortcut key.

% sudo dnf install gnome-tweaks
% gnome-tweaks

Go to "Keyboard & Mouse" -> "Additional Layout Options"

Comment 4 Henry 2018-12-12 15:23:26 UTC
Yep, my desktop is GNOME.

% gsettings get org.gnome.desktop.input-sources sources
[('xkb', 'gb')]

Not sure what Alt-Shift does? I pressed it but didn't notice anything happening.

% sudo dnf install gnome-tweaks && gnome-tweaks

However, when I select Alt-Shift to be the keyboard shortcut in Additional Layout Options, I get,

Segmentation fault (core dumped)

from gnome-tweak-tool.

Comment 5 Henry 2018-12-15 10:07:14 UTC
OK, so at first this seemed random, but now it's consistently different (I'm not sure what to believe anymore).

In Chrome and Emacs, the layout is currently US. In GNOME terminal, it's UK. How can this happen, can it be fixed? Driving me nuts!

Comment 6 fujiwara 2018-12-17 04:28:24 UTC
(In reply to Henry from comment #4)
> % gsettings get org.gnome.desktop.input-sources sources
> [('xkb', 'gb')]

OK, I thought you have US and GB but actually GB only.

> Not sure what Alt-Shift does? I pressed it but didn't notice anything
> happening.

OK, seems you don't have any settings from `gsettings get org.gnome.desktop.input-sources xkb-options`

> Segmentation fault (core dumped)
> 
> from gnome-tweak-tool.

OK, I see.

(In reply to Henry from comment #5)
> In Chrome and Emacs, the layout is currently US. In GNOME terminal, it's UK.
> How can this happen, can it be fixed? Driving me nuts!

I set GB only but I cannot reproduce your problem with emacs and firefox.
How about gedit?

Comment 7 Henry 2018-12-17 10:30:00 UTC
(In reply to fujiwara from comment #6)
> (In reply to Henry from comment #4)
> > % gsettings get org.gnome.desktop.input-sources sources
> > [('xkb', 'gb')]
> 
> OK, I thought you have US and GB but actually GB only.

Me too, I only want UK, but that's all I've got selected, and yet still Chrome/Emacs are using what appears to be a US layout (it's definitely not UK).

> 
> > Not sure what Alt-Shift does? I pressed it but didn't notice anything
> > happening.
> 
> OK, seems you don't have any settings from `gsettings get
> org.gnome.desktop.input-sources xkb-options`

$ gsettings get org.gnome.desktop.input-sources xkb-options
['ctrl:swapcaps']

I'd forgotten I had that, might it be causing the problems? I have this in my .bashrc to make that a thing,

/usr/bin/setxkbmap -option "ctrl:nocaps"

> 
> > Segmentation fault (core dumped)
> > 
> > from gnome-tweak-tool.
> 
> OK, I see.
> 
> (In reply to Henry from comment #5)
> > In Chrome and Emacs, the layout is currently US. In GNOME terminal, it's UK.
> > How can this happen, can it be fixed? Driving me nuts!
> 
> I set GB only but I cannot reproduce your problem with emacs and firefox.
> How about gedit?

gedit also uses the right keymap, so it seems the "GNOME" applications (Terminal, gedit, Evolution) are finding the right layout somehow, but Chrome/Emacs/VSCode are not, which I know are not native GNOME apps.

Comment 8 fujiwara 2018-12-18 07:48:52 UTC
(In reply to Henry from comment #7)
> I'd forgotten I had that, might it be causing the problems? I have this in
> my .bashrc to make that a thing,
> 
> /usr/bin/setxkbmap -option "ctrl:nocaps"

I think it's not good. You should use gnome-tweaks for GNOME settings.
If you use other desktops, probably the desktop also would provide the setting tool.

> > > In Chrome and Emacs, the layout is currently US. In GNOME terminal, it's UK.
> > > How can this happen, can it be fixed? Driving me nuts!
> > 
> > I set GB only but I cannot reproduce your problem with emacs and firefox.
> > How about gedit?
> 
> gedit also uses the right keymap, so it seems the "GNOME" applications
> (Terminal, gedit, Evolution) are finding the right layout somehow, but
> Chrome/Emacs/VSCode are not, which I know are not native GNOME apps.

It's a bit strange for me since the keyboard setting is applied to the desktop but not each application.

Can you reproduce your problem with a new user account instead of the current user account?

Anyway, since your problem happens with GB only, this is not an issue for ibus.

Comment 9 Henry 2018-12-20 11:47:29 UTC
(In reply to fujiwara from comment #8)
> (In reply to Henry from comment #7)
> > I'd forgotten I had that, might it be causing the problems? I have this in
> > my .bashrc to make that a thing,
> > 
> > /usr/bin/setxkbmap -option "ctrl:nocaps"
> 
> I think it's not good. You should use gnome-tweaks for GNOME settings.
> If you use other desktops, probably the desktop also would provide the
> setting tool.

So, that seems to have fixed, been working for a couple days after removing this option from my bashrc, not sure why it caused this problem however, but I'm happy it's fixed it.

Thanks for the help.

Comment 10 fujiwara 2018-12-21 03:32:36 UTC
Closing this with the submitter's comment.

(In reply to Henry from comment #9)
> (In reply to fujiwara from comment #8)
> > (In reply to Henry from comment #7)
> > > I'd forgotten I had that, might it be causing the problems? I have this in
> > > my .bashrc to make that a thing,
> > > 
> > > /usr/bin/setxkbmap -option "ctrl:nocaps"
> > 
> > I think it's not good. You should use gnome-tweaks for GNOME settings.
> > If you use other desktops, probably the desktop also would provide the
> > setting tool.
> 
> So, that seems to have fixed, been working for a couple days after removing
> this option from my bashrc, not sure why it caused this problem however, but
> I'm happy it's fixed it.

Because the entity of /usr/bin/google-chrome is a script which loads .bashrc by exec.
The binary files don't load .bashrc.


Note You need to log in before you can comment on or make changes to this bug.