GNOME 44 for Developers
GNOME 44 comes with a host of new capabilities and features for those using the GNOME platform.
GTK
GNOME 44 is accompanied by the latest stable GTK release, version 4.10. This version includes some significant features and changes for developers.
Deprecations
GTK 4.10 deprecates a range of existing APIs. These APIs will continue to be available for the 4.x release series, but will be removed in the next major GTK version, which will be 5.0. The GTK development blog provides an overview of the changes and what they mean.
Cell Renderers
GTK 4.10 deprecates all APIs relating to cell renders, including GtkTreeView
, GtkIconView
, and GtkComboBox
. Alternatives to these widgets already exist, in the shape of GtkColumnView, GtkGridView, and GtkDropDown.
Dialogs
GTK 4.10 deprecates existing chooser APIs, including: GtkDialog
, GtkFileChooserDialog
, GtkFileChooserWidget
, GtkFileChooser
, GtkFileChooserNative
, GtkColorChooserDialog
, GtkColorChooserWidget
, GtkColorButton
, GtkColorChooser
, GtkFontChooserDialog
, GtkFontChooserWidget
, GtkFontButton
, GtkFontChooser
, GtkAppChooserDialog
, GtkAppChooser
, GtkAppChooserWidget
, GtkAppChooserButton
, and GtkMessageDialog
.
For those looking for alternatives, new replacement APIs have been added, which work as asynchronous calls. They are: GtkColorDialog, GtkFontDialog, GtkFileDialog, GtkAlertDialog. Libadwaita can also be used and includes a number of common dialogs, such as AdwPreferencesWindow and AdwMessageDialog.
For custom dialogs, it is recommended to derive from GtkWindow
as opposed to GtkDialog
.
Info bars
GTK 4.10 deprecates GtkInfoBar
. Libadwaita’s new AdwBanner can be used as alternative.
Autotools
With GTK 4.10, Autotools has been removed from the GTK 3.x branch. Those wanting to build or package GTK 3.x will therefore need to use the Meson build system. Regressions experienced by Autotools users should be reported using the GTK issue tracker.
Libadwaita
GNOME 44 is accompanied by Libadwaita 1.3, which includes three new widgets, as well as a host of bug fixes. The new widgets for 1.3 are:
AdwBanner, a narrow bar that can be used to show status information. Banners have a title, which can be centered or left-aligned, and can include a single optional button.
AdwTabOverview, which displays tabs from an AdwTabView
in a grid, with a thumbnail for each tab. Search is provided, so that users can filter the view.
AdwTabButton, a button that shows the number of open tabs in an AdwTabView
. It is intended to be used as a open tab indicator when there’s no tab bar. Typically it will open an AdwTabOverview
when pressed.
GLib
GNOME 44 is accompanied by GLib 2.76. Changes since the last stable version, include:
- The addition of
GPathBuf
, a new path building API which can be used to programmatically build paths on both Unix-like operating systems and Windows. - Support for optimized static strings in g_str_has_prefix() and g_str_has_suffix(). The request for this feature was 18 years old!
g_autofd
: a new attribute which can be used to automatically close file descriptors when exiting a scope, likeg_autofree
andg_autoptr()
(see the merge request).- Wrappers for the upcoming C23 API for sized memory allocations and deallocations.
- The removal of GLib’s slice allocator (GSlice) implementation, now that system allocators have finally caught up with it. The existing public
g_slice
API now calls directly into the system allocator, and we recommend library and application developers to start porting away their code from the GSlice API. - Multiple optimizations in GLib’s string buffer and logging API, to avoid unnecessary allocations.
- After nearly 8 years,
application/x-zerosize
are now returned for completely empty files. Applications that allow editing empty files will need to addapplication/x-zerosize
to their list of supported MIME types. gdbus-codegen
can now generate D-Bus API reference docs in Markdown, in addition to the previously supported docbook and reStructuredText. See thegdbus-codegen
docs for information on using this feature.- Multiple security fixes in the GVariant serialization format — see the Discourse post.
Builder
Version 44 of GNOME’s IDE includes a large number of enhancements and fixes, including:
Changes in this release:
- Builder has gained support for editable shortcuts. These can individually changed from the Preferences dialog, and menus and the keyboard shortcuts window will reflect changes made by the user.
- SDK extension resolving has been made asynchronous so projects load much faster in conjunction with Flatpak.
- Rust template updates.
- The search entry now focuses the text editor when enter is pressed.
- A number of new search providers have been added.
- Previews of search results are now shown in the global search popover.
- User-defined keybindings in
$XDG_CONFIG_DIR/gnome-builder/keybindings.json
. - Many keyboard shortcuts have been added.
- The project tree has been ported to GtkListView and includes DnD again.
- Lots of safety improvements under the hood.
- New filters for the project-tree and todo panels.
- Build systems can now alter the “srcdir” allowing for projects which are in subdirectories of their Git project to work better.
- Support for SourceKit LSP for Swift.
.buildconfig
file support for runtime environment settings and file monitoring for tracking out-of-band updates.- Podman and JHBuild integration improvements
GNOME JavaScript
GNOME’s JavaScript programming environment comes with a collection of improvements for GNOME 44:
- New
Gio.Application.prototype.runAsync()
andGLib.MainLoop.prototype.runAsync()
methods which perform the same function asrun()
, but return aPromise
which resolves when the main loop ends, instead of blocking while the main loop runs. Use one of these methods if you use async operations with promises in your application. Previously, it was easy to get into a state where promises never resolved if the main loop wasn’t run inside a callback. Thanks to Evan Welsh for working on this. - New
Gio.InputStream.prototype.createSyncIterator()
andGio.InputStream.prototype.createAsyncIterator()
methods allow easy iteration of input streams in consecutive chunks of bytes, either with a for-of loop or a for-await-of loop. - DBus proxy wrapper classes now have a static
newAsync()
method, which returns aPromise
that resolves to an instance of the proxy wrapper class on whichinitAsync()
has completed. - DBus property getters can now return
GLib.Variant
instances directly, if they have the correct type, instead of returning JS values and having them be packed intoGLib.Variants
. Cairo.SVGSurface.prototype.finish()
andCairo.SVGSurface.prototype.flush()
avoid garbage collecting issues when writing SVG surfaces to disk.
Documentation
Several improvements have been made to GNOME’s developer documentation since GNOME 43:
- The GTK Rust docs now cover Libadwaita.
- gi-docgen, the introspection-based documentation generator used by (among others) GTK to publish its API reference, has gained the ability to show if a symbol, type, signal, or property is currently unstable. This should help visually distinguish newly added API in the reference generated directly from bleeding edge sources. The same style is also used to present when a symbol was introduced and when it was deprecated.
Background Apps
GNOME 44 is accompanied by XDG portals 1.16.1. As part of GNOME’s new background apps feature, the behavior of the background portal has changed in the latest release.
Apps which want to run without a visible window no longer need to request permission to run in the background. However, users can still withdraw an app’s permission ability to run in the background, and apps which run in the background without permission will be killed.
To avoid this, apps can check whether they have permission to run in the background using the background portal’s RequestBackground
method. They can also use SetStatus
to specify a status message that is shown in the Background Apps menu.