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