[gnome-shell] runDialog: Reload resource on 'rt'
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] runDialog: Reload resource on 'rt'
- Date: Wed, 21 Oct 2015 18:55:14 +0000 (UTC)
commit 0b9e68e3056a0672832d6ca7cdfbe3b1275b0b5d
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Oct 21 19:27:19 2015 +0200
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 8844dc6..3770403 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 495567f..757e782 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();
})
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]