Skip to content

Commit

Permalink
GNOME 48 support (#185)
Browse files Browse the repository at this point in the history
* GNOME 48 support

* MessageList.MediaSection instead of Mpris.MediaSection

* orientation: Clutter.Orientation.VERTICAL

* Clutter.Image removed use St.ImageContent

* MessageList.MediaSection instead of Mpris.MediaSection

* /ui/mpris.js/MediaSection has been renamed to /ui/mpris.js/MprisSource
  • Loading branch information
ChrisLauinger77 authored Feb 18, 2025
1 parent a4d9aa0 commit 8f36f20
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,16 @@ export default class MediaControls extends Extension {

private updateMediaNotificationVisiblity(shouldReset = false) {
if (this.mediaSectionAddFunc && (shouldReset || this.hideMediaNotification === false)) {
Mpris.MediaSection.prototype._addPlayer = this.mediaSectionAddFunc;
Mpris.MprisSource.prototype._addPlayer = this.mediaSectionAddFunc;
this.mediaSectionAddFunc = null;

Main.panel.statusArea.dateMenu._messageList._mediaSection._onProxyReady();
Main.panel.statusArea.dateMenu._messageList._messageView._mediaSource._onProxyReady();
} else {
this.mediaSectionAddFunc = Mpris.MediaSection.prototype._addPlayer;
Mpris.MediaSection.prototype._addPlayer = function () {};
this.mediaSectionAddFunc = Mpris.MprisSource.prototype._addPlayer;
Mpris.MprisSource.prototype._addPlayer = function () {};

if (Main.panel.statusArea.dateMenu._messageList._mediaSection._players != null) {
for (const player of Main.panel.statusArea.dateMenu._messageList._mediaSection._players.values()) {
if (Main.panel.statusArea.dateMenu._messageList._messageView._mediaSource._players != null) {
for (const player of Main.panel.statusArea.dateMenu._messageList._messageView._mediaSource._players.values()) {
player._close();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/shell/MenuSlider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MenuSlider extends St.BoxLayout {
private rate: number;

constructor() {
super({ vertical: true });
super({ orientation: Clutter.Orientation.VERTICAL });

this.rate = 1.0;
this.slider = new Slider.Slider(0);
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/shell/PanelButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class PanelButton extends PanelMenu.Button {
private addMenuPlayers() {
if (this.menuPlayers == null) {
this.menuPlayers = new St.BoxLayout({
vertical: true,
orientation: Clutter.Orientation.VERTICAL,
});
}

Expand Down Expand Up @@ -390,7 +390,7 @@ class PanelButton extends PanelMenu.Button {
const height = width / aspectRatio;
const format = pixbuf.hasAlpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888;

const image = St.ImageContent.new_with_preferred_size(width, height) as St.ImageContent & Clutter.Image;
const image = St.ImageContent.new_with_preferred_size(width, height) as St.ImageContent;
image.set_bytes(pixbuf.pixelBytes, format, pixbuf.width, pixbuf.height, pixbuf.rowstride);

this.menuImage.iconSize = -1;
Expand Down Expand Up @@ -423,7 +423,7 @@ class PanelButton extends PanelMenu.Button {
private addMenuLabels() {
if (this.menuLabels == null) {
this.menuLabels = new St.BoxLayout({
vertical: true,
orientation: Clutter.Orientation.VERTICAL,
});
}

Expand Down
8 changes: 5 additions & 3 deletions src/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"url": "https://github.com/cliffniff/media-controls",
"settings-schema": "org.gnome.shell.extensions.mediacontrols",
"gettext-domain": "[email protected]",
"version-name": "2.0.2",
"shell-version": ["45", "46", "47"]
}
"version-name": "2.1.0",
"shell-version": [
"48"
]
}

0 comments on commit 8f36f20

Please sign in to comment.