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 752165 - unable to toggle languages when running gnome under wayland
unable to toggle languages when running gnome under wayland
Status: RESOLVED NOTGNOME
Product: mutter
Classification: Core
Component: wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
: 754537 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-07-09 12:03 UTC by matanya
Modified: 2015-11-23 15:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix changing the layout on x11 backend (861 bytes, patch)
2015-07-23 09:09 UTC, Marek Chalupa
none Details | Review

Description matanya 2015-07-09 12:03:01 UTC
I logged in to gnome using wayland as window server. I then tried to toggle between Hebrew and English, and failed. Only English works.
Comment 1 Jasper St. Pierre (not reading bugmail) 2015-07-09 15:56:57 UTC
Can you go through the steps you used to change your language, and what you saw as the result?
Comment 2 matanya 2015-07-09 17:48:17 UTC
sure.

How to reproduce:

Login using gnome with X

1. configure two or more languages in gnome.
2. configure a toggle key, i use CAPS or alt-shift.
3. switch languages using the keys selected in step 2.
4. It works!
5. logout
6. Login using gnome with wayland
7. switch languages using the keys selected in step 2.
8. It Doesn't work!
Comment 3 Jasper St. Pierre (not reading bugmail) 2015-07-09 18:12:00 UTC
So you're talking about switching input methods or keyboard layouts here, not about choosing which language strings are localized into. OK.

Does Super+Space work? It could just be an issue with the mods-only bindings here.
Comment 4 matanya 2015-07-09 19:38:17 UTC
Thank you, no, that doesn't work either.
Comment 5 Jonas Ådahl 2015-07-10 03:18:19 UTC
I can switch between different input methods in GNOME Wayland. One issue though that I have been looking at is that it takes two changes for the change to take effect for X11 clients. The same thing seems to happen in weston though, so I don't think its GNOME specific. In other words, to change from US to SE, I need to "change" to SE twice.

Can you check whether this is the case? In other words, try this:

1. Switch to language 1 (with Super+Space)
2. Switch to language 2 (with Super+Space)
3. Switch to language 2 again (with Super+Space, without switching to language 1 in between)

and between every step, check what keyboard layout is active in Wayland clients and X11 clients.
Comment 6 Rui Matos 2015-07-14 09:20:25 UTC
If this only happens on X11 clients then it's probably an Xwayland bug which I had a patch to fix but never got much support and didn't get merged:

http://lists.x.org/archives/xorg-devel/2014-July/043080.html

