But I do see the problem that you described. With event compression turned off, the last motion event is kept hidden somewhere in GTK until a key or a mouse button is clicked. I made the changes in gdkevents.c in order to find out if the missing motion event is held in GTK itself or in one of its dependencies.Thanks for looking at this. I guess from what you say, you do not see the problem. I understand, as I think it would become pretty obvious to anyone for example running GIMP. So even if this isn't a problem specific to my program, it may at least be a problem specific to my environment.
I have written a bug report on GTK+ for now
https://gitlab.gnome.org/GNOME/gtk/-/issues/4946