[gnome-shell/f20] Backport upstream patch to catch more extension errors
Florian Müllner
fmuellner at fedoraproject.org
Thu Nov 28 11:52:14 UTC 2013
commit 5201ab83436c44e41c4a52147ac70c3161f73fb0
Author: Florian Müllner <fmuellner at gnome.org>
Date: Thu Nov 28 11:13:25 2013 +0000
Backport upstream patch to catch more extension errors
Extensions are temporarily disabled while the screen is locked;
when an extension throws an error when re-enabled, no further
extension is enabled after that.
Backport the upstream fix to address that.
...e-errors-on-extensions-enable-and-disable.patch | 132 ++++++++++++++++++++
gnome-shell.spec | 7 +-
2 files changed, 138 insertions(+), 1 deletions(-)
---
diff --git a/0001-catch-more-errors-on-extensions-enable-and-disable.patch b/0001-catch-more-errors-on-extensions-enable-and-disable.patch
new file mode 100644
index 0000000..6789d78
--- /dev/null
+++ b/0001-catch-more-errors-on-extensions-enable-and-disable.patch
@@ -0,0 +1,132 @@
+From f4f2c91fdf9e0f1dffae96e673ebb92effb0d852 Mon Sep 17 00:00:00 2001
+From: Sebastien Lafargue <slaf66 at gmail.com>
+Date: Fri, 25 Oct 2013 15:28:11 +0200
+Subject: [PATCH] catch more errors on extensions enable() and disable()
+
+https://bugzilla.gnome.org/show_bug.cgi?id=688331
+---
+ js/ui/extensionSystem.js | 50 +++++++++++++++++++++++++++---------------------
+ 1 file changed, 28 insertions(+), 22 deletions(-)
+
+diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
+index a929451..dde7b82 100644
+--- a/js/ui/extensionSystem.js
++++ b/js/ui/extensionSystem.js
+@@ -76,7 +76,11 @@ function disableExtension(uuid) {
+ theme.unload_stylesheet(extension.stylesheet.get_path());
+ }
+
+- extension.stateObj.disable();
++ try {
++ extension.stateObj.disable();
++ } catch(e) {
++ logExtensionError(uuid, e);
++ }
+
+ for (let i = 0; i < order.length; i++) {
+ let uuid = order[i];
+@@ -89,8 +93,10 @@ function disableExtension(uuid) {
+
+ extensionOrder.splice(orderIdx, 1);
+
+- extension.state = ExtensionState.DISABLED;
+- _signals.emit('extension-state-changed', extension);
++ if ( extension.state != ExtensionState.ERROR ) {
++ extension.state = ExtensionState.DISABLED;
++ _signals.emit('extension-state-changed', extension);
++ }
+ }
+
+ function enableExtension(uuid) {
+@@ -117,10 +123,15 @@ function enableExtension(uuid) {
+ }
+ }
+
+- extension.stateObj.enable();
+-
+- extension.state = ExtensionState.ENABLED;
+- _signals.emit('extension-state-changed', extension);
++ try {
++ extension.stateObj.enable();
++ extension.state = ExtensionState.ENABLED;
++ _signals.emit('extension-state-changed', extension);
++ return;
++ } catch(e) {
++ logExtensionError(uuid, e);
++ return;
++ }
+ }
+
+ function logExtensionError(uuid, error) {
+@@ -150,7 +161,8 @@ function loadExtension(extension) {
+ } else {
+ let enabled = enabledExtensions.indexOf(extension.uuid) != -1;
+ if (enabled) {
+- initExtension(extension.uuid);
++ if (!initExtension(extension.uuid))
++ return;
+ if (extension.state == ExtensionState.DISABLED)
+ enableExtension(extension.uuid);
+ } else {
+@@ -205,7 +217,12 @@ function initExtension(uuid) {
+ extensionModule = extension.imports.extension;
+
+ if (extensionModule.init) {
+- extensionState = extensionModule.init(extension);
++ try {
++ extensionState = extensionModule.init(extension);
++ } catch(e) {
++ logExtensionError(uuid, e);
++ return false;
++ }
+ }
+
+ if (!extensionState)
+@@ -214,6 +231,7 @@ function initExtension(uuid) {
+
+ extension.state = ExtensionState.DISABLED;
+ _signals.emit('extension-loaded', uuid);
++ return true;
+ }
+
+ function getEnabledExtensions() {
+@@ -235,11 +253,7 @@ function onEnabledExtensionsChanged() {
+ newEnabledExtensions.filter(function(uuid) {
+ return enabledExtensions.indexOf(uuid) == -1;
+ }).forEach(function(uuid) {
+- try {
+ enableExtension(uuid);
+- } catch(e) {
+- logExtensionError(uuid, e);
+- }
+ });
+
+ // Find and disable all the newly disabled extensions: UUIDs found in the
+@@ -247,11 +261,7 @@ function onEnabledExtensionsChanged() {
+ enabledExtensions.filter(function(item) {
+ return newEnabledExtensions.indexOf(item) == -1;
+ }).forEach(function(uuid) {
+- try {
+ disableExtension(uuid);
+- } catch(e) {
+- logExtensionError(uuid, e);
+- }
+ });
+
+ enabledExtensions = newEnabledExtensions;
+@@ -263,11 +273,7 @@ function _loadExtensions() {
+
+ let finder = new ExtensionUtils.ExtensionFinder();
+ finder.connect('extension-found', function(signals, extension) {
+- try {
+- loadExtension(extension);
+- } catch(e) {
+- logExtensionError(extension.uuid, e);
+- }
++ loadExtension(extension);
+ });
+ finder.scanExtensions();
+ }
+--
+1.8.4.2
+
diff --git a/gnome-shell.spec b/gnome-shell.spec
index c826180..3e7c2f4 100644
--- a/gnome-shell.spec
+++ b/gnome-shell.spec
@@ -1,6 +1,6 @@
Name: gnome-shell
Version: 3.10.2.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Window management and application launching for GNOME
Group: User Interface/Desktops
@@ -15,6 +15,7 @@ Patch1: gnome-shell-favourite-apps-firefox.patch
Patch11: 0001-messageTray-Prevent-reentrancy-issues-in-_updateStat.patch
Patch12: 0001-authPrompt-propagate-gdm-reset-signal-after-user-swi.patch
+Patch13: 0001-catch-more-errors-on-extensions-enable-and-disable.patch
%define clutter_version 1.13.4
%define gnome_bluetooth_version 1:3.9.0
@@ -121,6 +122,7 @@ easy to use experience.
%patch11 -p1 -b .fix-message-tray-reentrancy
%patch12 -p1 -b .fix-user-switch-bustification
+%patch13 -p1 -b .catch-more-extension-errors
%build
(if ! test -x configure; then NOCONFIGURE=1 ./autogen.sh; fi;
@@ -180,6 +182,9 @@ glib-compile-schemas --allow-any-name %{_datadir}/glib-2.0/schemas &> /dev/null
%exclude %{_datadir}/gtk-doc
%changelog
+* Thu Nov 28 2013 Florian Müllner <fmuellner at redhat.com> - 3.10.2.1-3
+- Backport upstream fix for catching more extension errors
+
* Mon Nov 25 2013 Ray Strode <rstrode at redhat.com> 3.10.2.1-2
- Pull in user-switch fix from gnome bug #710456
Resolves: #1034031
More information about the scm-commits
mailing list