1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
From: thankjura <me@slie.ru>
Date: Wed, 12 Feb 2025 11:26:05 +0300
Subject: gnome 48 compability
Origin: https://github.com/ubuntu/gnome-shell-extension-appindicator/pull/564
---
appIndicator.js | 9 +++++++--
metadata.json | 3 ++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/appIndicator.js b/appIndicator.js
index 87d69e4..9051e78 100644
--- a/appIndicator.js
+++ b/appIndicator.js
@@ -23,6 +23,7 @@ import St from 'gi://St';
import * as Params from 'resource:///org/gnome/shell/misc/params.js';
import * as Signals from 'resource:///org/gnome/shell/misc/signals.js';
+import * as Config from 'resource:///org/gnome/shell/misc/config.js';
import * as IconCache from './iconCache.js';
import * as Util from './util.js';
@@ -42,6 +43,7 @@ Gio._promisify(Gio.DBusConnection.prototype, 'call');
const MAX_UPDATE_FREQUENCY = 30; // In ms
const FALLBACK_ICON_NAME = 'image-loading-symbolic';
const PIXMAPS_FORMAT = imports.gi.Cogl.PixelFormat.ARGB_8888;
+const GNOME_48_PLUS = Number(Config.PACKAGE_VERSION.split(".")[0]) >= 48;
export const SNICategory = Object.freeze({
APPLICATION: 'ApplicationStatus',
@@ -1324,8 +1326,11 @@ class AppIndicatorsIconActor extends St.Icon {
preferredHeight: height,
});
- imageContent.set_bytes(pixmapVariant.get_data_as_bytes(), PIXMAPS_FORMAT,
- width, height, rowStride);
+ const setBytesArgs = [pixmapVariant.get_data_as_bytes(), PIXMAPS_FORMAT, width, height, rowStride];
+ if (GNOME_48_PLUS) {
+ setBytesArgs.unshift(global.stage.context.get_backend().get_cogl_context());
+ }
+ imageContent.set_bytes(...setBytesArgs);
if (iconType !== SNIconType.OVERLAY && !this._indicator.hasOverlayIcon) {
const scaledSize = iconSize * scaleFactor;
diff --git a/metadata.json b/metadata.json
index 23f6ba5..90095cc 100644
--- a/metadata.json
+++ b/metadata.json
@@ -2,7 +2,8 @@
"shell-version": [
"45",
"46",
- "47"
+ "47",
+ "48"
],
"gettext-domain": "AppIndicatorExtension",
"settings-schema": "org.gnome.shell.extensions.appindicator",
|