Skip to content

Port Extensions to GNOME Shell 51

Metadata

TIP

There were no relevant changes to metadata.json in GNOME 51.

Extension

While GNOME Shell never expected disable() to be async, it will now throw an error if you make it so.

Preferences

TIP

There were no relevant changes to prefs.js in GNOME 51.

GNOME Shell

St.ReducedMotion

GTK 4.22 added a reduced motion setting so apps can reduce motion. GNOME Shell 51 follows the same approach by adding reduced motion settings to St:

  • St.ReducedMotion.REDUCE
  • St.ReducedMotion.NO_PREFERENCE

You can get the current reduced motion value from St.Settings:

js
const {reducedMotion} = St.Settings.get();
const useMotion = reducedMotion !== St.ReducedMotion.REDUCE;

St.ButtonMask

ButtonMask now uses more readable names to align with Clutter and GTK.

OldNew
St.ButtonMask.ONESt.ButtonMask.PRIMARY
St.ButtonMask.TWOSt.ButtonMask.MIDDLE
St.ButtonMask.THREESt.ButtonMask.SECONDARY

While the old names are deprecated, they remain supported for backward compatibility.

NoGrabPopup

The LanguageSelectionPopup class in ui/keyboard.js now uses NoGrabPopup.

NoGrabPopup is a new class in ui/keyboard.js that extends PopupMenu.PopupMenu so widgets using it won't steal focus.

popupMenu Parameters Object for open() and close()

PopupMenu now accepts a parameters object for open() and close() instead of a single animation argument.

For example, instead of menu.close(PopupAnimation.NONE), pass an object: menu.close({animate: false}).

Currently, the parameters object supports the following properties:

  • animate: boolean
  • fadeOnly: boolean

SearchEntry

SearchEntry is a new class in ui/search.js that emits an activate-new-instance signal on Ctrl+Enter.

ControlsManager in ui/overviewControls.js now uses SearchEntry instead of St.Entry.

BrightnessManager

MonitorId has been added to misc.brightnessManager to save and restore monitor brightnesses across different displays and color modes.

BrightnessManager now loads brightness using the private _loadBrightnesses() method.

There are also other private methods in BrightnessManager to manage state and brightnesses:

  • _getState()
  • _setState()
  • _getSavedBrightnesses()
  • _saveBrightnesses()

Looking Glass Slowdown Factor Flag

Looking Glass now exposes the slowdown factor in debug flags. SlowDownFactorDebugFlag is a new class in ui/lookingGlass.js for this.

Background

Background._loadImage() in ui.background.js is now async.

ui/background.js also introduces a new BackgroundTextureCache class, as backgrounds now load and cache images from files using Glycin.

ui/qrCode.js

ui/qrCode.js is a new module containing a QrCode class that creates a square widget displaying a QR code for a given text. The widget uses the qr-code style class name.

GDM Authentication Mechanisms

To support web login and unified authentication mechanisms, GNOME Shell 51 added these modules:

  • gdm/authMenuButton.js: Provides a menu button to manage login options.

  • gdm/authServices.js: Provides AuthServices abstract base class for managing multi-factor authentication services (password, fingerprint, smartcard, passkeys, web login).

  • gdm/authServicesLegacy.js: Provides AuthServicesLegacy to support legacy user authentication services using passwords, smartcards, fingerprints, and virtual machine single sign-on.

  • gdm/fido2TokenManager.js: Uses GUdev to track physical FIDO2 security USB keys and emits fido2-token-inserted and fido2-token-removed signals.

  • gdm/fingerprintManager.js Uses the fprintd system D-Bus service to detect and manage fingerprint readers.

  • gdm/settings.js: Holds settings keys and schemas related to GDM.

  • gdm/userVerifier.js Manages and verifies user authentication services.

  • gdm/webLogin.js Provides a web authentication widget displaying a QR code, formatted URL, and verification code.

TimeLimitsManager

TimeLimitsManager in misc/timeLimitsManager.js now exposes shouldLockSession boolean property that indicates whether the time limit has been reached while parental controls are enabled.

TimeLimitsManager also provides a new boolean shouldLockSession for this purpose.

ConflictingSessionDialog

The ConflictingSessionDialog class has been moved from gdm/loginDialog.js to a dedicated gdm/conflictingSessionDialog.js file. It introduces the following methods to show a spinner and dim the dialog when the user clicks Force Stop:

  • _createSpinner()
  • _startSpinning()
  • _animateDimEffect()

dateMenu Event Handlers

CalendarMessageList.maybeCollapseMessageGroupForEvent() method has been removed from ui/calendar.js, and dateMenu no longer handles collapsing of expanded message groups on events. Instead, CalendarMessageList handles them through key controller and click gesture.

setCaptureContainer() is a new method in CalendarMessageList that allows to set the container actor for capturing events.

pointerWatcher

ui/pointerWatcher.js has been removed. Use global.backend.get_cursor_tracker to get the Meta.CursorTracker instance instead.

GJS

Clutter Controllers

Instead of directly connecting event signals to an actor, you should use modern event controllers like Clutter.ClickGesture, Clutter.KeyController, Clutter.ScrollController, Clutter.MotionController and Clutter.LongPressGesture. This gives you more control over events.

You can add or remove controllers on an actor using these methods:

  • add_action()
  • add_action_full()
  • remove_action()

Controllers allow you to decouple event listeners while providing better control over actions, such as temporarily disabling a controller or specifying the propagation phase where the action intercepts the event.

For example, here is the old way of connecting an event signal directly to an actor:

js
entry.connect('key-press-event', (entry, event) => {
    const symbol = event.get_key_symbol();
    // ..
    return Clutter.EVENT_PROPAGATE;
});

And the new way of adding controller action:

js
const keyController = new Clutter.KeyController();
keyController.connect('key-press', () => {
    // returns [success, symbol, code, unicode] but here we only use symbol
    const [, symbol] = keyController.get_key();
    // ..
    return Clutter.EVENT_PROPAGATE;
});
entry.add_action(keyController);

While the old way of connecting event signals still works, it is deprecated and will be removed in future GNOME Shell releases.

Shell.GLSLEffect

Shell.GLSLEffect has been removed. Use Clutter.ShaderEffect instead.

Logic previously implemented in vfunc_build_pipeline() should be moved to vfunc_get_static_snippet(), returning a Cogl.Snippet instance.

For example:

js
vfunc_get_static_snippet() {
    const snippet = new Cogl.Snippet(
        Cogl.SnippetHook.FRAGMENT,
        '/* GLSL declarations */',
        null
    );
    snippet.set_replace('/* GLSL code */');
    return snippet;
}

Clutter.get_default_backend()

Clutter.get_default_backend() has been removed. Instead, use global.stage.context.get_backend(), or call actor.get_context().get_backend() from a Clutter actor.

Gio.DBus.makeProxyWrapper()

Gio.DBus.makeProxyWrapper() now returns Gio.DBusProxy subclass rather than a function so you need to use new to invoke if you aren't already doing that.

MIT Licensed | GJS, A GNOME Project