[GH-ISSUE #395] Keyboard layout resets to default on every modifier key press when using multiple XKB layouts #263

Open
opened 2026-10-15 12:58:59 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @Afmer on GitHub (Apr 20, 2026).
Original GitHub issue: https://github.com/games-on-whales/wolf/issues/395

When configuring multiple keyboard layouts in Sway (e.g. xkb_layout "ru,us"), pressing any modifier key (Ctrl, Shift, Alt, Super) resets the active layout back to the first one in the list, making it impossible to maintain a non-default layout while streaming.

Steps to reproduce:

  1. Configure multiple XKB layouts in Sway config:
    input "0:0:wayland-keyboard-seat-0" {
        xkb_layout "ru,us"
    }
    
  2. Switch to the second layout via swaymsg input type:keyboard xkb_switch_layout next
  3. Press any modifier key (Ctrl, Shift, Alt)
  4. Layout immediately resets back to the first one (ru)

Root cause:

Using wev to inspect Wayland events, every modifier key press sends group: 0 in the wl_keyboard.modifiers event, which resets the XKB layout group to the first layout:

[14:     wl_keyboard] key: serial: 253; time: 17641436; key: 37; state: 1 (pressed)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000004: Control
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] modifiers: serial: 1; group: 0
                      depressed: 00000004: Control
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 256; time: 17643243; key: 37; state: 0 (released)
                      sym: Control_L    (65507), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

The group field is always 0 regardless of the currently active layout. Wolf/inputtino should preserve the current XKB group when forwarding modifier events instead of always sending group: 0.

Expected behavior:

group in wl_keyboard.modifiers should reflect the currently active layout group, not always be 0.

Environment:

  • Wolf version: stable (org.opencontainers.image.version: stable, GStreamer 1.26.7, Gamescope 3.15.14)
  • Host OS: Arch Linux x86_64, kernel 6.19.11-zen1-1-zen
  • CPU: AMD Ryzen 9 9900X
  • GPU: NVIDIA GeForce RTX 4060 Ti 16GB
  • Moonlight Qt: 6.1.0 (macOS)
  • Artemis Qt: 0.6.7-dev.20250831.0017+afe2de7 (macOS) — issue reproduced on both clients
  • Container: ghcr.io/games-on-whales/prismlauncher:edge
  • Compositor: Sway
Originally created by @Afmer on GitHub (Apr 20, 2026). Original GitHub issue: https://github.com/games-on-whales/wolf/issues/395 When configuring multiple keyboard layouts in Sway (e.g. `xkb_layout "ru,us"`), pressing any modifier key (Ctrl, Shift, Alt, Super) resets the active layout back to the first one in the list, making it impossible to maintain a non-default layout while streaming. **Steps to reproduce:** 1. Configure multiple XKB layouts in Sway config: ``` input "0:0:wayland-keyboard-seat-0" { xkb_layout "ru,us" } ``` 2. Switch to the second layout via `swaymsg input type:keyboard xkb_switch_layout next` 3. Press any modifier key (Ctrl, Shift, Alt) 4. Layout immediately resets back to the first one (`ru`) **Root cause:** Using `wev` to inspect Wayland events, every modifier key press sends `group: 0` in the `wl_keyboard.modifiers` event, which resets the XKB layout group to the first layout: ``` [14: wl_keyboard] key: serial: 253; time: 17641436; key: 37; state: 1 (pressed) sym: Control_L (65507), utf8: '' [14: wl_keyboard] modifiers: serial: 0; group: 0 depressed: 00000004: Control latched: 00000000 locked: 00000000 [14: wl_keyboard] modifiers: serial: 1; group: 0 depressed: 00000004: Control latched: 00000000 locked: 00000000 [14: wl_keyboard] key: serial: 256; time: 17643243; key: 37; state: 0 (released) sym: Control_L (65507), utf8: '' [14: wl_keyboard] modifiers: serial: 0; group: 0 depressed: 00000000 latched: 00000000 locked: 00000000 ``` The `group` field is always `0` regardless of the currently active layout. Wolf/inputtino should preserve the current XKB group when forwarding modifier events instead of always sending `group: 0`. **Expected behavior:** `group` in `wl_keyboard.modifiers` should reflect the currently active layout group, not always be `0`. **Environment:** - **Wolf version:** `stable` (`org.opencontainers.image.version: stable`, GStreamer 1.26.7, Gamescope 3.15.14) - **Host OS:** Arch Linux x86_64, kernel 6.19.11-zen1-1-zen - **CPU:** AMD Ryzen 9 9900X - **GPU:** NVIDIA GeForce RTX 4060 Ti 16GB - **Moonlight Qt:** 6.1.0 (macOS) - **Artemis Qt:** 0.6.7-dev.20250831.0017+afe2de7 (macOS) — issue reproduced on both clients - **Container:** `ghcr.io/games-on-whales/prismlauncher:edge` - **Compositor:** Sway
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolf#263
No description provided.