diff options
author | Choe Hwanjin <choe.hwanjin@gmail.com> | 2018-05-26 22:25:53 +0900 |
---|---|---|
committer | Choe Hwanjin <choe.hwanjin@gmail.com> | 2018-05-26 22:25:53 +0900 |
commit | 704625c375214a51996d7173d66734c4352edfdc (patch) | |
tree | ad0a6dd6826ed8bddacf1fd80541bc4b6cd60b3d /src | |
parent | 1592a42edf053a28b050d9f11d4a2dd46ee6b4ff (diff) | |
download | ibus-hangul-704625c375214a51996d7173d66734c4352edfdc.tar.gz |
Add "use-event-forwarding" option
This option may turn on/off "event forwarding workaround".
I prefer to have an option for this kind of workaround.
Diffstat (limited to 'src')
-rw-r--r-- | src/engine.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/engine.c b/src/engine.c index 0535350..021ac43 100644 --- a/src/engine.c +++ b/src/engine.c @@ -213,6 +213,10 @@ static gboolean word_commit = FALSE; static gboolean auto_reorder = TRUE; static gboolean disable_latin_mode = FALSE; static int initial_input_mode = INPUT_MODE_LATIN; +/** + * whether to use event forwarding workaround + */ +static gboolean use_event_forwarding = TRUE; static glong ucschar_strlen (const ucschar* str) @@ -339,6 +343,12 @@ ibus_hangul_init (IBusBus *bus) g_clear_pointer (&value, g_variant_unref); } + value = g_settings_get_value (settings_hangul, "use-event-forwarding"); + if (value != NULL) { + use_event_forwarding = g_variant_get_boolean (value); + g_clear_pointer (&value, g_variant_unref); + } + value = g_settings_get_value (settings_panel, "lookup-table-orientation"); if (value != NULL) { lookup_table_orientation = g_variant_get_int32(value); @@ -1250,11 +1260,15 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine, * * See: https://github.com/choehwanjin/ibus-hangul/issues/40 */ - if (!retval) { - ibus_engine_forward_key_event (engine, keyval, keycode, modifiers); + if (use_event_forwarding) { + if (!retval) { + ibus_engine_forward_key_event (engine, keyval, keycode, modifiers); + } + + return TRUE; } - return TRUE; + return retval; } static void |