Skip to content

Commit

Permalink
GNOME 46 compatibility
Browse files Browse the repository at this point in the history
Clutter.Container was removed

bumped versions
  • Loading branch information
ChrisLauinger77 committed Mar 1, 2024
1 parent 082501f commit 160771e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/helpers/shell/PanelButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ class PanelButton extends PanelMenu.Button {
tapAction.connect("tap", onClick);
icon.add_action(tapAction);

const oldIcon = this.menuControls.find_child_by_name(options.name);
const oldIcon = this.menuControls.get_child_at_index(options.menuProps.index);

if (oldIcon?.get_parent() === this.menuControls) {
this.menuControls.replace_child(oldIcon, icon);
Expand Down Expand Up @@ -716,7 +716,7 @@ class PanelButton extends PanelMenu.Button {

icon.add_action(tapAction);

const oldIcon = this.buttonControls.find_child_by_name(options.name);
const oldIcon = this.buttonControls.get_child_at_index(options.panelProps.index);

if (oldIcon != null) {
this.buttonControls.replace_child(oldIcon, icon);
Expand All @@ -726,7 +726,7 @@ class PanelButton extends PanelMenu.Button {
}

private removeButtonControlIcon(options: ControlIconOptions) {
const icon = this.buttonControls.find_child_by_name(options.name);
const icon = this.buttonControls.get_child_at_index(options.menuProps.index);

if (icon != null) {
this.buttonControls.remove_child(icon);
Expand Down
6 changes: 5 additions & 1 deletion src/helpers/shell/ScrollingLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ class ScrollingLabel extends St.ScrollView {

this.onShowChangedId = this.label.connect("show", this.onShowChanged.bind(this));
this.box.add_child(this.label);
this.add_actor(this.box);
if (Clutter.Container === undefined) {
this.add_child(this.box);
} else {
this.add_actor(this.box);
}
}

public pauseScrolling() {
Expand Down
4 changes: 2 additions & 2 deletions src/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"url": "https://github.com/cliffniff/media-controls",
"settings-schema": "org.gnome.shell.extensions.mediacontrols",
"gettext-domain": "[email protected]",
"version-name": "2.0.0",
"shell-version": ["45"]
"version-name": "2.0.1",
"shell-version": ["45", "46"]
}

0 comments on commit 160771e

Please sign in to comment.