gdk_event_set_state() is needed for IBus GTK4 IM module
I tried to add IBus GTK4 IM module: https://github.com/fujiwarat/ibus/commits/gtk4
IBus uses gdk_display_put_event() for the async process and needs to update GdkEventKey.state and ibus can ignore the received event in GtkIMContext.filter_keypress().
GTK3 can access GdkEventKey.state directly but GTK4 needs the setter API.
Current behavior
An infinite loop can happen in GtkIMContext.filter_keypress() if gdk_event_set_state() is not implemented.
Version information
gtk 3.93
ibus master