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:
Old | New |
---|---|
_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
:
Old | New |
---|---|
keyboard-caps-lock-symbolic | osk-caps-lock-symbolic |
keyboard-shift-symbolic | osk-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:
Old | New |
---|---|
quick-menu-toggle | quick-toggle-has-menu |
quick-toggle-arrow icon-button | quick-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 Name | Type | Description |
---|---|---|
breakManager | /misc/breakManager.js/BreakManager | Tracks active/inactive time and signals break times. |
breakManagerDispatcher | /misc/breakManager.js/BreakDispatcher | Converts break status to notify a break event. |
timeLimitsManager | /misc/timeLimitsManager.js/TimeLimitsManager | Tracks active/inactive time and signals daily time limit reached. |
timeLimitsDispatcher | /misc/timeLimitsManager.js/TimeLimitsDispatcher | Converts 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:
Old | New |
---|---|
Meta.disable_unredirect_for_display | Meta.Compositor.disable_unredirect |
Meta.enable_unredirect_for_display | Meta.Compositor.enable_unredirect |
Meta.get_top_window_group_for_display | Meta.Compositor.get_top_window_group |
Meta.get_window_actors | Meta.Compositor.get_window_actors |
Meta.get_window_group_for_display | Meta.Compositor.get_window_group |
Meta.CursorTracker.get_for_display() | global.backend.get_cursor_tracker() |