@@ -23,7 +23,6 @@ import St from 'gi://St';
2323
2424import * as Params from 'resource:///org/gnome/shell/misc/params.js' ;
2525import * as Signals from 'resource:///org/gnome/shell/misc/signals.js' ;
26- import * as Config from 'resource:///org/gnome/shell/misc/config.js' ;
2726
2827import * as IconCache from './iconCache.js' ;
2928import * as Util from './util.js' ;
@@ -43,7 +42,6 @@ Gio._promisify(Gio.DBusConnection.prototype, 'call');
4342const MAX_UPDATE_FREQUENCY = 30 ; // In ms
4443const FALLBACK_ICON_NAME = 'image-loading-symbolic' ;
4544const PIXMAPS_FORMAT = imports . gi . Cogl . PixelFormat . ARGB_8888 ;
46- const GNOME_48_PLUS = Number ( Config . PACKAGE_VERSION . split ( "." ) [ 0 ] ) >= 48 ;
4745
4846export const SNICategory = Object . freeze ( {
4947 APPLICATION : 'ApplicationStatus' ,
@@ -1327,11 +1325,13 @@ class AppIndicatorsIconActor extends St.Icon {
13271325 preferredHeight : height ,
13281326 } ) ;
13291327
1330- const setBytesArgs = [ pixmapVariant . get_data_as_bytes ( ) , PIXMAPS_FORMAT , width , height , rowStride ] ;
1331- if ( GNOME_48_PLUS ) {
1332- setBytesArgs . unshift ( global . stage . context . get_backend ( ) . get_cogl_context ( ) ) ;
1333- }
1334- imageContent . set_bytes ( ...setBytesArgs ) ;
1328+ // Remove this dynamic check when we depend on GNOME 48.
1329+ const coglContext = [ ] ;
1330+ const mutterBackend = global . stage ?. context ?. get_backend ?. ( ) ;
1331+ if ( imageContent . set_bytes . length === 6 && mutterBackend ?. get_cogl_context )
1332+ coglContext . push ( mutterBackend . get_cogl_context ( ) ) ;
1333+ imageContent . set_bytes ( ...coglContext , pixmapVariant . get_data_as_bytes ( ) ,
1334+ PIXMAPS_FORMAT , width , height , rowStride ) ;
13351335
13361336 if ( iconType !== SNIconType . OVERLAY && ! this . _indicator . hasOverlayIcon ) {
13371337 const scaledSize = iconSize * scaleFactor ;
0 commit comments