Merge remote-tracking branch 'origin/pr/319'

* origin/pr/319:
  gui: set xkb_layout manually
  tests: handle legacy layout
  gui: no check in subprocess.run
  gui: handle legacy keymap setting /qubes-keyboard
This commit is contained in:
Marek Marczykowski-Górecki 2020-03-08 01:29:21 +01:00
commit 283d251387
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 18 additions and 0 deletions

View File

@ -79,6 +79,16 @@ class GUI(qubes.ext.Extension):
if kbd_layout: if kbd_layout:
vm.untrusted_qdb.write('/keyboard-layout', kbd_layout) vm.untrusted_qdb.write('/keyboard-layout', kbd_layout)
# Legacy value for setting keyboard layout
xkb_keymap = \
'xkb_keymap {\x0a\x09xkb_keycodes { include ' \
'"evdev"\x09};\x0a\x09xkb_types { include ' \
'"complete"\x09};\x0a\x09xkb_compat { include ' \
'"complete"\x09};\x0a\x09xkb_symbols { include ' \
'"pc+%s+inet(evdev)"\x09};\x0a\x09xkb_geometry ' \
'{ include "pc(pc105)"\x09};\x0a};' % kbd_layout
vm.untrusted_qdb.write('/qubes-keyboard', xkb_keymap)
# Set GuiVM prefix # Set GuiVM prefix
guivm_windows_prefix = vm.features.get('guivm-windows-prefix', 'GuiVM') guivm_windows_prefix = vm.features.get('guivm-windows-prefix', 'GuiVM')
if vm.features.get('service.guivm-gui-agent', None): if vm.features.get('service.guivm-gui-agent', None):

View File

@ -1833,6 +1833,13 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
vm.netvm = None vm.netvm = None
vm.guivm = guivm vm.guivm = guivm
guivm.features['keyboard-layout'] = 'fr' guivm.features['keyboard-layout'] = 'fr'
xkb_keymap = \
'xkb_keymap {\x0a\x09xkb_keycodes { include ' \
'"evdev"\x09};\x0a\x09xkb_types { include ' \
'"complete"\x09};\x0a\x09xkb_compat { include ' \
'"complete"\x09};\x0a\x09xkb_symbols { include ' \
'"pc+fr+inet(evdev)"\x09};\x0a\x09xkb_geometry ' \
'{ include "pc(pc105)"\x09};\x0a};'
vm.events_enabled = True vm.events_enabled = True
test_qubesdb = TestQubesDB() test_qubesdb = TestQubesDB()
mock_qubesdb.write.side_effect = test_qubesdb.write mock_qubesdb.write.side_effect = test_qubesdb.write
@ -1843,6 +1850,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase):
'/name': 'test-inst-appvm', '/name': 'test-inst-appvm',
'/type': 'AppVM', '/type': 'AppVM',
'/default-user': 'user', '/default-user': 'user',
'/qubes-keyboard': xkb_keymap,
'/keyboard-layout': 'fr', '/keyboard-layout': 'fr',
'/qubes-vm-type': 'AppVM', '/qubes-vm-type': 'AppVM',
'/qubes-gui-domain-xid': '{}'.format(guivm.xid), '/qubes-gui-domain-xid': '{}'.format(guivm.xid),