QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
543 stars 48 forks source link

Switching keyboard layout in dom0 affects domUs (and there is not even a visual feedback) #9518

Open emanruse opened 1 month ago

emanruse commented 1 month ago

Qubes OS release

4.2.3

Brief summary

Switching keyboard layout in dom0 affects domU without even providing visual feedback.

Steps to reproduce

  1. Have 2 keyboard layouts - let's call them layout 1 and layout 2
  2. In "Keyobard Layouts" panel item, set behavior

Manage layout: per window Show layout as: image

  1. Open two xfce4-terminals - one in dom0 and one in some domU
  2. Focus the dom0 terminal and switch to layout 2: the country flag changes in panel. Typing in terminal is with the correct layout. All fine.
  3. Focus the domU terminal and type something.

Expected behavior

Focusing on domU terminal should switch the layout flag to that of layout 1 and typing should be with layout 1, i.e. each VM should remember its own layout and not influence others.

Actual behavior

The layout flag does switch to layout 1 but typing is with layout 2.

In a more complicated switching between various VMs and windows it becomes even more confusing.

ben-grande commented 3 weeks ago

I have this noted in a script:

#!/bin/sh
## Make Xfce keyboard settings be applied globally, not per app or window.
## Xfce doesn't let you configure the keyboard properly in one place, it uses
## a separate plugin for some tasks.
## https://docs.xfce.org/panel-plugins/xfce4-xkb-plugin/start
## You can modify the plugin values by:
## - editing the "panel" and adding "keyboard layouts" plugin. After adding
##   the plugin, right click on it and edit its properties. Set "manage
##   layout" to globally.
## - editing the plugin directly in the "settings editor", search for
##   plugin-n, where "n" is a number we don't know and its value is "kxb",
##   search for group-policy and set it to "0".
## - editing the plugin values via commandline with "xfconf" and set
##   "group-policy" value to "0".
set -eu

xkb_plugin="$(xfconf-query -v -c xfce4-panel -p /plugins -l | grep xkb)"
xfconf-query -c xfce4-panel -p "${xkb_plugin}/group-policy" -n -s 0