Mike FABIAN
Mike FABIAN
ibus-typing-booster does *not* have this problem, see this video: https://user-images.githubusercontent.com/2330175/179356824-e4591cfd-90ad-4189-9eb3-5ac95ad91c59.mp4
The reason why this works in ibus-typing-booster is this function `do_reset()`: https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/hunspell_table.py#L6256 ```python def do_reset(self) -> None: '''Called when the mouse pointer is used to move to cursor to a...
I use this function `do_reset` to clear the context and the input and update the ui (which closes the lookup table because now there is no input). And if new...
OpenBangla has an `engine_reset` function: https://github.com/OpenBangla/OpenBangla-Keyboard/blob/develop/src/engine/ibus/main.cpp#L82 ```C void engine_reset() { ibus_lookup_table_clear(table); ibus_engine_hide_preedit_text(engine); ibus_engine_hide_auxiliary_text(engine); ibus_engine_hide_lookup_table(engine); } ``` which does similar stuff, but it is not connected to a callback.
In create_engine_cb() https://github.com/OpenBangla/OpenBangla-Keyboard/blob/develop/src/engine/ibus/main.cpp#L310 only these signals are connected: ```C g_signal_connect(engine, "process-key-event", G_CALLBACK(engine_process_key_event_cb), NULL); g_signal_connect(engine, "enable", G_CALLBACK(engine_enable_cb), NULL); g_signal_connect(engine, "disable", G_CALLBACK(engine_disable_cb), NULL); g_signal_connect(engine, "focus-out", G_CALLBACK(engine_focus_out_cb), NULL); g_signal_connect(engine, "candidate-clicked", G_CALLBACK(engine_candidate_clicked_cb), NULL); ```
engine_focus_out_cb() https://github.com/OpenBangla/OpenBangla-Keyboard/blob/develop/src/engine/ibus/main.cpp#L295 finishes the input session and calls reset: ```C void engine_focus_out_cb(IBusEngine *engine) { LOG_DEBUG("[IM:iBus]: IM Focus out\n"); if(riti_context_ongoing_input_session(ctx)) { riti_context_finish_input_session(ctx); engine_reset(); } } ```
So I think another connect like ```C g_signal_connect(engine, "reset", G_CALLBACK(engine_reset_cb), NULL); ``` is needed.
And ```C void engine_reset_cb(IBusEngine *engine) { LOG_DEBUG("[IM:iBus]: IM Reset\n"); if(riti_context_ongoing_input_session(ctx)) { riti_context_finish_input_session(ctx); engine_reset(); } } ```
I have no time to make a patch and test this right now, so I just quickly wrote what I think the problem is.
Did it work? I think I could try to make a patch soon. Should I make a patch or did you do it already?