summaryrefslogtreecommitdiff
path: root/extra/gnome-shell/git-fixes.patch
blob: 8dbf02d25a382fce1218aed316aaa82fe3308972 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 1880e36..996b363 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -263,10 +263,8 @@ const AuthPrompt = new Lang.Class({
     },
 
     _onReset: function() {
-        if (this.verificationStatus != AuthPromptStatus.VERIFICATION_SUCCEEDED) {
-            this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
-            this.reset();
-        }
+        this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
+        this.reset();
     },
 
     addActorToDefaultButtonWell: function(actor) {
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index eb94554..fb3cf70 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -907,6 +907,10 @@ const LoginDialog = new Lang.Class({
         Main.ctrlAltTabManager.removeGroup(this.dialogLayout);
     },
 
+    cancel: function() {
+        this._authPrompt.cancel();
+    },
+
     addCharacter: function(unichar) {
         this._authPrompt.addCharacter(unichar);
     },
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();
 }
diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js
index c66c9f6..d290a3d 100644
--- a/js/ui/messageTray.js
+++ b/js/ui/messageTray.js
@@ -2392,6 +2392,13 @@ const MessageTray = new Lang.Class({
     // _updateState() figures out what (if anything) needs to be done
     // at the present time.
     _updateState: function() {
+        // If our state changes caused _updateState to be called,
+        // just exit now to prevent reentrancy issues.
+        if (this._updatingState)
+            return;
+
+        this._updatingState = true;
+
         // Filter out acknowledged notifications.
         this._notificationQueue = this._notificationQueue.filter(function(n) {
             return !n.acknowledged;
@@ -2474,6 +2481,8 @@ const MessageTray = new Lang.Class({
         } else if (desktopCloneIsVisible && !desktopCloneShouldBeVisible) {
             this._hideDesktopClone();
         }
+
+        this._updatingState = false;
     },
 
     _tween: function(actor, statevar, value, params) {
@@ -2838,13 +2847,13 @@ const MessageTray = new Lang.Class({
                                                                                   Lang.bind(this, this._onSourceDoneDisplayingContent));
 
         this._summaryBoxPointer.bin.child = child;
-        this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
-                                onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
-
         this._summaryBoxPointer.actor.opacity = 0;
         this._summaryBoxPointer.actor.show();
         this._adjustSummaryBoxPointerPosition();
 
+        this._grabHelper.grab({ actor: this._summaryBoxPointer.bin.child,
+                                onUngrab: Lang.bind(this, this._onSummaryBoxPointerUngrabbed) });
+
         this._summaryBoxPointerState = State.SHOWING;
         this._summaryBoxPointer.show(BoxPointer.PopupAnimation.FULL, Lang.bind(this, function() {
             this._summaryBoxPointerState = State.SHOWN;