Preparation for Gtk4 port
MR !373 has changes that can be applied even with Gtk3 (like the composite ones and other fixes). We can incrementally cherry-pick commits from there, review them, and leave the one that can break the build and/or need to be applied all together for later.
Edited by Germán Poo-Caamaño