Switch to GTK4
Migrate from GTK3 to GTK4.
Work in progress, the following still needs fixing:
- Flutter sysroot needs updating to recent version of GTK4
- Accessibility
- Cursors
- Clipboard
- Intercepting window close events
- Secondary mouse pointer events
- Keyboard co-ordinate transforms
What's different from GTK3:
- No numlock support (not in GTK4)
- Unable to pass unhandled keyboard events to other GTK widgets (not available in GTK4)
https://github.com/flutter/flutter/issues/94804
I'm currently building this branch without an updated sysroot by using my local headers (Ubuntu 23.10):
ln -s /usr/include/vulkan/ ../build/linux/debian_sid_amd64-sysroot/usr/include/vulkan
ln -s /usr/include/vk_video/ ../build/linux/debian_sid_amd64-sysroot/usr/include/vk_video
rm -r ../build/linux/debian_sid_amd64-sysroot/usr/include/gtk-4.0/
ln -s /usr/include/gtk-4.0 ../build/linux/debian_sid_amd64-sysroot/usr/include/gtk-4.0
ln -fs /usr/lib/x86_64-linux-gnu/libgtk-4.so ../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu/libgtk-4.so
The method I've been working on for exposing the accessibility information doesn't seem possible using the current GTK4 API - https://gitlab.gnome.org/GNOME/gtk/-/issues/6495. I'm going to investigate if this can be done using another method. If GTK does allow this, then it will only be in a new release of GTK4, which may make the Flutter changes difficult to distribute.
I'll close this as it's not likely to be completed soon, instead https://github.com/flutter/engine/pull/53369 is the first step that needs to land.