This week, we released GTK 3.96.0. Again, it has been a while since the last release, so it is worth summarizing whats new in this release. There is really too much here to cover it all, so this post will only highlight the most important changes.
This release is another milestone on our way towards GTK 4. And while there are still some unfinished things, this release is much closer to we hope to achieve with GTK 4.
GSK has seen a number of bug fixes and new tests that are made much easier using a new debug tool, gtk4-node-editor. It can load and display serialized render node trees, such as this one that was saved from the GTK inspector, and compare the output of different renderers.
The 3D transformation support has been brought up to the level where we can do animated transitions like the cube spin below.
The trend to move toward Wayland inspired APIs has continued, with more X11-only apis being moved to the X11 backend or just removed. Use of child surfaces and global coordinates has been greatly reduced, but this work remains incomplete.
The refactoring of Drag-and-Drop has also continued, with the introduction of
GdkDrop objects. The GTK part of this refactoring is still incomplete.
Events have been simplified and are now used just for input. Other event have been replaced by signals and properties on
GdkSurface. In detail, expose events have been replaced by the
::render signal, configure events have been replaced by the
::size-changed signal. Map events have been replaced by the
:mapped property, and
gdk_event_handler_set() has been replaced by the
The Wayland backend has gained support for the Settings portal for
GtkSettings, and uses the text-input-unstable-v3 protocol for its input method support.
One big change for custom widgets is the introduction of
GtkLayoutManager, which is a new delegate object that takes over size allocation. Layout managers can optionally use layout children for holding layout properties. This replaces the layout-related child properties in GTK containers such as
A number of layout managers are available:
GtkBinLayout, for simple single-child containers
GtkBoxLayout, for children that are arranged linearly
GtkGridLayout, for children that are arranged in a grid
GtkFixedLayout, for freely positioned and transformed children
GtkCustomLayout, as a quick way to turn traditional
size_allocatevfuncs into a layout manager
More layout manager implementations will appear in the future. Most prominently, work is underway on a constraints-based layout manager.
GtkNotebook have publicly
accessible page objects for their children. The page objects
are also exposed via a list model. They non-layout related child properties of these containers have been converted into regular properties on these page objects.
Since all existing child properties have been converted to regular properties, moved to layout properties or moved to such page objects, support for child properties has been dropped from
GtkEntry functionality has been moved into a new
GtkText widget, which also implements an expanded
GtkEditable interface. All existing entry subclasses in GTK have been turned into
GtkEditable implementations wrapping a
GtkText widget. This also includes a new
GTK widgets can transform their children using projective linear
transformations. This functionality is available in CSS and
GskTransform argument to
the first container that exposes this functionality. For further examples,
see the swing transition of
GtkRevealer, the rotate transitions
GtkStack or the Fixed Layout example in gtk4-demo.
A number of list models have been introduced, for internal use
and as public API:
GtkSingleSelection. These will become more widely used when we introduce a list model-based
GtkBuilder can specify object-valued properties inline, instead of referring to them by ID, and the
simplify command of gtk4-builder-tool has gained an option to automatically convert GTK 3 UI definition files to GTK 4.