Fedora 34 was released recently and it includes GNOME 40 and GTK 4 4.2.0.
A quick try to build with GTK 4 showed that there are many differences so porting to GTK 4 may take quite a bit of effort.
To start, after installing the development package
sudo dnf install gtk4-devel
replace the definition of GTK_VERSION in the makefile with
GTK_VERSION=gtk4
then remove the inclusion of gdk/gdkwayland.h (which isn’t very important) in ScintillaGTK.cxx. That allows PlatGTK.cxx and ScintillaGTK.cxx to compile but it produces over 2000 lines of diagnostics.
ScintillaGTKAccessible.cxx errors out on including gtk/gtk-a11y.h but removing that doesn’t help much as its the core header needed by this file. It appears that GTK has completely changed accessibility APIs for 4 with ATK listed on
gtk.org as only for GTK 3.
Many of the classes used by Scintilla like GtkContainer have disappeared. Some areas like cursors appear easy to fix (there’s a different cursor creating function which takes a string instead of an ID) but missing classes would be more work. I don’t think that a gradual piecemeal approach to conversion will show success quickly and it looks like it would be more difficult to support GTK 4 within the same files as GTK 2 & 3 so it should be treated as a separate platform layer.
Its unlikely I’ll have time this year to work on GTK 4 so it’d be great if someone took on this project.
Neil