What’s new for developers
GNOME 48 brings a host of improvements for developers, including enhanced developer tools, refined libraries, and updated language bindings. Read on to learn what’s new.
For a full rundown of GNOME’s development platform, you can also visit the GNOME Developer website. Dive in and start building the next generation of GNOME experiences!
Portals Enhancements
GNOME 48 comes with support for two major enhancements to desktop portals: global shortcuts, and the introduction of the USB portal.
Global Shortcuts
With GNOME 48, it is now possible for apps to register system-wide global shortcuts. This allows apps to setup keyboard shortcuts which can be used while the app does not have focus. This feature is fully supported by GNOME 48, and API reference documentation is available.
USB Portal
The second major portals enhancement is the introduction of the USB portal. This allows apps to monitor and request access to USB devices. This is primarily intended for apps which require access to specialist USB devices like joysticks and controllers. For more more generic devices, dedicated portals already exist, such as the camera portal.
Using the new USB portal provides an alternative to the less secure --device=all
sandbox hole. See the API reference documentation for more information.
The USB portal is possible thanks to the latest Flatpak 1.16 release, which includes various other enhancements which are worth checking out. Details can be found in Georges Stavracas’s blog post.
GTK
GNOME 48 comes with a new version of the GTK toolkit, which contains a number of notable enhancements.
- Optimized Size Allocation: significant changes have been made to GTK’s size allocation algorithms, aiming to minimize costly bisection operations. While this yields performance benefits, it may result in subtle layout changes for some applications.
- Default Portal Usage: GTK now defaults to using portals for file chooser operations, regardless of whether the application is sandboxed. This ensures a consistent and modern file chooser experience for all users. GTK also registers applications to improve portal API functionality in unsandboxed environments.
- GtkBuilder Enhancements: GtkBuilder now supports inline menu definitions within properties. Additionally, Pango text attributes and tab arrays can be specified through textual serialization, providing greater flexibility in UI design.
Libadwaita
GNOME 48 comes with Libadwaita 1.7. This latest version comes with significant new features for those developing GNOME apps. These include:
- Toggle Groups: a new toggle group widget provides a more convenient and attractive alternative to linked boxes of toggle buttons. This new widget is also the basis of a useful new inline view switcher.
- Wrapping Boxes: AdwWrapBox is a new widget that can be used for lists of tags and similar cases.
- Adaptive Preview: is a new testing capability which allows mobile devices to be simulated. A blog post is available with details.
- Font Access: new APIs allow accessing the system document and monospace fonts, both programmatically and from CSS.
There are also a number of smaller API changes which might be of interest:
AdwNavigationSplitView
allows placing a sidebar at the end, likeAdwOverlaySplitView
.AdwToastOverlay
has a new function to dismiss all toasts at once.AdwNavigationView
now hashhomogeneous
andvhomogeneous
properties for forcing all pages to be the same width, andvisible-page-tag
as a shorthand for getting the tag of the currently visible page.- New cubic Bézier curve easing functions are available:
ADW_EASE
,ADW_EASE_IN
,ADW_EASE_OUT
,ADW_EASE_IN_OUT
. AdwBottomSheet
now has API for hiding the bottom bar.AdwBanner
has a new API for making its button more prominent.- The
.dim-label
style class has been deprecated in favor of.dimmed
.
Sysprof
GNOME’s profiling tool has been significantly updated and includes many improvements in GNOME 48. The most notable changes are:
- Improved Sampling Accuracy and Performance: Sysprof has seen significant enhancements in its sampling accuracy and overall performance. These improvements translate to more precise and reliable profiling data, enabling developers to pinpoint performance bottlenecks with greater ease.
- Enhanced DWARF Symbol Handling: the handling of DWARF symbols has been refined, resulting in more accurate and detailed call stack information. This allows for deeper insights into the execution flow of applications, aiding in the identification of performance issues at a granular level.
- Refined Interface and User Experience: the user interface of Sysprof has been further polished to provide a more intuitive and streamlined profiling experience. This includes visual improvements and workflow optimizations, making it easier for developers to navigate and interpret profiling data.
- Expanded Instrumentation Capabilities: Sysprof now supports a broader range of instrumentation capabilities, allowing developers to profile a wider variety of application behaviors. This expansion enhances the flexibility of Sysprof and makes it a more versatile tool for performance analysis.
This release also includes a number of bug fixes and stability improvements, ensuring a more robust and reliable profiling experience. If you’ve never used Sysprof before, GNOME’s developer docs include a getting started tutorial.
GJS
GNOME’s JavaScript runtime has received various improvements and fixes since the last major GNOME release. These include:
- GJS now supports source maps, enabling debugging tools to show original source locations. Note that, if you use a build tool like TypeScript for source code transformation, source map files need to be shipped alongside any built JavaScript files for this to work.
- The GJS interactive console is now asynchronous. This allows, for example, creating a window with a button, connecting a signal handler, clicking the button, and the signal handler will run when the button is clicked.
GObject.Value
can now be created transparently, without the need to use theGObject.Value
wrapper. For example, a new Value can be created withnew GObject.Value(String, 'a string');
- CPU and memory usage when setting/getting properties basic type has been significantly reduced.
Other
Many other smaller developer enhancements accompany GNOME 48. Here are just some of them:
- GLib’s GVariant datatype has been optimized, resulting in reduced memory usage.
- GNOME OS now uses systemd-sysupdate, which in turn allows it to support SecureBoot. See Adrien Plazas’s blog post for more details.
- Libmanette, the GObject game controller library, now supports the Steam Deck controller. It also has new documentation.
- Gcr has been enhanced, such as with the
GcrCertificateExtension
class, which allows certificate extensions to be inspected. - Vala has a new docs website, which includes plenty of useful information, including tutorials and guides. Contributions to the new site are encouraged!
- Mutter can now be built without the GNOME font rendering stack, making it more flexible and portable.