From 553497c72c1704eede3ea7cfb0b7b60db6d090d1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 01 2014 08:43:39 +0000 Subject: import ibus-hangul-1.4.2-10.el7 --- diff --git a/SOURCES/ibus-hangul-hangul-toggle.patch b/SOURCES/ibus-hangul-hangul-toggle.patch new file mode 100644 index 0000000..9965862 --- /dev/null +++ b/SOURCES/ibus-hangul-hangul-toggle.patch @@ -0,0 +1,911 @@ +diff --git a/setup/main.py b/setup/main.py +index ce33db7..eb6525c 100644 +--- a/setup/main.py ++++ b/setup/main.py +@@ -78,6 +78,29 @@ class Setup (): + auto_reorder = self.__read("AutoReorder", default).get_boolean() + self.__auto_reorder.set_active(auto_reorder) + ++ button = self.__builder.get_object("HangulKeyListAddButton") ++ button.connect("clicked", self.on_hangul_key_add, None) ++ ++ button = self.__builder.get_object("HangulKeyListRemoveButton") ++ button.connect("clicked", self.on_hangul_key_remove, None) ++ ++ model = Gtk.ListStore(str) ++ ++ default = GLib.Variant.new_string("Hangul,Shift+space") ++ keylist_str = self.__read("HangulKeys", default).get_string() ++ self.__hangul_key_list_str = keylist_str.split(',') ++ for i in self.__hangul_key_list_str: ++ model.append([i]) ++ ++ self.__hangul_key_list = self.__builder.get_object("HangulKeyList") ++ self.__hangul_key_list.set_model(model) ++ column = Gtk.TreeViewColumn() ++ column.set_title("key") ++ renderer = Gtk.CellRendererText() ++ column.pack_start(renderer, True) ++ column.add_attribute(renderer, "text", 0) ++ self.__hangul_key_list.append_column(column) ++ + # hanja tab + button = self.__builder.get_object("HanjaKeyListAddButton") + button.connect("clicked", self.on_hanja_key_add, None) +@@ -133,6 +156,18 @@ class Setup (): + auto_reorder = self.__auto_reorder.get_active() + self.__write("AutoReorder", GLib.Variant.new_boolean(auto_reorder)) + ++ model = self.__hangul_key_list.get_model() ++ str = "" ++ iter = model.get_iter_first() ++ while iter: ++ if len(str) > 0: ++ str += "," ++ str += model.get_value(iter, 0) ++ else: ++ str += model.get_value(iter, 0) ++ iter = model.iter_next(iter) ++ self.__write("HangulKeys", GLib.Variant.new_string(str)) ++ + model = self.__hanja_key_list.get_model() + str = "" + iter = model.get_iter_first() +@@ -155,6 +190,30 @@ class Setup (): + def on_ok(self): + self.apply() + ++ def on_hangul_key_add(self, widget, data = None): ++ dialog = KeyCaptureDialog(_("Select Hangul toggle key"), self.__window) ++ res = dialog.run() ++ if res == Gtk.ResponseType.OK: ++ key_str = dialog.get_key_string() ++ if len(key_str) > 0: ++ model = self.__hangul_key_list.get_model() ++ iter = model.get_iter_first() ++ while iter: ++ str = model.get_value(iter, 0) ++ if str == key_str: ++ model.remove(iter) ++ break ++ iter = model.iter_next(iter) ++ ++ model.append([key_str]) ++ dialog.destroy() ++ ++ def on_hangul_key_remove(self, widget, data = None): ++ selection = self.__hangul_key_list.get_selection() ++ (model, iter) = selection.get_selected() ++ if model and iter: ++ model.remove(iter) ++ + def on_hanja_key_add(self, widget, data = None): + dialog = KeyCaptureDialog(_("Select Hanja key"), self.__window) + res = dialog.run() +@@ -187,6 +246,8 @@ class Setup (): + if i[1] == value: + self.__hangul_keyboard.set_active(i[2]) + break ++ elif name == "HangulKeys": ++ self.__hangul_key_list_str = value.split(',') + elif name == "HanjaKeys": + self.__hanja_key_list_str = value.split(',') + +diff --git a/setup/setup.ui b/setup/setup.ui +index 6f928b0..2fa8c49 100644 +--- a/setup/setup.ui ++++ b/setup/setup.ui +@@ -1,16 +1,18 @@ +- ++ ++ + +- +- ++ + ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + IBusHangul Setup + center-on-parent + dialog + +- ++ + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical + +@@ -18,27 +20,28 @@ + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK +- 4 + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 +- vertical + 12 + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK +- vertical + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + <b>Keyboard Layout</b> + True +@@ -46,6 +49,7 @@ + + + False ++ True + 0 + + +@@ -55,16 +59,19 @@ + + + False ++ True + 0 + + + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Hangul keyboard: + True +@@ -80,43 +87,51 @@ + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + ++ True ++ True + 1 + + + + + False ++ True + 1 + + + + + False ++ True + 0 + + + + + True +- vertical ++ False + + + True +- vertical ++ False + + + True ++ False + + + True ++ False + <b>Etc</b> + True + + + False ++ True + 0 + + +@@ -125,12 +140,15 @@ + + + ++ True ++ True + 0 + + + + + True ++ False + + + Commit in _word unit +@@ -138,21 +156,27 @@ + True + False + True ++ 0.5 + True + + ++ True ++ True + 12 + 0 + + + + ++ True ++ True + 1 + + + + + True ++ False + + + Automatic _reordering +@@ -160,39 +184,165 @@ + True + False + True ++ 0.5 + True + True + + ++ True ++ True + 12 + 0 + + + + ++ True ++ True + 2 + + + + + False ++ True + 0 + + + + + False ++ True + 1 + + + +- ++ ++ True ++ False ++ vertical ++ ++ ++ True ++ False ++ start ++ <b>Hangul toggle key</b> ++ True ++ ++ ++ False ++ True ++ 0 ++ ++ ++ ++ ++ True ++ False ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ ++ ++ True ++ False ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ ++ ++ ++ False ++ False ++ 0 ++ ++ ++ ++ ++ True ++ True ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ in ++ ++ ++ True ++ True ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ False ++ False ++ ++ ++ ++ ++ ++ ++ ++ True ++ True ++ 1 ++ ++ ++ ++ ++ True ++ False ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ 6 ++ 6 ++ start ++ ++ ++ gtk-add ++ True ++ True ++ True ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ True ++ ++ ++ False ++ False ++ 0 ++ ++ ++ ++ ++ gtk-remove ++ True ++ True ++ True ++ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK ++ True ++ ++ ++ False ++ False ++ 1 ++ ++ ++ ++ ++ False ++ True ++ 2 ++ ++ ++ ++ ++ True ++ True ++ 1 ++ ++ ++ ++ ++ True ++ True ++ 2 ++ + + + + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Hangul + +@@ -203,22 +353,24 @@ + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 +- vertical + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK +- vertical + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + <b>Hanja key</b> + True +@@ -226,6 +378,7 @@ + + + False ++ True + 0 + + +@@ -235,16 +388,19 @@ + + + False ++ True + 0 + + + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + +@@ -259,8 +415,6 @@ + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK +- automatic +- automatic + in + + +@@ -270,19 +424,24 @@ + False + False + False ++ ++ ++ + + + + ++ True ++ True + 1 + + + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 6 +- vertical + 6 + start + +@@ -318,16 +477,21 @@ + + + False ++ True + 2 + + + + ++ True ++ True + 1 + + + + ++ True ++ True + 0 + + +@@ -339,6 +503,7 @@ + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Hanja + +@@ -350,6 +515,7 @@ + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + <b>Not implemented</b> + True +@@ -361,6 +527,7 @@ + + + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Advanced + +@@ -371,12 +538,15 @@ + + + ++ False ++ True + 1 + + + +- ++ + True ++ False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + end +@@ -428,6 +598,7 @@ + + + False ++ True + end + 1 + +diff --git a/src/engine.c b/src/engine.c +index 602f073..161f041 100644 +--- a/src/engine.c ++++ b/src/engine.c +@@ -35,7 +35,7 @@ + typedef struct _IBusHangulEngine IBusHangulEngine; + typedef struct _IBusHangulEngineClass IBusHangulEngineClass; + +-typedef struct _HanjaKeyList HanjaKeyList; ++typedef struct _HotkeyList HotkeyList; + + struct _IBusHangulEngine { + IBusEngine parent; +@@ -50,6 +50,7 @@ struct _IBusHangulEngine { + + IBusLookupTable *table; + ++ IBusProperty *prop_hangul_mode; + IBusProperty *prop_hanja_mode; + IBusPropList *prop_list; + }; +@@ -63,7 +64,7 @@ struct KeyEvent { + guint modifiers; + }; + +-struct _HanjaKeyList { ++struct _HotkeyList { + guint all_modifiers; + GArray *keys; + }; +@@ -159,17 +160,17 @@ static gboolean key_event_list_match (GArray *list, + guint keyval, + guint modifiers); + +-static void hanja_key_list_init (HanjaKeyList *list); +-static void hanja_key_list_fini (HanjaKeyList *list); +-static void hanja_key_list_set_from_string(HanjaKeyList *list, ++static void hotkey_list_init (HotkeyList *list); ++static void hotkey_list_fini (HotkeyList *list); ++static void hotkey_list_set_from_string (HotkeyList *list, + const char *str); +-static void hanja_key_list_append (HanjaKeyList *list, ++static void hotkey_list_append (HotkeyList *list, + guint keyval, + guint modifiers); +-static gboolean hanja_key_list_match (HanjaKeyList *list, ++static gboolean hotkey_list_match (HotkeyList *list, + guint keyval, + guint modifiers); +-static gboolean hanja_key_list_has_modifier (HanjaKeyList *list, ++static gboolean hotkey_list_has_modifier (HotkeyList *list, + guint keyval); + + static glong ucschar_strlen (const ucschar* str); +@@ -179,7 +180,8 @@ static HanjaTable *hanja_table = NULL; + static HanjaTable *symbol_table = NULL; + static IBusConfig *config = NULL; + static GString *hangul_keyboard = NULL; +-static HanjaKeyList hanja_keys; ++static HotkeyList hangul_keys; ++static HotkeyList hanja_keys; + static int lookup_table_orientation = 0; + static IBusKeymap *keymap = NULL; + static gboolean word_commit = FALSE; +@@ -243,17 +245,30 @@ ibus_hangul_init (IBusBus *bus) + g_variant_unref(value); + } + +- hanja_key_list_init(&hanja_keys); ++ hotkey_list_init(&hangul_keys); ++ ++ value = ibus_config_get_value (config, "engine/Hangul", ++ "HangulKeys"); ++ if (value != NULL) { ++ const gchar* str = g_variant_get_string (value, NULL); ++ hotkey_list_set_from_string(&hangul_keys, str); ++ g_variant_unref(value); ++ } else { ++ hotkey_list_append(&hangul_keys, IBUS_Hangul, 0); ++ hotkey_list_append(&hangul_keys, IBUS_space, IBUS_SHIFT_MASK); ++ } ++ ++ hotkey_list_init(&hanja_keys); + + value = ibus_config_get_value (config, "engine/Hangul", + "HanjaKeys"); + if (value != NULL) { + const gchar* str = g_variant_get_string (value, NULL); +- hanja_key_list_set_from_string(&hanja_keys, str); ++ hotkey_list_set_from_string(&hanja_keys, str); + g_variant_unref(value); + } else { +- hanja_key_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0); +- hanja_key_list_append(&hanja_keys, IBUS_F9, 0); ++ hotkey_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0); ++ hotkey_list_append(&hanja_keys, IBUS_F9, 0); + } + + value = ibus_config_get_value (config, "engine/Hangul", +@@ -280,7 +295,8 @@ ibus_hangul_exit (void) + keymap = NULL; + } + +- hanja_key_list_fini(&hanja_keys); ++ hotkey_list_fini(&hangul_keys); ++ hotkey_list_fini(&hanja_keys); + + hanja_table_delete (hanja_table); + hanja_table = NULL; +@@ -347,6 +363,18 @@ ibus_hangul_engine_init (IBusHangulEngine *hangul) + hangul->prop_list = ibus_prop_list_new (); + g_object_ref_sink (hangul->prop_list); + ++ label = ibus_text_new_from_string (_("Hangul mode")); ++ tooltip = ibus_text_new_from_string (_("Enable/Disable Hangul mode")); ++ prop = ibus_property_new ("hangul_mode", ++ PROP_TYPE_TOGGLE, ++ label, ++ NULL, ++ tooltip, ++ TRUE, TRUE, PROP_STATE_UNCHECKED, NULL); ++ g_object_ref_sink (prop); ++ ibus_prop_list_append (hangul->prop_list, prop); ++ hangul->prop_hangul_mode = prop; ++ + label = ibus_text_new_from_string (_("Hanja lock")); + tooltip = ibus_text_new_from_string (_("Enable/Disable Hanja mode")); + prop = ibus_property_new ("hanja_mode", +@@ -394,6 +422,11 @@ ibus_hangul_engine_constructor (GType type, + static void + ibus_hangul_engine_destroy (IBusHangulEngine *hangul) + { ++ if (hangul->prop_hangul_mode) { ++ g_object_unref (hangul->prop_hangul_mode); ++ hangul->prop_hangul_mode = NULL; ++ } ++ + if (hangul->prop_hanja_mode) { + g_object_unref (hangul->prop_hanja_mode); + hangul->prop_hanja_mode = NULL; +@@ -929,17 +962,39 @@ ibus_hangul_engine_process_key_event (IBusEngine *engine, + if (keyval == IBUS_Shift_L || keyval == IBUS_Shift_R) + return FALSE; + +- // If hanja key has any modifiers, we ignore that modifier keyval, +- // or we cannot make the hanja key work. ++ // If a hotkey has any modifiers, we ignore that modifier ++ // keyval, or we cannot make the hanja key work. + // Because when we get the modifier key alone, we commit the + // current preedit string. So after that, even if we get the + // right hanja key event, we don't have preedit string to be changed + // to hanja word. + // See this bug: http://code.google.com/p/ibus/issues/detail?id=1036 +- if (hanja_key_list_has_modifier(&hanja_keys, keyval)) ++ if (hotkey_list_has_modifier(&hangul_keys, keyval)) ++ return FALSE; ++ ++ if (hotkey_list_match(&hangul_keys, keyval, modifiers)) { ++ if (hangul->hangul_mode) ++ ibus_hangul_engine_flush (hangul); ++ ++ hangul->hangul_mode = !hangul->hangul_mode; ++ if (hangul->hangul_mode) { ++ ibus_property_set_state (hangul->prop_hangul_mode, ++ PROP_STATE_CHECKED); ++ } else { ++ ibus_property_set_state (hangul->prop_hangul_mode, ++ PROP_STATE_UNCHECKED); ++ } ++ ibus_engine_update_property (engine, hangul->prop_hangul_mode); ++ return TRUE; ++ } ++ ++ if (!hangul->hangul_mode) ++ return FALSE; ++ ++ if (hotkey_list_has_modifier(&hanja_keys, keyval)) + return FALSE; + +- if (hanja_key_list_match(&hanja_keys, keyval, modifiers)) { ++ if (hotkey_list_match(&hanja_keys, keyval, modifiers)) { + if (hangul->hanja_list == NULL) { + ibus_hangul_engine_update_lookup_table (hangul); + } else { +@@ -1095,6 +1150,12 @@ ibus_hangul_engine_focus_in (IBusEngine *engine) + { + IBusHangulEngine *hangul = (IBusHangulEngine *) engine; + ++ if (hangul->hangul_mode) { ++ ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_CHECKED); ++ } else { ++ ibus_property_set_state (hangul->prop_hangul_mode, PROP_STATE_UNCHECKED); ++ } ++ + if (hangul->hanja_mode) { + ibus_property_set_state (hangul->prop_hanja_mode, PROP_STATE_CHECKED); + } else { +@@ -1205,6 +1266,20 @@ ibus_hangul_engine_property_activate (IBusEngine *engine, + argv[0] = "ibus-setup-hangul"; + argv[1] = NULL; + g_spawn_async (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error); ++ } else if (strcmp(prop_name, "hangul_mode") == 0) { ++ IBusHangulEngine *hangul = (IBusHangulEngine *) engine; ++ ++ hangul->hangul_mode = !hangul->hangul_mode; ++ if (hangul->hangul_mode) { ++ ibus_property_set_state (hangul->prop_hangul_mode, ++ PROP_STATE_CHECKED); ++ } else { ++ ibus_property_set_state (hangul->prop_hangul_mode, ++ PROP_STATE_UNCHECKED); ++ } ++ ++ ibus_engine_update_property (engine, hangul->prop_hangul_mode); ++ ibus_hangul_engine_flush (hangul); + } else if (strcmp(prop_name, "hanja_mode") == 0) { + IBusHangulEngine *hangul = (IBusHangulEngine *) engine; + +@@ -1276,11 +1351,14 @@ ibus_config_value_changed (IBusConfig *config, + hangul_ic_select_keyboard (hangul->context, hangul_keyboard->str); + } else if (strcmp(name, "HanjaKeys") == 0) { + const gchar* str = g_variant_get_string(value, NULL); +- hanja_key_list_set_from_string(&hanja_keys, str); ++ hotkey_list_set_from_string(&hanja_keys, str); + } else if (strcmp(name, "WordCommit") == 0) { + word_commit = g_variant_get_boolean (value); + } else if (strcmp (name, "AutoReorder") == 0) { + auto_reorder = g_variant_get_boolean (value); ++ } else if (strcmp (name, "HangulKeys") == 0) { ++ const gchar* str = g_variant_get_string(value, NULL); ++ hotkey_list_set_from_string(&hangul_keys, str); + } + } else if (strcmp(section, "panel") == 0) { + if (strcmp(name, "lookup_table_orientation") == 0) { +@@ -1358,20 +1436,20 @@ ibus_hangul_engine_candidate_clicked (IBusEngine *engine, + } + + static void +-hanja_key_list_init(HanjaKeyList* list) ++hotkey_list_init(HotkeyList* list) + { + list->all_modifiers = 0; + list->keys = g_array_sized_new(FALSE, TRUE, sizeof(struct KeyEvent), 4); + } + + static void +-hanja_key_list_fini(HanjaKeyList* list) ++hotkey_list_fini(HotkeyList* list) + { + g_array_free(list->keys, TRUE); + } + + static void +-hanja_key_list_append_from_string(HanjaKeyList *list, const char* str) ++hotkey_list_append_from_string(HotkeyList *list, const char* str) + { + guint keyval = 0; + guint modifiers = 0; +@@ -1379,19 +1457,19 @@ hanja_key_list_append_from_string(HanjaKeyList *list, const char* str) + + res = ibus_key_event_from_string(str, &keyval, &modifiers); + if (res) { +- hanja_key_list_append(list, keyval, modifiers); ++ hotkey_list_append(list, keyval, modifiers); + } + } + + static void +-hanja_key_list_append(HanjaKeyList *list, guint keyval, guint modifiers) ++hotkey_list_append(HotkeyList *list, guint keyval, guint modifiers) + { + list->all_modifiers |= modifiers; + key_event_list_append(list->keys, keyval, modifiers); + } + + static void +-hanja_key_list_set_from_string(HanjaKeyList *list, const char* str) ++hotkey_list_set_from_string(HotkeyList *list, const char* str) + { + gchar** items = g_strsplit(str, ",", 0); + +@@ -1401,20 +1479,20 @@ hanja_key_list_set_from_string(HanjaKeyList *list, const char* str) + if (items != NULL) { + int i; + for (i = 0; items[i] != NULL; ++i) { +- hanja_key_list_append_from_string(list, items[i]); ++ hotkey_list_append_from_string(list, items[i]); + } + g_strfreev(items); + } + } + + static gboolean +-hanja_key_list_match(HanjaKeyList* list, guint keyval, guint modifiers) ++hotkey_list_match(HotkeyList* list, guint keyval, guint modifiers) + { + return key_event_list_match(list->keys, keyval, modifiers); + } + + static gboolean +-hanja_key_list_has_modifier(HanjaKeyList* list, guint keyval) ++hotkey_list_has_modifier(HotkeyList* list, guint keyval) + { + if (list->all_modifiers & IBUS_CONTROL_MASK) { + if (keyval == IBUS_Control_L || keyval == IBUS_Control_R) diff --git a/SOURCES/ibus-hangul-setup-abspath.patch b/SOURCES/ibus-hangul-setup-abspath.patch index 1b1d4d2..5884ed5 100644 --- a/SOURCES/ibus-hangul-setup-abspath.patch +++ b/SOURCES/ibus-hangul-setup-abspath.patch @@ -8,11 +8,11 @@ Partially 8d3735e4, which installs ibus-setup-hangul under bindir. src/engine.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) -diff --git a/src/engine.c b/src/engine.c -index 602f073..e918a15 100644 ---- a/src/engine.c -+++ b/src/engine.c -@@ -1201,10 +1201,19 @@ ibus_hangul_engine_property_activate (IBusEngine *engine, +Index: ibus-hangul-1.4.2/src/engine.c +=================================================================== +--- ibus-hangul-1.4.2.orig/src/engine.c ++++ ibus-hangul-1.4.2/src/engine.c +@@ -1262,10 +1262,19 @@ ibus_hangul_engine_property_activate (IB if (strcmp(prop_name, "setup") == 0) { GError *error = NULL; gchar *argv[2] = { NULL, }; @@ -31,9 +31,6 @@ index 602f073..e918a15 100644 + g_spawn_async (NULL, argv, NULL, 0, NULL, NULL, NULL, &error); + + g_free(path); - } else if (strcmp(prop_name, "hanja_mode") == 0) { + } else if (strcmp(prop_name, "hangul_mode") == 0) { IBusHangulEngine *hangul = (IBusHangulEngine *) engine; --- -1.8.3.1 - diff --git a/SPECS/ibus-hangul.spec b/SPECS/ibus-hangul.spec index 9bf1d23..8f5849b 100644 --- a/SPECS/ibus-hangul.spec +++ b/SPECS/ibus-hangul.spec @@ -3,7 +3,7 @@ Name: ibus-hangul Version: 1.4.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The Hangul engine for IBus input platform License: GPLv2+ Group: System Environment/Libraries @@ -11,6 +11,7 @@ URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz # upstreamed patches #Patch0: ibus-hangul-HEAD.patch +Patch0: ibus-hangul-hangul-toggle.patch # not upstreamed patches Patch1: ibus-hangul-dconf-prefix.patch Patch2: ibus-hangul-setup-abspath.patch @@ -34,6 +35,7 @@ libhangul. %prep %setup -q +%patch0 -p1 -b .hangul-toggle %patch1 -p1 -b .dconf-prefix %patch2 -p1 -b .setup-abspath @@ -78,6 +80,11 @@ fi %{_datadir}/icons/hicolor/*/apps/* %changelog +* Thu Aug 7 2014 Daiki Ueno - 1.4.2-10 +- Add ibus-hangul-hangul-toggle.patch +- Fix bug 1071351 - Cannot switch English input mode and Hangul + (Korean) input mode by Hangul key + * Fri Jan 24 2014 Daniel Mach - 1.4.2-9 - Mass rebuild 2014-01-24