From e3ae3cdf34cbaf0ed5bca3d02ddc9b67b79bee8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 9 Aug 2015 21:21:47 +0200 Subject: [PATCH] hvm: update appmenus only on the first qubes.NotifyTools call Or more precisely - only when qrexec_installed value is changed from False to True. Previously it was called at each VM startup. --- qubes-rpc/qubes-notify-tools | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qubes-rpc/qubes-notify-tools b/qubes-rpc/qubes-notify-tools index f0ec3b5a..273df90d 100755 --- a/qubes-rpc/qubes-notify-tools +++ b/qubes-rpc/qubes-notify-tools @@ -14,6 +14,7 @@ def main(): print >> sys.stderr, 'This script must be called as qrexec service!' exit(1) + prev_qrexec_installed = False source_vm = None qvm_collection = QubesVmCollection() qvm_collection.lock_db_for_writing() @@ -66,6 +67,7 @@ def main(): else: user = None + prev_qrexec_installed = source_vm.qrexec_installed # Let the tools to be able to enable *or disable* each particular component source_vm.qrexec_installed = qrexec > 0 source_vm.guiagent_installed = gui > 0 @@ -81,11 +83,12 @@ def main(): finally: qvm_collection.unlock_db() - retcode = subprocess.call(['qvm-sync-appmenus', '--force-rpc']) - if retcode == 0 and hasattr(source_vm, 'appmenus_recreate'): - # TODO: call the same for child VMs? This isn't done for Linux VMs, - # so probably should be ignored for Windows also - source_vm.appmenus_recreate() + if not prev_qrexec_installed and source_vm.qrexec_installed: + retcode = subprocess.call(['qvm-sync-appmenus', '--force-rpc']) + if retcode == 0 and hasattr(source_vm, 'appmenus_recreate'): + # TODO: call the same for child VMs? This isn't done for Linux VMs, + # so probably should be ignored for Windows also + source_vm.appmenus_recreate() main()