input-surface: Better check for completion mode and disable word grab in presage
When the IM signals surrounding text changes we want to perform the same
checks as on preedit changes (on_completer_preedit_changed
) or
completion updates (on_completer_update
). Otherwise we end up picking
up preedit again due to:
Long press for cursor mode -> on_osk_mode_changed() -> submit preedit via pos_input_surface_submit_current_preedit() … due to that commit we receive new surrounding text from the compositor -> pos_completer_presage_set_surrounding_text -> we update preedit again
This fixes the long standing issue where entering cursor mode would double the preedit when using the presage completer (hunspell and others are not affected as they don't care about changed surrounding text).