gui, audio: ensure guivm and audiovm tag are set

This commit is contained in:
Frédéric Pierret (fepitre) 2020-02-27 10:31:28 +01:00
parent 795ff1233a
commit 8f67334c4f
No known key found for this signature in database
GPG Key ID: 484010B5CDC576E2
2 changed files with 16 additions and 1 deletions

View File

@ -22,7 +22,14 @@ import qubes.ext
class AUDIO(qubes.ext.Extension):
# pylint: disable=too-few-public-methods
# pylint: disable=unused-argument,no-self-use
@qubes.ext.handler('domain-init', 'domain-load')
def on_domain_init_load(self, vm, event):
if getattr(vm, 'audiovm', None):
if 'audiovm-' + vm.audiovm not in list(vm.tags):
vm.fire_event('property-set:audiovm',
name='audiovm', newvalue=vm.audiovm)
# property-del <=> property-reset-to-default
@qubes.ext.handler('property-del:audiovm')
def on_property_del(self, subject, event, name, oldvalue=None):

View File

@ -35,6 +35,14 @@ class GUI(qubes.ext.Extension):
if vm.features.get('gui-seamless', False)
else 'FULLSCREEN'))
# pylint: disable=unused-argument,no-self-use
@qubes.ext.handler('domain-init', 'domain-load')
def on_domain_init_load(self, vm, event):
if getattr(vm, 'guivm', None):
if 'guivm-' + vm.guivm not in list(vm.tags):
vm.fire_event('property-set:guivm',
name='guivm', newvalue=vm.guivm)
# property-del <=> property-reset-to-default
@qubes.ext.handler('property-del:guivm')
def on_property_del(self, subject, event, name, oldvalue=None):