Skip to content

Commit be93388

Browse files
committed
Fix issues in terms of 'global scope'
1 parent 88c7b60 commit be93388

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"_generated": "Generated by SweetTooth, do not edit",
3-
"description": "Close and save open windows. And restore them. Most importantly, it supports both X11 and Wayland!\n\nMain features:\n- Close open windows\n- Save open windows\n- Restore saved open windows\n- Restore window state, including Always on Top, Always on Visible Workspace and maximization\n- Restore window workspace, size and position\n- Move windows to their own workspace according to a saved session\n- Support multi-monitor\n- Trash saved session\n- Search saved session by the session name fuzzily",
3+
"description": "Close and save open windows. And restore them. Most importantly, it supports both X11 and Wayland!\n\nMain features:\n- Close open windows\n- Save open windows\n- Restore session(s)\n- Restore a session at startup. Please note that this feature is disabled by default. See https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager#how-to-restore-a-session-at-startup to learn how to enable and use it.\n- Restore window state, including Always on Top, Always on Visible Workspace and maximization\n- Restore window workspace, size and position\n- Move windows to their own workspace according to a saved session\n- Support multi-monitor\n- Trash saved session\n- Search saved session by the session name fuzzily",
44
"name": "Another Window Session Manager",
55
"shell-version": [
66
"40",
@@ -9,5 +9,5 @@
99
],
1010
"url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
1111
"uuid": "another-window-session-manager@gmail.com",
12-
"version": 14
12+
"version": 15
1313
}

restoreSession.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,11 @@ var RestoreSession = class {
182182
}
183183

184184
destroy() {
185+
if (restoringApps) {
186+
restoringApps.clear();
187+
restoringApps = null;
188+
}
189+
185190
if (this._restoredApps) {
186191
this._restoredApps.clear();
187192
this._restoredApps = null;

ui/autostart.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ const PrefsUtils = Me.imports.utils.prefsUtils;
2626
const FileUtils = Me.imports.utils.fileUtils;
2727

2828

29-
const autostartDbusXml = ByteArray.toString(
30-
Me.dir.get_child('dbus-interfaces').get_child('org.gnome.Shell.Extensions.awsm.Autostart.xml').load_contents(null)[1]
31-
);
32-
3329
var AutostartServiceProvider = GObject.registerClass(
3430
class AutostartServiceProvider extends GObject.Object {
3531

@@ -38,6 +34,9 @@ var AutostartServiceProvider = GObject.registerClass(
3834

3935
this._log = new Log.Log();
4036

37+
this._autostartDbusXml = ByteArray.toString(
38+
Me.dir.get_child('dbus-interfaces').get_child('org.gnome.Shell.Extensions.awsm.Autostart.xml').load_contents(null)[1]);
39+
4140
this._autostartService = null;
4241
this._autostartDbusImpl = null;
4342

@@ -61,7 +60,7 @@ var AutostartServiceProvider = GObject.registerClass(
6160

6261
// Gio.DBusExportedObject.wrapJSObject(interfaceInfo, jsObj) is a private method of gjs
6362
// See: https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/core/overrides/Gio.js#L391
64-
this._autostartDbusImpl = Gio.DBusExportedObject.wrapJSObject(autostartDbusXml, this._autostartService);
63+
this._autostartDbusImpl = Gio.DBusExportedObject.wrapJSObject(this._autostartDbusXml, this._autostartService);
6564
this._autostartDbusImpl.export(connection, '/org/gnome/Shell/Extensions/awsm');
6665

6766
}

0 commit comments

Comments
 (0)