After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 770529 - Keyboard layout switching for non gnome applications under wayland require losing focus for a moment to get switch happened
Keyboard layout switching for non gnome applications under wayland require lo...
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-08-29 04:28 UTC by neumond
Modified: 2021-07-05 14:12 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description neumond 2016-08-29 04:28:51 UTC
I can switch layout in gnome applications, such as gedit, terminal. It works fine. But if I use firefox or another application pressing my combo (ctrl+shift) doesn't actually switch a layout: if I continue to type, letters are coming in unchanged language. At the same time I can see switch happened in top gnome shell bar. I.e. ctrl+shift press was handled by gnome shell, but couldn't reach non-gnome application.

I can workaround this in two ways:
1. Choose layout by mouseclicking at top bar. It changes layout of any application correctly.
2. Take focus from application for a moment. Press ctrl+shift, then press super to show gnome shell, press super again to return to the application. Somehow it does a trick and language changes.

I remember under X, on my old machine, gnome layout switcher did always take a focus for a moment. Looks like the same trick can fix this.
Comment 1 Rui Matos 2016-08-29 11:46:42 UTC
Can you try at least gnome 3.20 ?
Comment 2 neumond 2016-08-30 03:20:04 UTC
Still happens on 3.20.
Comment 3 Rui Matos 2016-08-30 10:25:37 UTC
Please run "xev -event keyboard" and press the A key, then press ctrl+shift, then press A again and finally copy all the output you should have in the terminal here.
Comment 4 6alfalfa9 2017-07-16 11:22:19 UTC
Hello, Rui. Here's the output of command you asked for.

```
$ gnome-shell --version
GNOME Shell 3.24.2
$ xev -event keyboard
Outer window is 0x2800001, inner window is 0x2800002

KeymapNotify event, serial 24, synthetic NO, window 0x0,
    keys:  4294967239 0   0   0   16  0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 25, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49732605, (1135,941), root:(1211,1146),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
"   XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49734648, (1135,941), root:(1211,1146),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49734796, (1135,941), root:(1211,1146),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49735989, (1135,941), root:(1211,1146),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeymapNotify event, serial 28, synthetic NO, window 0x0,
    keys:  4294967284 0   0   0   32  0   4   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49736269, (1135,941), root:(1211,1146),
    state 0x2004, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49736338, (1135,941), root:(1211,1146),
    state 0x2000, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49738933, (1135,941), root:(1211,1146),
    state 0x2000, keycode 38 (keysym 0x6c6, Cyrillic_ef), same_screen YES,
    XLookupString gives 2 bytes: (d1 84) "ф"
    XmbLookupString gives 2 bytes: (d1 84) "ф"
    XFilterEvent returns: False

KeyRelease event, serial 28, synthetic NO, window 0x2800001,
    root 0xf4, subw 0x0, time 49739072, (1135,941), root:(1211,1146),
    state 0x2000, keycode 38 (keysym 0x6c6, Cyrillic_ef), same_screen YES,
    XLookupString gives 2 bytes: (d1 84) "ф"
    XFilterEvent returns: False

ClientMessage event, serial 28, synthetic YES, window 0x2800001,
    message_type 0x135 (WM_PROTOCOLS), format 32, message 0x133 (WM_DELETE_WINDOW)
```

As you can see I experience the same bug with another version of gnome.
Specifically: changing layout while creating bookmark in firefox in popup window closes the window.
Pressing Alt also closes window.

I've tried to google the problem and found the exact same problem:
[Bug 1091628 - Pressing any global keyboard shortcut causes temporary loss of focus](https://bugzilla.redhat.com/show_bug.cgi?id=1091628)
Another, probably unrelated bug: 
[442886 - Bookmark dialog closes unexpectedly when entering an Alt code](https://bugzilla.mozilla.org/show_bug.cgi?id=442886)
Comment 5 6alfalfa9 2017-07-16 11:23:29 UTC
This bug is a possible duplicate of bug 700316.
Comment 6 GNOME Infrastructure Team 2021-07-05 14:12:50 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.