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 commits list more or less follows the migration guide provided in the documentation. The main things left to do are related to the menubar and the toolbar, but for the most part the rest is done. There are however some persistent bugs after this first pass, here is a small list (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] GtkSourceView
"show-line-numbers"triggering a GObject-CRITICAL: https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/175
- 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)
- Gdk-CRITICAL when dropping a file for the second time, and no possibility to drop multiple files (don't know if it's a limitation of the new API or if I missed something: I hope so): https://gitlab.gnome.org/GNOME/gtk/-/issues/3755
- Notebook tabs are not redrawn after a drop on the desktop (triggering
- The languages menu makes
gtk_popover_menu_new_from_model()and above all
gtk_popover_menu_bar_new_from_model()buggy (commented): https://gitlab.gnome.org/GNOME/gtk/-/issues/3718
- [Fixed] Dynamic menus (recent files, templates, tab list) do not seem to be linked to their action: https://gitlab.gnome.org/GNOME/gtk/-/issues/3721
- Many allocation warnings when using popover menus
- Transient dialogs do not open above their parent window, but as toplevel windows
- Font rendering is blurry on some systems: https://gitlab.gnome.org/GNOME/gtk/-/issues/3787 (better with GTK 4.6)
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.