Keyboard layout switching shortcut not working

Summary

My problem is that when I select multiple keyboard layouts in dom0 that are different than the layout selected during installation, I am unable to switch between them in appVMs. When I press the combination to switch layouts, it switches to the layout selected during installation rather than the second layout I set in the kxb settings.

This sounds like a weird use case, but I can’t select the layout I actually prefer to use during installation because it’s a custom one that I added to /usr/share/X11/xkb/symbols to contain symbols for multiple different languages, and then I need a second layout for a language without latin characters. In any case, I think it should be possible to set keyboard layouts in dom0 after installation and have them be respected in the appVMs.

Details

In dom0, I have the following /etc/X11/xorg.conf.d/00-keyboard.conf

Section "InputClass"
  Identifier "system-keyboard"
  MatchIsKeyboard "on"
  Option "XkbLayout" "lang1,lang2"
  Option "XkbOptions" "grp:win_space_toggle"
  Option "XkbVariant" "variant1,variant2"
EndSection

This works as expected in dom0. It starts in lang1-variant1, and if i press win_space, it switches to lang2-variant2. I can also get

user@dom0 $ setxkbmap -query
rules: evdev
model: pc105
layout: lang1,lang2
variant: variant1,variant2
options: grp:win_space_toggle

I copied /etc/X11/xorg.conf.d/00-keyboard.conf into every template I use, which worked great when I only used my one custom keyboard layout. Now if I start an appVM, it begins in lang1-variant1 like expected, but instead of being configured as described in /etc/X11/xorg.conf.d/00-keyboard.conf, it is configured with the ‘us’ layout (the default I installed with) as the second available layout.

user@appVM $ setxkbmap -query
rules: evdev
model: pc105
layout: lang1,us
variant: variant1,
options: grp:win_space_toggle

And even stranger, if I press win_space, it switches to the ‘us’ layout, and the layout setting changes to

user@appVM $ setxkbmap -query
rules: evdev
model: pc105
layout: lang2,us
variant: variant2,
options: grp:win_space_toggle

I think what’s happening is that the toggle combination (win_space) is switching the layout in dom0 beteen lang1 and lang2 (which somehow also calls setxkbmap in the appVM) and is simultaneously switching the layout in the appVM between whatever dom0 is set to and ‘us’. If I press win_space with the focus outside of the appVM, then it only switches in dom0, and then I’m able to switch in the appVM between lang2 and ‘us’. So I’m able to access both of my layouts by switching focus, pressing win_space, and switching focus back, but that isn’t very nice.

How should I set this up?