From 7ad15769dc794b4330854f0bfe21318c28731d87 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 17 Mar 2018 12:05:42 -0400 Subject: [PATCH] virt-manager: fix git startup on wayland Apparently we need to do these env settings much earlier... --- virt-manager | 5 +++++ virtManager/config.py | 9 ++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/virt-manager b/virt-manager index 7450a305c..281b5b685 100755 --- a/virt-manager +++ b/virt-manager @@ -197,6 +197,11 @@ def main(): import libvirt virtManager.module_trace.wrap_module(libvirt, regex=None) + # With F27 gnome+wayland we need to set these before GTK import + os.environ["GSETTINGS_SCHEMA_DIR"] = CLIConfig.gsettings_dir + if options.test_first_run: + os.environ["GSETTINGS_BACKEND"] = "memory" + # Now we've got basic environment up & running we can fork do_drop_stdio = False if not options.no_fork and not options.debug: diff --git a/virtManager/config.py b/virtManager/config.py index a7457b748..1b8e47887 100644 --- a/virtManager/config.py +++ b/virtManager/config.py @@ -37,12 +37,8 @@ class _SettingsWrapper(object): we internally convert it to the settings nested hierarchy. Makes client code much smaller. """ - def __init__(self, settings_id, schemadir, test_first_run): + def __init__(self, settings_id): self._root = settings_id - - os.environ["GSETTINGS_SCHEMA_DIR"] = schemadir - if test_first_run: - os.environ["GSETTINGS_BACKEND"] = "memory" self._settings = Gio.Settings.new(self._root) self._settingsmap = {"": self._settings} @@ -185,8 +181,7 @@ class vmmConfig(object): self.test_first_run = bool(test_first_run) self.test_leak_debug = False - self.conf = _SettingsWrapper("org.virt-manager.virt-manager", - CLIConfig.gsettings_dir, self.test_first_run) + self.conf = _SettingsWrapper("org.virt-manager.virt-manager") # We don't create it straight away, since we don't want # to block the app pending user authorization to access