Skip to content

Commit 8cdf74f

Browse files
committed
fix: Update Clutter.Image API usage for GNOME 46 compatibility
1 parent 61061b9 commit 8cdf74f

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

src/extension.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -510,9 +510,7 @@ export default class MediaControls extends Extension {
510510
* @returns {Promise<boolean>}
511511
*/
512512
async initWatchProxy() {
513-
this.watchProxy = await createDbusProxy(this.watchIfaceInfo, DBUS_IFACE_NAME, DBUS_OBJECT_PATH).catch(
514-
errorLog,
515-
);
513+
this.watchProxy = await createDbusProxy(this.watchIfaceInfo, DBUS_IFACE_NAME, DBUS_OBJECT_PATH).catch(errorLog);
516514
if (this.watchProxy == null) {
517515
return false;
518516
}
@@ -671,22 +669,20 @@ export default class MediaControls extends Extension {
671669
*/
672670
updateMediaNotificationVisiblity(shouldReset = false) {
673671
const MprisSource = Mpris.MprisSource ?? Mpris.MediaSection;
674-
const mediaSource = Main.panel.statusArea.dateMenu._messageList._messageView?._mediaSource ?? Main.panel.statusArea.dateMenu._messageList._mediaSection;
672+
const mediaSource =
673+
Main.panel.statusArea.dateMenu._messageList._messageView?._mediaSource ??
674+
Main.panel.statusArea.dateMenu._messageList._mediaSection;
675675

676676
if (this.mediaSectionAddFunc && (shouldReset || this.hideMediaNotification === false)) {
677677
MprisSource.prototype._addPlayer = this.mediaSectionAddFunc;
678678
this.mediaSectionAddFunc = null;
679679
mediaSource._onProxyReady();
680680
} else {
681681
this.mediaSectionAddFunc = MprisSource.prototype._addPlayer;
682-
MprisSource.prototype._addPlayer = function() { };
682+
MprisSource.prototype._addPlayer = function () {};
683683
if (mediaSource._players != null) {
684684
for (const player of mediaSource._players.values()) {
685-
mediaSource._onNameOwnerChanged(
686-
null,
687-
null,
688-
[player._busName, player._busName, ""],
689-
);
685+
mediaSource._onNameOwnerChanged(null, null, [player._busName, player._busName, ""]);
690686
}
691687
}
692688
}

src/helpers/shell/PanelButton.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ class PanelButton extends PanelMenu.Button {
311311
addMenuPlayers() {
312312
if (this.menuPlayers == null) {
313313
this.menuPlayers = new St.BoxLayout({
314-
vertical: true
314+
vertical: true,
315315
});
316316
}
317317
if (this.menuPlayersTextBox == null) {
@@ -517,8 +517,7 @@ class PanelButton extends PanelMenu.Button {
517517
const height = width / aspectRatio;
518518
const format = pixbuf.hasAlpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888;
519519
const image = /** @type {St.ImageContent} */ (St.ImageContent.new_with_preferred_size(width, height));
520-
const context = global.stage.context.get_backend().get_cogl_context();
521-
image.set_bytes(context, pixbuf.pixelBytes, format, pixbuf.width, pixbuf.height, pixbuf.rowstride);
520+
image.set_bytes(pixbuf.pixelBytes, format, pixbuf.width, pixbuf.height, pixbuf.rowstride);
522521
this.menuImage.iconSize = -1;
523522
this.menuImage.gicon = null;
524523
this.menuImage.width = width;
@@ -547,7 +546,7 @@ class PanelButton extends PanelMenu.Button {
547546
addMenuLabels() {
548547
if (this.menuLabels == null) {
549548
this.menuLabels = new St.BoxLayout({
550-
vertical: true
549+
vertical: true,
551550
});
552551
}
553552
if (this.menuLabelTitle != null) {
@@ -632,8 +631,8 @@ class PanelButton extends PanelMenu.Button {
632631
this.playerProxy.loopStatus === LoopStatus.NONE
633632
? ControlIconOptions.LOOP_NONE
634633
: this.playerProxy.loopStatus === LoopStatus.TRACK
635-
? ControlIconOptions.LOOP_TRACK
636-
: ControlIconOptions.LOOP_PLAYLIST,
634+
? ControlIconOptions.LOOP_TRACK
635+
: ControlIconOptions.LOOP_PLAYLIST,
637636
this.playerProxy.loopStatus != null,
638637
this.playerProxy.toggleLoop.bind(this.playerProxy),
639638
);

src/helpers/shell/ScrollingLabel.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Pango from "gi://Pango";
44
import St from "gi://St";
55
import { debugLog } from "../../utils/common.js";
66

7-
87
/**
98
* @typedef {Object} ScrollingLabelParams
109
* @property {string} text
@@ -304,7 +303,7 @@ class ScrollingLabel extends St.ScrollView {
304303
* @returns {void}
305304
*/
306305
processLabelWidth() {
307-
debugLog(this.label.width, this.labelWidth)
306+
debugLog(this.label.width, this.labelWidth);
308307
const isLabelWider = this.label.width > this.labelWidth && this.labelWidth > 0;
309308
if (isLabelWider && this.isScrolling) {
310309
this.initScrolling();

0 commit comments

Comments
 (0)