Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts don't work in AppVMs when keyboard layout is switched to non-us #6690

Closed
na-- opened this issue Jun 11, 2021 · 7 comments · Fixed by QubesOS/qubes-gui-agent-linux#139
Labels
C: other diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. r4.1-bullseye-stable r4.1-buster-stable r4.1-centos-stream8-cur-test r4.1-dom0-stable r4.1-fc31-stable r4.1-fc32-stable r4.1-fc33-stable r4.1-fc34-stable updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.
Milestone

Comments

@na--
Copy link

na-- commented Jun 11, 2021

Qubes OS version

4.1

Are you using any testing repositories? If so, please list them and where they are enabled (i.e., dom0, TemplateVM, or StandaloneVM).

Yes, enabled qubes-*testing and only in dom0.

Are you providing feedback about a specific package or packages in testing?

Not a specific version, this is feedback on how keyboard layout switching works in general in gui-agent-linux for Qubes 4.1

Affected component(s) or functionality

/usr/lib/qubes/qubes-keymap.sh (and the corresponding dom0 component, whatever that is)

Brief summary

If I have multiple separate keyboard layouts configured in dom0, say us,bg, keyboard shortcuts (Ctrl+C, Ctrl+W, etc.) in AppVMs break when I switch to the non-us layout.

If I kill qubes-keymap.sh and manually run something like setxkbmap -layout "us,bg" -variant ",phonetic" -option grp:alt_shift_toggle in the AppVM, keyboard shortcuts will work in both bg and en layouts.

How Reproducible

Completely

To Reproduce

Steps to reproduce the behavior:

  1. Configure multiple keyboard layouts in dom0
  2. Switch to a non-us one
  3. Verify that you've successfully switch to it in the AppVM by typing a few characters
  4. Try hitting a Ctrl+C in a terminal an notice it doesn't do anything

Expected behavior

Keyboard shortcuts work in all keyboard layouts.

Actual behavior

Keyboard shortcuts don't work in anything except the us layout.

Additional context

I added some debugging to see exactly what setxkbmap commands get called by /usr/lib/qubes/qubes-keymap.sh when I switch layouts, and this is what I got:

QUBES_KEYMAP=bg+phonetic+grp:alt_shift_toggle
setxkbmap -display :0 -layout bg -variant phonetic -option grp:alt_shift_toggle

QUBES_KEYMAP=bg+phonetic+grp:alt_shift_toggle
setxkbmap -display :0 -layout bg -variant phonetic -option grp:alt_shift_toggle

QUBES_KEYMAP=us++grp:alt_shift_toggle
setxkbmap -display :0 -layout us -option grp:alt_shift_toggle

QUBES_KEYMAP=us++grp:alt_shift_toggle
setxkbmap -display :0 -layout us -option grp:alt_shift_toggle

Not sure why setxkbmap gets called twice on every layout shift, that's probably another more minor bug (the second call doesn't really matter). But it's obvious that it's leaving just a single layout enabled in the AppVM at any one time, and keyboard shortcuts are broken when that's not en.

Solutions you've tried

As mentioned before, killing qubes-keymap.sh and manually setting setxkbmap -layout "us,bg" -variant ",phonetic" -option grp:ctrl_shift_toggle in the AppVM works, keyboard shortcuts work even in the bg layout.

So, my suggested solution here is for qubes-keymap.sh to leave all of the enabled layouts in the AppVMs instead of just a single one, just to shift which one is first. Something like this, with my example:

setxkbmap -layout "us,bg" -variant ",phonetic" -option grp:ctrl_shift_toggle # when in English
setxkbmap -layout "bg,us" -variant "phonetic," -option grp:ctrl_shift_toggle # when in Bulgarian

For some reason, this makes shortcuts work even when the active layout is not us (see 1, 2, 3) 🤷‍♂️

I'd be willing to try submitting a patch if someone points me to the dom0 code that's updating the keyboard-layout qubesdb property.

Related, non-duplicate issues

None that I could find, most of the keyboard layout issues were about QubesOS 4.0 or earlier, not 4.1.

@na-- na-- added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug labels Jun 11, 2021
@andrewdavidwong andrewdavidwong added C: other updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable. needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Jun 11, 2021
@andrewdavidwong andrewdavidwong added this to the Release 4.1 milestone Jun 11, 2021
jevank added a commit to jevank/qubes-gui-agent-linux that referenced this issue Jul 2, 2021
Setting only non-latin layout breaks hotkeys in various applications, so setup secondary 'us' to propagated from dom0.

Fixes QubesOS/qubes-issues#5431
Fixes QubesOS/qubes-issues#6690
jevank added a commit to jevank/qubes-gui-agent-linux that referenced this issue Jul 6, 2021
Setting only non-latin layout breaks hotkeys in various applications, so setup secondary 'us' to propagated from dom0.

Fixes QubesOS/qubes-issues#5431
Fixes QubesOS/qubes-issues#6690
@qubesos-bot
Copy link

Automated announcement from builder-github

The package pulseaudio-qubes-4.1.20-1.fc32 has been pushed to the r4.1 testing repository for dom0.
To test this update, please install it with the following command:

sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package gui-agent-linux has been pushed to the r4.1 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.1-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-gui-agent_4.1.20-1 has been pushed to the r4.1 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing buster-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component gui-agent-linux (including package pulseaudio-qubes-4.1.20-1.fc32) has been pushed to the r4.1 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.1-current-testing

Changes included in this update

@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Jul 9, 2021
@qubesos-bot
Copy link

Automated announcement from builder-github

The package qubes-gui-agent_4.1.21-1+deb10u1 has been pushed to the r4.1 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component gui-agent-linux (including package pulseaudio-qubes-4.1.21-1.fc32) has been pushed to the r4.1 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package pulseaudio-qubes-4.1.21-1.fc32 has been pushed to the r4.1 stable repository for dom0.
To install this update, please use the standard update command:

sudo qubes-dom0-update

Or update dom0 via Qubes Manager.

Changes included in this update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: other diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. r4.1-bullseye-stable r4.1-buster-stable r4.1-centos-stream8-cur-test r4.1-dom0-stable r4.1-fc31-stable r4.1-fc32-stable r4.1-fc33-stable r4.1-fc34-stable updates testing Issue regarding an update that is currently in testing. Triage before migrating update to stable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants