Skip to content

Commit

Permalink
Merge pull request #107 from nlpsuge/feature-support-gnome-46
Browse files Browse the repository at this point in the history
Support Gnome 46
  • Loading branch information
nlpsuge authored May 18, 2024
2 parents a6640e3 + d8a5990 commit f2b7937
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
11 changes: 8 additions & 3 deletions indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Gio from 'gi://Gio';
import GLib from 'gi://GLib';
import Shell from 'gi://Shell';
import Meta from 'gi://Meta';
import Clutter from 'gi://Clutter';


import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
Expand Down Expand Up @@ -294,8 +296,11 @@ class AwsIndicator extends PanelMenu.Button {
style_class: 'session-menu-section',
overlay_scrollbars: true
});
scrollView.add_actor(this._sessionsMenuSection.actor);
this._scrollableSessionsMenuSection.actor.add_actor(scrollView);

// Clutter.Container was removed from Gnome 46, see:
// https://gjs.guide/extensions/upgrading/gnome-shell-46.html
scrollView[Clutter.Container ? 'add_actor' : 'set_child'](this._sessionsMenuSection.actor);
this._scrollableSessionsMenuSection.actor.add_child(scrollView);

this.menu.addMenuItem(this._scrollableSessionsMenuSection);
}
Expand Down Expand Up @@ -574,4 +579,4 @@ class AwsIndicator extends PanelMenu.Button {

}

});
});
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"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.",
"name": "Another Window Session Manager",
"shell-version": [
"45"
"45",
"46"
],
"url": "https://github.com/nlpsuge/gnome-shell-extension-another-window-session-manager",
"uuid": "[email protected]",
"version": 46
"version": 47
}
8 changes: 4 additions & 4 deletions ui/autoclose.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ const RunningApplicationListWindow = GObject.registerClass({
this._pidsMap = new Map();

this._removeFromLayoutIfNecessary(this);
// Main.layoutManager.modalDialogGroup.add_actor(this);
// Main.layoutManager.uiGroup.add_actor(this);
// Main.layoutManager.modalDialogGroup.add_child(this);
// Main.layoutManager.uiGroup.add_child(this);
Main.layoutManager.addChrome(this);

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

this.backgroundStack.add_child(this);

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

this.buttonLayout.add_actor(button);
this.buttonLayout.add_child(button);

return button;
}
Expand Down
4 changes: 2 additions & 2 deletions utils/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export const Tooltip = class Tooltip {
time: 0.10,
transition: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
Main.layoutManager.uiGroup.remove_actor(this._bin);
Main.layoutManager.uiGroup.remove_child(this._bin);

if (this.custom)
this._bin.remove_child(this.custom);
Expand Down Expand Up @@ -294,7 +294,7 @@ export const Tooltip = class Tooltip {
this.custom.destroy();

if (this._bin) {
Main.layoutManager.uiGroup.remove_actor(this._bin);
Main.layoutManager.uiGroup.remove_child(this._bin);
this._bin.destroy();
}

Expand Down

0 comments on commit f2b7937

Please sign in to comment.