Public bug reported:

On Ubuntu 26.04 (GNOME Shell 50.1, Wayland session), the XKB layout-
switch option `grp:alt_shift_toggle` is handled by the host even when a
VirtualBox VM window has captured the keyboard. The guest never receives
the second key of Alt+Shift, so its layout cannot be switched with the
same combination.

Steps to reproduce:
1. Host: `org.gnome.desktop.input-sources xkb-options = 
['grp:alt_shift_toggle']`; `org.gnome.mutter.wayland xwayland-allow-grabs = 
true`; `xwayland-grab-access-rules = ['VirtualBox Machine']`.
2. Guest (Ubuntu 26.04) also switches layouts with Alt+Shift.
3. Focus the VM window; VirtualBox shows the keyboard as captured. Press 
Alt+Shift.

Expected: the guest switches its layout; the host layout stays.
Actual: the host switches its layout; `xev` in the guest receives only the 
first key of the pair.

Upstream: https://gitlab.gnome.org/GNOME/mutter/-/issues/991 (open since
2019). `process_iso_next_group()` in `src/core/keybindings.c` does not
check `meta_window_shortcuts_inhibited()`, while `process_overlay_key()`
and `process_event()` do. The proposed fix,
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/987, has been
idle since 2022.

Upstream notes that the same setup works in an Xorg session; 26.04 no
longer ships one, so there is no fallback.

Workaround: on the host, remove `grp:alt_shift_toggle` from xkb-options and run 
`gsettings set org.gnome.desktop.wm.keybindings switch-input-source 
"['<Alt>Shift_L', '<Shift>Alt_L']"`
Regular keybindings respect the inhibitor, so Alt+Shift reaches the VM.

Release (host):
Description: Ubuntu 26.04.1 LTS
Release: 26.04

Package versions (host):
gnome-shell 50.1-0ubuntu1.3
libmutter-18-0 50.1-0ubuntu2.4
VirtualBox 7.2.20r175154

** Affects: mutter (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169737

Title:
  Layout switch shortcut (grp:alt_shift_toggle) is not passed to a VM
  holding a keyboard grab on Wayland

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2169737/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to