Skip to content

Port Extensions to GNOME Shell 48

Metadata

TIP

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

Extension

TIP

There were no relevant changes to extension.js in GNOME 48.

Preferences

TIP

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

GNOME Shell

Custom Logger

For convenience, ExtensionBase added the new getLogger() method to provide a better logging experience for extensions. By using the logger class, you get the extension name as a prefix in the logs.

These are the supported methods, which you can use in the same way you use the console methods:

  • log()
  • warn()
  • error()
  • info()
  • debug()
  • assert()
  • trace()
  • group()
  • groupEnd()

InputSourceManager

The /ui/status/keyboard.js/InputSourceManager._switchInputSource() method now includes an event parameter:

OldNew
_switchInputSource(display, window, binding)_switchInputSource(display, window, event, binding)

Keyboard

The /ui/keyboard.js/Key box pointer style class name changed from keyboard-subkeys to keyboard-subkeys-boxpointer.

Also /ui/keyboard.js/EmojiSelection key style class name changed from keyboard-hide-symbolic to osk-hide-symbolic.

The following icon names also changed for /ui/keyboard.js/Keyboard:

OldNew
keyboard-caps-lock-symbolicosk-caps-lock-symbolic
keyboard-shift-symbolicosk-shift-symbolic

Cogl.SnippetHook

Cogl.SnippetHook is exposed in version 45 and later, use Cogl.SnippetHook.FRAGMENT instead of Shell.SnippetHook.FRAGMENT.

MessageTray

/ui/messageTray.js/Notification now has a new removeAction() method.

QuickMenuToggle

/ui/quickSettings.js/QuickMenuToggle changed style class names:

OldNew
quick-menu-togglequick-toggle-has-menu
quick-toggle-arrow icon-buttonquick-toggle-menu-button icon-button

The new separator also has the quick-toggle-separator style class name.

WindowManager

These methods in /ui/windowManager.js/WindowManager now include an event parameter as their third argument:

  • _startSwitcher()
  • _startA11ySwitcher()
  • _switchToApplication()
  • _openNewApplicationWindow()
  • _showWorkspaceSwitcher()

St Widgets Orientation

The vertical property of St widgets is deprecated and will be removed in a future GNOME Shell release (potentially version 50). Replace its usage with the orientation property, using Clutter.Orientation values.

For example, use orientation: Clutter.Orientation.VERTICAL instead of vertical: true.

Time Limit and Break Manager

GNOME Shell 48 includes new /misc/breakManager.js and /misc/timeLimitsManager.js files for break reminders and screen time statistics.

The main instances of the break manager and time limit manager can be accessed directly in /ui/main.js/ with:

Variable NameTypeDescription
breakManager/misc/breakManager.js/BreakManagerTracks active/inactive time and signals break times.
breakManagerDispatcher/misc/breakManager.js/BreakDispatcherConverts break status to notify a break event.
timeLimitsManager/misc/timeLimitsManager.js/TimeLimitsManagerTracks active/inactive time and signals daily time limit reached.
timeLimitsDispatcher/misc/timeLimitsManager.js/TimeLimitsDispatcherConverts time limit status to a notify event.

There is also /ui/shellDBus.js/ScreenTimeDBus for the screen time D-Bus interface.

GJS

Clutter.Image

Clutter.Image has been removed and you can use St.ImageContent instead. There is no need to version check for St.ImageContent as it's already available in GNOME Shell 45 and higher.

Meta

These Meta functions have been renamed and moved to the new namespace:

OldNew
Meta.disable_unredirect_for_displayMeta.Compositor.disable_unredirect
Meta.enable_unredirect_for_displayMeta.Compositor.enable_unredirect
Meta.get_top_window_group_for_displayMeta.Compositor.get_top_window_group
Meta.get_window_actorsMeta.Compositor.get_window_actors
Meta.get_window_group_for_displayMeta.Compositor.get_window_group
Meta.CursorTracker.get_for_display()global.backend.get_cursor_tracker()

MIT Licensed | GJS, A GNOME Project