Draft: Port to GTK 4
Fixes #138 (closed).
I wanted to experience a port to GTK 4 to see what it looks like! No idea when such a thing could or should be merged, but it's better to share it and have an online backup. This also requires GtkSourceView 5.
The commit list more or less follows the migration guide provided in the documentation. This almost completely ignores the deprecations introduced in 4.10 (which pave the way for 5.0), but for the rest the porting can be considered complete. There are however some persistent bugs, here is a small list (maybe non exhaustive):
- [Not bugs]
GtkEntry selection: https://gitlab.gnome.org/GNOME/gtk/-/issues/3695 (I also reported https://gitlab.gnome.org/GNOME/gtk/-/issues/3691 for which there is a workaround) - [Fixed GSV 5.0.0] GtkSourceView
"show-line-numbers"
triggering a GObject-CRITICAL: https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/175 - [Fixed GTK 4.6.0] The font dialog is kind of broken, maybe related to https://gitlab.gnome.org/GNOME/gtk/-/issues/3687 (not broken anymore in GTK 4.6 but slow to open, and leaking memory: 50-60 MiB to open, not released when closed (it's probably expected behavior though))
- [Fixed GTK 4.6.0] The languages menu makes
gtk_popover_menu_new_from_model()
and above allgtk_popover_menu_bar_new_from_model()
buggy (commented): https://gitlab.gnome.org/GNOME/gtk/-/issues/3718 - [Fixed GTK 4.3.1] Dynamic menus (recent files, templates, tab list) do not seem to be linked to their action: https://gitlab.gnome.org/GNOME/gtk/-/issues/3721
- [Fixed GTK 4.6.0] Many allocation warnings when using popover menus
- [Fixed or at least better GTK 4.6.0] Font rendering is blurry on some systems: https://gitlab.gnome.org/GNOME/gtk/-/issues/3787
- [Fixed GTK 4.14.0] Reverting a file opened as modified (via session restore) let it as modified: https://gitlab.gnome.org/GNOME/gtk/-/issues/6236
- Transient dialogs do not open above their parent window, but as standalone windows (on X11 only, and only with some WM, including xfwm4 but not openbox: xfce/xfwm4#754, https://gitlab.gnome.org/GNOME/gtk/-/issues/4090)
- Notebook tabs are not redrawn after a drop on the desktop (triggering
"create-window"
): could be related to https://gitlab.gnome.org/GNOME/gtk/-/issues/4423 but not sure, it seems more serious. - Gdk-CRITICAL when dropping a file for the second time: https://gitlab.gnome.org/GNOME/gtk/-/issues/3755
NB: all the commits prefixed "pre-GTK4:" are supposed to compile; none of those prefixed "GTK 4:" are supposed to compile, except the last one.
Edited by Gaël Bonithon