This is an attempt to fix issue #1428 (closed).
The changes work for me, and fix the problems pointed out by the original submitter. The patches also do not seem to introduce any API breakages, although API behaviour changes somewhat, obviously.
That said, there's one remaining problem: GTKIMContextSimple uses Fixed that too, if somewhat inelegantly.
guint16 for a lot of keyval manipulations, which breaks the cases where keyval is bigger than
guint16 (such as the 'Y' and backtick keys in Gothic layout). Unfortunately, fixing that requires some major surgery all over
compose-parse.py, and changes of the
gdk_win32_keymap_check_compose() function that was introduced in 3.20 and is part of the GDK API now.
GTK4 will require similar changes.