The real fix is a complete overhaul of Xwayland's keyboard input to avoid going through the XKB machinery.
Comment 7 Jonas Ådahl 2015-07-14 09:26:57 UTC
(In reply to Rui Matos from comment #6)
> If this only happens on X11 clients then it's probably an Xwayland bug which
> I had a patch to fix but never got much support and didn't get merged:
> 
> http://lists.x.org/archives/xorg-devel/2014-July/043080.html
> 
> The real fix is a complete overhaul of Xwayland's keyboard input to avoid
> going through the XKB machinery.

Is it really the same issue?

The issue I'm seeing is that the keymap is incorrect (Xwayland needs to wl_keyboard.keymap events for the change to take effect or something like that). How is that related to incorrect modifier state which AFAICS is what the patch you link to is about?
Comment 8 Rui Matos 2015-07-14 09:45:23 UTC
(In reply to Jonas Ådahl from comment #7)
> The issue I'm seeing is that the keymap is incorrect (Xwayland needs to
> wl_keyboard.keymap events for the change to take effect or something like
> that). How is that related to incorrect modifier state which AFAICS is what
> the patch you link to is about?

Not sure it's the same issue. But note that the current layout is determined by the so called group index (aka xkb_layout_index_t in libxkbcommon) which is part of the modifier state.
Comment 9 Marek Chalupa 2015-07-23 09:02:17 UTC
(In reply to Rui Matos from comment #8)
> (In reply to Jonas Ådahl from comment #7)
> > The issue I'm seeing is that the keymap is incorrect (Xwayland needs to
> > wl_keyboard.keymap events for the change to take effect or something like
> > that). How is that related to incorrect modifier state which AFAICS is what
> > the patch you link to is about?
> 
> Not sure it's the same issue. But note that the current layout is determined
> by the so called group index (aka xkb_layout_index_t in libxkbcommon) which
> is part of the modifier state.

I think it is this issue. Debugging shows that the mutter sends the right group, but Xwayland is not updating it. Unconditionally updating the group index on any modifiers event fixes the issue for me.
Comment 10 Marek Chalupa 2015-07-23 09:09:42 UTC
Created attachment 307974 [details] [review]
Fix changing the layout on x11 backend

Just part of the fix - on X11 backend switching layouts does not work at all (no matter if the client is X11 or Wayland). With this patch, the X11 and native backends will work the same, only the Xwayland part of fix left.
Comment 11 Rui Matos 2015-07-23 16:16:25 UTC
(In reply to Marek Chalupa from comment #10)
> Created attachment 307974 [details] [review] [review]
> Fix changing the layout on x11 backend
> 
> Just part of the fix - on X11 backend switching layouts does not work at all
> (no matter if the client is X11 or Wayland). With this patch, the X11 and
> native backends will work the same, only the Xwayland part of fix left.

Does this fix anything for you? See https://git.gnome.org/browse/mutter/commit/?id=59c5ac0cb57769ed635372e17deddafcbe3a4589 for why this isn't needed.
Comment 12 Marek Chalupa 2015-07-27 07:41:21 UTC
(In reply to Rui Matos from comment #11)
> (In reply to Marek Chalupa from comment #10)
> > Created attachment 307974 [details] [review] [review] [review]
> > Fix changing the layout on x11 backend
> > 
> > Just part of the fix - on X11 backend switching layouts does not work at all
> > (no matter if the client is X11 or Wayland). With this patch, the X11 and
> > native backends will work the same, only the Xwayland part of fix left.
> 
> Does this fix anything for you? See
> https://git.gnome.org/browse/mutter/commit/
> ?id=59c5ac0cb57769ed635372e17deddafcbe3a4589 for why this isn't needed.

Sorry, the commit message is a little bit wrong. I meant when running gnome-shell --wayland on clutter X11 backend, as a nested X11 client.
Comment 13 Rui Matos 2015-09-03 15:36:29 UTC
*** Bug 754537 has been marked as a duplicate of this bug. ***
Comment 14 Dmitry Shachnev 2015-09-03 15:43:48 UTC
As my bug was marked as a duplicate of this one, I will paste here results of my testing (with gnome-shell 3.17.90). I use CapsLock as a modifier-only shortcut to switch layouts.

* When I press CapsLock, the indicator updates correctly.
* Native Wayland clients correctly update the layouts.
* The problem is only with XWayland clients, which keep using the previous layout.
* If I change the layout using the indicator drop-down menu, or using switch-input-source shortcut (i.e. Super+Space), it works fine even for XWayland clients. So only modifier-only switching is broken.

This is with gnome-shell 3.17.90, xwayland 1.17.2.
Comment 15 Jens Georg 2015-11-21 19:49:30 UTC
Seeing the same behavior here as Dimitry.

gnome-shell 3.18.2, xwayland 1.17.2
Comment 16 Rui Matos 2015-11-23 15:34:58 UTC
(In reply to Jens Georg from comment #15)
> Seeing the same behavior here as Dimitry.
> 
> gnome-shell 3.18.2, xwayland 1.17.2

It should be fixed in xwayland >= 1.18.0 . Can one of you confirm?
Comment 17 bordjukov 2015-11-23 15:43:55 UTC
Running 1.18.0 on Arch, can confirm I'm not experiencing the bug.
Comment 18 Rui Matos 2015-11-23 15:50:30 UTC
Thanks, closing. Feel free to re-open if you can still reproduce with xwayland >= 1.18.0