From 0b9e68e3056a0672832d6ca7cdfbe3b1275b0b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 21 Oct 2015 19:27:19 +0200 Subject: [PATCH] runDialog: Reload resource on 'rt' Moving the default theme to a resource broke the 'rt' command; reload the resource before the theme to fix it. https://bugzilla.gnome.org/show_bug.cgi?id=738942 --- js/ui/main.js | 13 ++++++++++--- js/ui/runDialog.js | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 8844dc6a6..377040342 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -78,6 +78,7 @@ let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; let _a11ySettings = null; +let _themeResource = null; function _sessionUpdated() { if (sessionMode.isPrimary) @@ -137,9 +138,7 @@ function _initializeUI() { Shell.WindowTracker.get_default(); Shell.AppUsage.get_default(); - let resource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource'); - resource._register(); - + reloadThemeResource(); _loadDefaultStylesheet(); // Setup the stage hierarchy early @@ -290,6 +289,14 @@ function setThemeStylesheet(cssStylesheet) { _cssStylesheet = cssStylesheet ? Gio.File.new_for_path(cssStylesheet) : null; } +function reloadThemeResource() { + if (_themeResource) + _themeResource._unregister(); + + _themeResource = Gio.Resource.load(global.datadir + '/gnome-shell-theme.gresource'); + _themeResource._register(); +} + /** * loadTheme: * diff --git a/js/ui/runDialog.js b/js/ui/runDialog.js index 495567f03..757e7825b 100644 --- a/js/ui/runDialog.js +++ b/js/ui/runDialog.js @@ -61,6 +61,7 @@ const RunDialog = new Lang.Class({ // rt is short for "reload theme" 'rt': Lang.bind(this, function() { + Main.reloadThemeResource(); Main.loadTheme(); }) };