Fwiw on winex11 XmbResetIC is usually broken and doesn't do the right thing, and XNPreeditState also doesn't have any effect with many XIM backends. We also pass the focused HWND to them, which ends up with X11DRV_get_ic failing most of the time as it's not the top-level window. I kept the calls, but I don't think they are very useful.
This could be changed later, either by dropping them entirely, or maybe by sending an artificial Escape key press to XIM through a XFilterEvent call. As far as I can see this is the only way to force some IME, like IBus, to close their composition window without generating a result.