Skip to content

Commit f2b7937

Browse files
authored
Merge pull request #107 from nlpsuge/feature-support-gnome-46
Support Gnome 46
2 parents a6640e3 + d8a5990 commit f2b7937

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

indicator.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Gio from 'gi://Gio';
66
import GLib from 'gi://GLib';
77
import Shell from 'gi://Shell';
88
import Meta from 'gi://Meta';
9+
import Clutter from 'gi://Clutter';
10+
911

1012
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
1113
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
@@ -294,8 +296,11 @@ class AwsIndicator extends PanelMenu.Button {
294296
style_class: 'session-menu-section',
295297
overlay_scrollbars: true
296298
});
297-
scrollView.add_actor(this._sessionsMenuSection.actor);
298-
this._scrollableSessionsMenuSection.actor.add_actor(scrollView);
299+
300+
// Clutter.Container was removed from Gnome 46, see:
301+
// https://gjs.guide/extensions/upgrading/gnome-shell-46.html
302+
scrollView[Clutter.Container ? 'add_actor' : 'set_child'](this._sessionsMenuSection.actor);
303+
this._scrollableSessionsMenuSection.actor.add_child(scrollView);
299304

300305
this.menu.addMenuItem(this._scrollableSessionsMenuSection);
301306
}
@@ -574,4 +579,4 @@ class AwsIndicator extends PanelMenu.Button {
574579

575580
}
576581

577-
});
582+
});

metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"description": "Close open windows gracefully and save them as a session. And you can restore them when necessary manually or automatically at startup. Most importantly, it supports both X11 and Wayland!\n\nMain features:\n- Restore the previous session at startup. disabled by default.\n- Save running apps and windows automatically when necessary, this will be used to restore the previous session at startup.\n- Close running apps and windows automatically before Log Out, Restart, Power Off. disabled by default.\n- Close running windows gracefully\n- Close apps with multiple windows gracefully via ydotool so you don't lose sessions of this app (See also: How to make Close by rules work)\n- Save running apps and windows manually\n- Restore a selected session at startup (See also: #9). disabled by default.\n- Restore a saved session manually\n- Restore window state, including Always on Top, Always on Visible Workspace and maximization\n- Restore window workspace, size and position\n- Restore 2 column window tiling\n- Stash all supported window states so that those states will be restored after gnome shell restarts via Alt+F2 -> r or killall -3 gnome-shell.\n- Move windows to their own workspace according to a saved session\n- Support multi-monitor\n- Remove saved session to trash\n- Search saved session by the session name fuzzily\n\nFor more information, please visit https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager/blob/feature-close-save-session-while-logout/README.md.\n\nPlease report issues on Github.",
44
"name": "Another Window Session Manager",
55
"shell-version": [
6-
"45"
6+
"45",
7+
"46"
78
],
89
"url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
910
"uuid": "another-window-session-manager@gmail.com",
10-
"version": 46
11+
"version": 47
1112
}

ui/autoclose.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ const RunningApplicationListWindow = GObject.registerClass({
305305
this._pidsMap = new Map();
306306

307307
this._removeFromLayoutIfNecessary(this);
308-
// Main.layoutManager.modalDialogGroup.add_actor(this);
309-
// Main.layoutManager.uiGroup.add_actor(this);
308+
// Main.layoutManager.modalDialogGroup.add_child(this);
309+
// Main.layoutManager.uiGroup.add_child(this);
310310
Main.layoutManager.addChrome(this);
311311

312312
this._confirmDialogContent = new Dialog.MessageDialogContent();
@@ -320,7 +320,7 @@ const RunningApplicationListWindow = GObject.registerClass({
320320
this._backgroundBin = new St.Bin({ child: this.backgroundStack });
321321
this._monitorConstraint = new Layout.MonitorConstraint();
322322
this._backgroundBin.add_constraint(this._monitorConstraint);
323-
this.add_actor(this._backgroundBin);
323+
this.add_child(this._backgroundBin);
324324

325325
this.backgroundStack.add_child(this);
326326

@@ -478,7 +478,7 @@ const RunningApplicationListWindow = GObject.registerClass({
478478
if (this._initialKeyFocus == null || isDefault)
479479
this._setInitialKeyFocus(button);
480480

481-
this.buttonLayout.add_actor(button);
481+
this.buttonLayout.add_child(button);
482482

483483
return button;
484484
}

utils/tooltip.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export const Tooltip = class Tooltip {
237237
time: 0.10,
238238
transition: Clutter.AnimationMode.EASE_OUT_QUAD,
239239
onComplete: () => {
240-
Main.layoutManager.uiGroup.remove_actor(this._bin);
240+
Main.layoutManager.uiGroup.remove_child(this._bin);
241241

242242
if (this.custom)
243243
this._bin.remove_child(this.custom);
@@ -294,7 +294,7 @@ export const Tooltip = class Tooltip {
294294
this.custom.destroy();
295295

296296
if (this._bin) {
297-
Main.layoutManager.uiGroup.remove_actor(this._bin);
297+
Main.layoutManager.uiGroup.remove_child(this._bin);
298298
this._bin.destroy();
299299
}
300300

0 commit comments

Comments
 (0)