special case for empty comp str feels awkward.
In situations like ‘n-BACKSPACE’, the native behavior is to generate empty comp WM_IME_COMPOSITION and WM_IME_ENDCOMPOSITION. WM_IME_ENDCOMPOSITION alone does not clear the composition string in some applications. Mery.exe does.
winex11 sends an empty comp string in this situation. All currently accessible implementations of the xim server do so. Off topic, preedit_start and preedit_done don't need to call post_ime_update. winemac and winewayland don't even have a counterpart for these callbacks.
winemac also generally returns an empty comp string. Only for “Korean 2-set Keyboard”, comp_str is returned as result_str and generates WM_IME_KEYDOWN::VK_BACK. Anyway, that's fine...
wayland returns a null comp string, not an empty comp string. the v1 approach only generates the WM_IME_ENDCOMPOSITION message. In my opinion, in the v1 approach, the null comp string should be replaced by an empty comp string. Probably in text_input_done.
In the v2 approach, it works in winewayland without any modification on the winewayland side. Even if lparam==0x1bf, it should be fine as long as the COMPOSITIONSTRING contains the correct value.
Honestly, I prefer the v2 approach, but either way is fine. Any advice would be appreciated.