Skip to content

Commit ab640a1

Browse files
authored
Merge pull request #136 from sakithb/gnome46
GNOME 46 compatibility
2 parents 320ff7e + 160771e commit ab640a1

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/helpers/shell/PanelButton.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class PanelButton extends PanelMenu.Button {
568568
tapAction.connect("tap", onClick);
569569
icon.add_action(tapAction);
570570

571-
const oldIcon = this.menuControls.find_child_by_name(options.name);
571+
const oldIcon = this.menuControls.get_child_at_index(options.menuProps.index);
572572

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

717717
icon.add_action(tapAction);
718718

719-
const oldIcon = this.buttonControls.find_child_by_name(options.name);
719+
const oldIcon = this.buttonControls.get_child_at_index(options.panelProps.index);
720720

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

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

731731
if (icon != null) {
732732
this.buttonControls.remove_child(icon);

src/helpers/shell/ScrollingLabel.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ class ScrollingLabel extends St.ScrollView {
6464

6565
this.onShowChangedId = this.label.connect("show", this.onShowChanged.bind(this));
6666
this.box.add_child(this.label);
67-
this.add_actor(this.box);
67+
if (Clutter.Container === undefined) {
68+
this.add_child(this.box);
69+
} else {
70+
this.add_actor(this.box);
71+
}
6872
}
6973

7074
public pauseScrolling() {

src/metadata.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"url": "https://github.com/cliffniff/media-controls",
66
"settings-schema": "org.gnome.shell.extensions.mediacontrols",
77
"gettext-domain": "[email protected]",
8-
"version-name": "2.0.0",
9-
"shell-version": ["45"]
8+
"version-name": "2.0.1",
9+
"shell-version": ["45", "46"]
1010
}

0 commit comments

Comments
 (0)