diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch deleted file mode 100644 index 65b51f2..0000000 --- a/ibus-HEAD.patch +++ /dev/null @@ -1,4120 +0,0 @@ -From 7edaefdc1d80aefdbbc2dc52526c20715759da83 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Wed, 22 Aug 2018 17:20:53 +0900 -Subject: [PATCH] ui/gtk3: Do not clear unicode data when emoji annotation lang - is changed - ---- - ui/gtk3/emojier.vala | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala -index 85dcdceb..637ae049 100644 ---- a/ui/gtk3/emojier.vala -+++ b/ui/gtk3/emojier.vala -@@ -440,13 +440,17 @@ public class IBusEmojier : Gtk.ApplicationWindow { - m_emoji_to_emoji_variants_dict = - new GLib.HashTable>(GLib.str_hash, - GLib.str_equal); -- m_unicode_to_data_dict = -+ if (m_unicode_to_data_dict == null) { -+ m_unicode_to_data_dict = - new GLib.HashTable( - GLib.direct_hash, - GLib.direct_equal); -- m_name_to_unicodes_dict = -+ } -+ if (m_name_to_unicodes_dict == null) { -+ m_name_to_unicodes_dict = - new GLib.HashTable>(GLib.str_hash, - GLib.str_equal); -+ } - } - - --- -2.17.1 - -From 28d22176aee6be97d88dd6c60fa5395c79563ec0 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 30 Aug 2018 12:57:33 +0900 -Subject: [PATCH] ui/gtk3: Fix SEGV when type ASCII on emojier - -Emojier still included Gtk.Entry, accepted key events in Wayland, -reset the lookup table and it caused SEGV because IBus.Text -is NULL in the lookup table in Emojier.get_current_candidate(). -Now Gtk.Entry is deleted completely. - -BUG=rhbz#1618682 ---- - ui/gtk3/emojier.vala | 139 +------------------------------------------ - 1 file changed, 1 insertion(+), 138 deletions(-) - -diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala -index 637ae049..0f455800 100644 ---- a/ui/gtk3/emojier.vala -+++ b/ui/gtk3/emojier.vala -@@ -283,7 +283,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - - private ThemedRGBA m_rgba; - private Gtk.Box m_vbox; -- private EEntry m_entry; - /* If emojier is emoji category list or Unicode category list, - * m_annotation is "" and preedit is also "". - * If emojier is candidate mode, m_annotation is an annotation and -@@ -367,23 +366,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - m_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0); - add(m_vbox); - -- m_entry = new EEntry(); -- m_entry.set_placeholder_text(_("Type annotation or choose emoji")); -- //m_vbox.add(m_entry); -- m_entry.changed.connect(() => { -- update_candidate_window(); -- }); -- m_entry.icon_release.connect((icon_pos, event) => { -- hide_candidate_panel(); -- }); -- -- /* Set the accessible role of the label to a status bar so it -- * will emit name changed events that can be used by screen -- * readers. -- */ -- Atk.Object obj = m_entry.get_accessible(); -- obj.set_role (Atk.Role.STATUSBAR); -- - // The constructor of IBus.LookupTable does not support more than - // 16 pages. - m_lookup_table = new IBus.LookupTable(1, 0, true, true); -@@ -1806,18 +1788,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - m_lookup_table.cursor_up(); - else if (keyval == Gdk.Key.Right) - m_lookup_table.cursor_down(); -- } else if (m_entry.get_text().length > 0) { -- int step = 0; -- if (keyval == Gdk.Key.Left) -- step = -1; -- else if (keyval == Gdk.Key.Right) -- step = 1; -- GLib.Signal.emit_by_name( -- m_entry, "move-cursor", -- Gtk.MovementStep.VISUAL_POSITIONS, -- step, -- (modifiers & Gdk.ModifierType.SHIFT_MASK) != 0 -- ? true : false); - } else { - // For Gdk.Key.f and Gdk.Key.b - if (keyval == Gdk.Key.Left) -@@ -1880,20 +1850,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - } - return true; - } -- if (m_entry.get_text().length > 0) { -- int step = 0; -- if (keyval == Gdk.Key.Home) -- step = -1; -- else if (keyval == Gdk.Key.End) -- step = 1; -- GLib.Signal.emit_by_name( -- m_entry, "move-cursor", -- Gtk.MovementStep.DISPLAY_LINE_ENDS, -- step, -- (modifiers & Gdk.ModifierType.SHIFT_MASK) != 0 -- ? true : false); -- return true; -- } - return category_list_cursor_move(keyval); - } - -@@ -1941,28 +1897,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - } - - -- private void entry_enter_keyval(uint keyval) { -- unichar ch = IBus.keyval_to_unicode(keyval); -- if (ch.iscntrl()) -- return; -- string str = ch.to_string(); -- -- // what gtk_entry_commit_cb() do -- if (m_entry.get_selection_bounds(null, null)) { -- m_entry.delete_selection(); -- } else { -- if (m_entry.get_overwrite_mode()) { -- uint text_length = m_entry.get_buffer().get_length(); -- if (m_entry.cursor_position < text_length) -- m_entry.delete_from_cursor(Gtk.DeleteType.CHARS, 1); -- } -- } -- int pos = m_entry.get_position(); -- m_entry.insert_text(str, -1, ref pos); -- m_entry.set_position(pos); -- } -- -- - private Gdk.Rectangle get_monitor_geometry() { - Gdk.Rectangle monitor_area = { 0, }; - -@@ -2245,10 +2179,7 @@ public class IBusEmojier : Gtk.ApplicationWindow { - /* Let gtk recalculate the window size. */ - resize(1, 1); - -- m_entry.set_text(""); -- - show_category_list(); -- m_entry.set_activates_default(true); - show_all(); - - /* Some window managers, e.g. MATE, GNOME, Plasma desktops, -@@ -2289,13 +2220,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - m_loop.run(); - m_loop = null; - -- // Need focus-out on Gtk.Entry to send the emoji to applications. -- Gdk.Event fevent = new Gdk.Event(Gdk.EventType.FOCUS_CHANGE); -- fevent.focus_change.in = 0; -- fevent.focus_change.window = get_window(); -- m_entry.send_focus_change(fevent); -- fevent.focus_change.window = null; -- - hide(); - // Make sure the switcher is hidden before returning from this function. - while (Gtk.events_pending()) -@@ -2357,36 +2281,9 @@ public class IBusEmojier : Gtk.ApplicationWindow { - hide(); - } - return true; -- case Gdk.Key.BackSpace: -- if (m_entry.get_text().length > 0) { -- if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) { -- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor", -- Gtk.DeleteType.WORD_ENDS, -1); -- } else { -- GLib.Signal.emit_by_name(m_entry, "backspace"); -- } -- return true; -- } -- break; -- case Gdk.Key.Delete: -- case Gdk.Key.KP_Delete: -- if (m_entry.get_text().length > 0) { -- if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) { -- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor", -- Gtk.DeleteType.WORD_ENDS, 1); -- } else { -- GLib.Signal.emit_by_name(m_entry, "delete-from-cursor", -- Gtk.DeleteType.CHARS, 1); -- } -- return true; -- } -- break; - case Gdk.Key.space: - case Gdk.Key.KP_Space: -- if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) { -- if (m_entry.get_text().length > 0) -- entry_enter_keyval(keyval); -- } else if (m_candidate_panel_is_visible) { -+ if (m_candidate_panel_is_visible) { - enter_notify_disable_with_timer(); - m_lookup_table.cursor_down(); - show_candidate_panel(); -@@ -2436,10 +2333,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - key_press_cursor_home_end(Gdk.Key.End, modifiers); - show_all(); - return true; -- case Gdk.Key.Insert: -- case Gdk.Key.KP_Insert: -- GLib.Signal.emit_by_name(m_entry, "toggle-overwrite"); -- return true; - } - - if ((modifiers & Gdk.ModifierType.CONTROL_MASK) != 0) { -@@ -2470,27 +2363,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - key_press_cursor_home_end(Gdk.Key.End, modifiers); - show_all(); - return true; -- case Gdk.Key.u: -- if (m_entry.get_text().length > 0) { -- GLib.Signal.emit_by_name(m_entry, -- "delete-from-cursor", -- Gtk.DeleteType.PARAGRAPH_ENDS, -- -1); -- return true; -- } -- break; -- case Gdk.Key.a: -- if (m_entry.get_text().length > 0) { -- m_entry.select_region(0, -1); -- return true; -- } -- break; -- case Gdk.Key.x: -- if (m_entry.get_text().length > 0) { -- GLib.Signal.emit_by_name(m_entry, "cut-clipboard"); -- return true; -- } -- break; - case Gdk.Key.C: - case Gdk.Key.c: - if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) { -@@ -2503,19 +2375,11 @@ public class IBusEmojier : Gtk.ApplicationWindow { - clipboard.store(); - return true; - } -- } else if (m_entry.get_text().length > 0) { -- GLib.Signal.emit_by_name(m_entry, "copy-clipboard"); -- return true; - } - break; -- case Gdk.Key.v: -- GLib.Signal.emit_by_name(m_entry, "paste-clipboard"); -- return true; - } - return false; - } -- -- entry_enter_keyval(keyval); - return true; - } - -@@ -2595,7 +2459,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - - uint32 timestamp = event.get_time(); - present_with_time(timestamp); -- m_entry.set_activates_default(true); - } - - --- -2.17.1 - -From e6badb494e0a31b7aca3a5078a5dc5b27b83390d Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 30 Aug 2018 12:57:46 +0900 -Subject: [PATCH] ui/gtk3: Support Shift-Space to insert a Space on Emojier - preedit - -Implemented Shift-Space on preedit since Shift-Space had worked on -Emojier's GtkEntry in the previous release. ---- - ui/gtk3/panelbinding.vala | 27 ++++++++++++++++++++------- - 1 file changed, 20 insertions(+), 7 deletions(-) - -diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala -index 981b5509..4ebff8da 100644 ---- a/ui/gtk3/panelbinding.vala -+++ b/ui/gtk3/panelbinding.vala -@@ -548,6 +548,19 @@ class PanelBinding : IBus.PanelService { - } - - -+ private bool key_press_keyval(uint keyval) { -+ unichar ch = IBus.keyval_to_unicode(keyval); -+ if (ch.iscntrl()) -+ return false; -+ string str = ch.to_string(); -+ m_preedit.append_text(str); -+ string annotation = m_preedit.get_text(); -+ m_emojier.set_annotation(annotation); -+ m_preedit.set_emoji(""); -+ return true; -+ } -+ -+ - private bool key_press_enter() { - if (m_extension_name != "unicode" && is_emoji_lookup_table()) { - // Check if variats exist -@@ -899,6 +912,12 @@ class PanelBinding : IBus.PanelService { - break; - case Gdk.Key.space: - case Gdk.Key.KP_Space: -+ if ((modifiers & Gdk.ModifierType.SHIFT_MASK) != 0) { -+ if (!key_press_keyval(keyval)) -+ return true; -+ show_candidate = is_emoji_lookup_table(); -+ break; -+ } - show_candidate = key_press_space(); - if (m_extension_name == "unicode") { - key_press_enter(); -@@ -979,14 +998,8 @@ class PanelBinding : IBus.PanelService { - show_candidate = key_press_control_keyval(keyval, modifiers); - break; - } -- unichar ch = IBus.keyval_to_unicode(keyval); -- if (ch.iscntrl()) -+ if (!key_press_keyval(keyval)) - return true; -- string str = ch.to_string(); -- m_preedit.append_text(str); -- string annotation = m_preedit.get_text(); -- m_emojier.set_annotation(annotation); -- m_preedit.set_emoji(""); - show_candidate = is_emoji_lookup_table(); - break; - } --- -2.17.1 - -From 809d880337e75b7cee429292a238bf53899bef6a Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 30 Aug 2018 12:58:57 +0900 -Subject: [PATCH] ui/gtk3: Do not move Emojier popup with the active - candidate in Xorg - -Probably I think it's not useful to change the popup position frequently. -The popup size is always slightly changed with the emoji annotation length. ---- - ui/gtk3/emojier.vala | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala -index 0f455800..9811fde5 100644 ---- a/ui/gtk3/emojier.vala -+++ b/ui/gtk3/emojier.vala -@@ -1944,7 +1944,15 @@ public class IBusEmojier : Gtk.ApplicationWindow { - x = 0; - - bool changed = false; -- if (window_right_bottom.y > monitor_bottom) { -+ // Do not up side down frequently. -+ // The first pos does not show the lookup table yet but the -+ // preedit only and the second pos shows the lookup table. -+ if (m_lookup_table.get_cursor_pos() != 1) { -+ if (m_is_up_side_down) -+ y = m_cursor_location.y - allocation.height; -+ else -+ y = cursor_right_bottom.y; -+ } else if (window_right_bottom.y > monitor_bottom) { - y = m_cursor_location.y - allocation.height; - // Do not up side down in Wayland - if (m_input_context_path == "") { --- -2.17.1 - -From 1c6565e205528a45e88a84ba2a328f9035875c8d Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 14 Sep 2018 16:15:41 +0900 -Subject: [PATCH] ui/gtk3: Fix SEGV when commit an emoji on Emojier in Wayland - -Just pressing Space key without emoji annotations can launch Emojier -popup and the popup takes a focus in Wayland and the chosen emoji is -output when the original text application gets the focus after Emojier -popup release the focus. Emojier disabled Ctrl-Shift-e after got the focus. -But currently GNOME Wayland has a bug not to send focus-in until a -key press or mouse click happens [1] and Emojier causes a SEGV. -Now Emojier disables Ctrl-Shift-e immediately when an emoji is chosen -whether focus-in comes or not and fixes the SEGV. - -[1] https://gitlab.gnome.org/GNOME/gnome-shell/issues/573 - -BUG=rhbz#1625187 ---- - ui/gtk3/emojier.vala | 63 +++++++------------------------------- - ui/gtk3/emojierapp.vala | 2 +- - ui/gtk3/panelbinding.vala | 64 ++++++++++++++++++++++++++------------- - 3 files changed, 55 insertions(+), 74 deletions(-) - -diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala -index 9811fde5..e23ef889 100644 ---- a/ui/gtk3/emojier.vala -+++ b/ui/gtk3/emojier.vala -@@ -21,17 +21,6 @@ - */ - - public class IBusEmojier : Gtk.ApplicationWindow { -- private class EEntry : Gtk.SearchEntry { -- public EEntry() { -- GLib.Object( -- name : "IBusEmojierEntry", -- margin_start : 6, -- margin_end : 6, -- margin_top : 6, -- margin_bottom : 6 -- ); -- } -- } - private class EListBox : Gtk.ListBox { - public EListBox() { - GLib.Object( -@@ -330,6 +319,7 @@ public class IBusEmojier : Gtk.ApplicationWindow { - private uint m_redraw_window_id; - - public signal void candidate_clicked(uint index, uint button, uint state); -+ public signal void commit_text(string text); - - public IBusEmojier() { - GLib.Object( -@@ -380,12 +370,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - adjust_window_position(); - }); - -- candidate_clicked.connect((i, b, s) => { -- if (m_input_context_path != "") -- candidate_panel_select_index(i, b); -- }); -- -- - if (m_annotation_to_emojis_dict == null) { - reload_emoji_dict(); - } -@@ -1641,34 +1625,6 @@ public class IBusEmojier : Gtk.ApplicationWindow { - } - - -- private void candidate_panel_select_index(uint index, -- uint button) { -- if (button == BUTTON_CLOSE_BUTTON) { -- hide(); -- if (m_candidate_panel_mode && -- m_lookup_table.get_number_of_candidates() > 0) { -- // Call remove_all_children() instead of show_category_list() -- // so that show_category_list do not remove children with -- // PageUp/PageDown. -- remove_all_children(); -- } -- m_result = ""; -- return; -- } -- string text = m_lookup_table.get_candidate(index).text; -- unowned GLib.SList? emojis = -- m_emoji_to_emoji_variants_dict.lookup(text); -- if (m_show_emoji_variant && emojis != null && -- m_backward_index < 0) { -- show_emoji_variants(emojis); -- show_all(); -- } else { -- m_result = text; -- hide(); -- } -- } -- -- - private void candidate_panel_cursor_down() { - enter_notify_disable_with_timer(); - uint ncandidates = m_lookup_table.get_number_of_candidates(); -@@ -1762,7 +1718,8 @@ public class IBusEmojier : Gtk.ApplicationWindow { - } - - -- public bool has_variants(uint index) { -+ public bool has_variants(uint index, -+ bool need_commit_signal) { - if (index >= m_lookup_table.get_number_of_candidates()) - return false; - string text = m_lookup_table.get_candidate(index).text; -@@ -1773,6 +1730,10 @@ public class IBusEmojier : Gtk.ApplicationWindow { - show_emoji_variants(emojis); - return true; - } -+ if (m_input_context_path != "") -+ m_result = text; -+ if (need_commit_signal) -+ commit_text(text); - return false; - } - -@@ -1881,10 +1842,10 @@ public class IBusEmojier : Gtk.ApplicationWindow { - } - - -- public bool key_press_enter() { -+ public bool key_press_enter(bool need_commit_signal) { - if (m_candidate_panel_is_visible) { - uint index = m_lookup_table.get_cursor_pos(); -- return has_variants(index); -+ return has_variants(index, need_commit_signal); - } else if (m_category_active_index >= 0) { - Gtk.ListBoxRow gtkrow = m_list_box.get_selected_row(); - EBoxRow row = gtkrow as EBoxRow; -@@ -2282,12 +2243,10 @@ public class IBusEmojier : Gtk.ApplicationWindow { - return true; - case Gdk.Key.Return: - case Gdk.Key.KP_Enter: -- if (key_press_enter()) { -+ if (key_press_enter(true)) - show_all(); -- } else { -- m_result = get_current_candidate(); -+ else - hide(); -- } - return true; - case Gdk.Key.space: - case Gdk.Key.KP_Space: -diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala -index 787d448f..fab99d9e 100644 ---- a/ui/gtk3/emojierapp.vala -+++ b/ui/gtk3/emojierapp.vala -@@ -65,7 +65,7 @@ public class EmojiApplication : Gtk.Application { - uint ncandidates = m_emojier.get_number_of_candidates(); - if (ncandidates > 0 && ncandidates >= index) { - m_emojier.set_cursor_pos(index); -- show_candidate = m_emojier.has_variants(index); -+ show_candidate = m_emojier.has_variants(index, false); - } else { - return; - } -diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala -index 4ebff8da..01c43b0d 100644 ---- a/ui/gtk3/panelbinding.vala -+++ b/ui/gtk3/panelbinding.vala -@@ -447,13 +447,19 @@ class PanelBinding : IBus.PanelService { - } - - -- private void commit_text_update_favorites(IBus.Text text) { -+ private void commit_text_update_favorites(IBus.Text text, -+ bool disable_extension) { - commit_text(text); -- IBus.ExtensionEvent event = new IBus.ExtensionEvent( -+ -+ // If disable_extension is false, the extension event is already -+ // sent before the focus-in is received. -+ if (disable_extension) { -+ IBus.ExtensionEvent event = new IBus.ExtensionEvent( - "name", m_extension_name, - "is-enabled", false, - "is-extension", true); -- panel_extension(event); -+ panel_extension(event); -+ } - string committed_string = text.text; - string preedit_string = m_preedit.get_text(); - m_preedit.hide(); -@@ -482,7 +488,7 @@ class PanelBinding : IBus.PanelService { - prev_context_path != "" && - prev_context_path == m_current_context_path) { - IBus.Text text = new IBus.Text.from_string(selected_string); -- commit_text_update_favorites(text); -+ commit_text_update_favorites(text, false); - m_emojier.reset(); - return true; - } -@@ -564,13 +570,13 @@ class PanelBinding : IBus.PanelService { - private bool key_press_enter() { - if (m_extension_name != "unicode" && is_emoji_lookup_table()) { - // Check if variats exist -- if (m_emojier.key_press_enter()) { -+ if (m_emojier.key_press_enter(false)) { - convert_preedit_text(); - return true; - } - } - IBus.Text text = m_preedit.get_commit_text(); -- commit_text_update_favorites(text); -+ commit_text_update_favorites(text, true); - return false; - } - -@@ -712,15 +718,10 @@ class PanelBinding : IBus.PanelService { - } - - -- private bool is_visible_wayland_lookup_table() { -- return m_wayland_lookup_table_is_visible; -- } -- -- - private void hide_emoji_lookup_table() { - if (m_emojier == null) - return; -- if (m_is_wayland) -+ if (m_wayland_lookup_table_is_visible) - hide_wayland_lookup_table(); - else - m_emojier.hide(); -@@ -747,7 +748,7 @@ class PanelBinding : IBus.PanelService { - - private bool is_emoji_lookup_table() { - if (m_is_wayland) -- return is_visible_wayland_lookup_table(); -+ return m_wayland_lookup_table_is_visible; - else - return m_emojier.get_visible(); - } -@@ -788,7 +789,8 @@ class PanelBinding : IBus.PanelService { - */ - if (!input_context_path.has_suffix("InputContext_1")) { - m_real_current_context_path = m_current_context_path; -- this.emojier_focus_commit(); -+ if (m_is_wayland) -+ this.emojier_focus_commit(); - } - } - -@@ -822,8 +824,18 @@ class PanelBinding : IBus.PanelService { - // For title handling in gnome-shell - m_application.add_window(m_emojier); - m_emojier.candidate_clicked.connect((i, b, s) => { -+ candidate_clicked_lookup_table_real(i, b, s, true); -+ }); -+ m_emojier.commit_text.connect((s) => { - if (!m_is_wayland) -- candidate_clicked_lookup_table(i, b, s); -+ return; -+ // Currently emojier has a focus but the text input focus -+ // does not and commit the text later. -+ IBus.ExtensionEvent close_event = new IBus.ExtensionEvent( -+ "name", m_extension_name, -+ "is-enabled", false, -+ "is-extension", true); -+ panel_extension(close_event); - }); - } - m_emojier.reset(); -@@ -1041,9 +1053,10 @@ class PanelBinding : IBus.PanelService { - show_preedit_and_candidate(show_candidate); - } - -- public override void candidate_clicked_lookup_table(uint index, -- uint button, -- uint state) { -+ private void candidate_clicked_lookup_table_real(uint index, -+ uint button, -+ uint state, -+ bool is_emojier) { - if (button == IBusEmojier.BUTTON_CLOSE_BUTTON) { - m_enable_extension = false; - hide_emoji_lookup_table(); -@@ -1061,17 +1074,26 @@ class PanelBinding : IBus.PanelService { - uint ncandidates = m_emojier.get_number_of_candidates(); - if (ncandidates > 0 && ncandidates >= index) { - m_emojier.set_cursor_pos(index); -- show_candidate = m_emojier.has_variants(index); -- m_preedit.set_emoji(m_emojier.get_current_candidate()); -+ bool need_commit_signal = m_is_wayland && is_emojier; -+ show_candidate = m_emojier.has_variants(index, need_commit_signal); -+ if (!m_is_wayland) -+ m_preedit.set_emoji(m_emojier.get_current_candidate()); - } else { - return; - } - if (!show_candidate) { - IBus.Text text = m_preedit.get_commit_text(); -- commit_text_update_favorites(text); - hide_emoji_lookup_table(); -+ if (!is_emojier || !m_is_wayland) -+ commit_text_update_favorites(text, true); - return; - } - show_preedit_and_candidate(show_candidate); - } -+ -+ public override void candidate_clicked_lookup_table(uint index, -+ uint button, -+ uint state) { -+ candidate_clicked_lookup_table_real(index, button, state, false); -+ } - } --- -2.17.1 - -From a8e8b694dcb52e4beb367dff1e8ecaaca4f63c00 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Wed, 3 Oct 2018 17:01:59 +0900 -Subject: [PATCH] data/dconf: Delete dconf dependencies - -gsettings-schema-convert has not worked with python3 since GConf -has been deprecated since 2011 so we cannot disable python2 -in canse GConf is enabled. -I don't wish to maintain both ibus.schemas.in and -org.freedesktop.ibus.gschema.xml.in and now decide to delete -whole the GConf builds. -gsettings is now stable and can be used instead. -ibus-dconf will be deperecated in the near future. - -BUG=https://bugzilla.gnome.org/show_bug.cgi?id=759334 ---- - conf/Makefile.am | 9 +- - configure.ac | 29 --- - data/Makefile.am | 25 +- - data/dconf/Makefile.am | 6 - - .../dconf/org.freedesktop.ibus.gschema.xml | 225 ++++++++++++++++++ - 5 files changed, 227 insertions(+), 67 deletions(-) - create mode 100644 data/dconf/org.freedesktop.ibus.gschema.xml - -diff --git a/conf/Makefile.am b/conf/Makefile.am -index efa86499..26f6e2ab 100644 ---- a/conf/Makefile.am -+++ b/conf/Makefile.am -@@ -3,7 +3,7 @@ - # ibus - The Input Bus - # - # Copyright (c) 2007-2010 Peng Huang --# Copyright (c) 2007-2010 Red Hat, Inc. -+# Copyright (c) 2007-2018 Red Hat, Inc. - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public -@@ -20,12 +20,6 @@ - # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - # USA - --if ENABLE_GCONF --GCONF_DIR = \ -- gconf \ -- $(NULL) --endif -- - MEMCONF_DIR = \ - memconf \ - $(NULL) -@@ -38,7 +32,6 @@ endif - - SUBDIRS = \ - $(DCONF_DIR) \ -- $(GCONF_DIR) \ - $(MEMCONF_DIR) \ - $(NULL) - -diff --git a/configure.ac b/configure.ac -index 4b6a7a21..0e9337a7 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -339,33 +339,6 @@ PKG_CHECK_MODULES(DBUS, [ - dbus-1 - ]) - --# --enable-gconf option. --AC_ARG_ENABLE(gconf, -- AS_HELP_STRING([--enable-gconf], -- [Use GConf code]), -- [enable_gconf=$enableval], -- [enable_gconf=no] --) --AM_CONDITIONAL([ENABLE_GCONF], [test x"$enable_gconf" = x"yes"]) -- --if test x"$enable_gconf" = x"yes"; then -- # check gconf -- PKG_CHECK_MODULES(GCONF, -- [gconf-2.0 >= 2.12], -- ) -- -- AC_PATH_PROG(GCONFTOOL, gconftool-2, no) -- if test x"$GCONFTOOL" = xno; then -- AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf]) -- fi -- -- AM_GCONF_SOURCE_2 -- # GCONF_SCHEMAS_INSTALL should be set in macro AM_GCONF_SOURCE_2 --else -- AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [false]) -- enable_gconf="no (disabled, use --enable-gconf to enable)" --fi -- - # --enable-memconf option. - AC_ARG_ENABLE(memconf, - AS_HELP_STRING([--enable-memconf], -@@ -771,7 +744,6 @@ bindings/Makefile - bindings/pygobject/Makefile - bindings/vala/Makefile - conf/Makefile --conf/gconf/Makefile - conf/dconf/Makefile - conf/memconf/Makefile - tools/Makefile -@@ -798,7 +770,6 @@ Build options: - Build appindicator support $enable_appindicator - Build appindicator engine icon $enable_appindicator_engine_icon - Build python library $enable_python_library -- Build gconf modules $enable_gconf - Build memconf modules $enable_memconf - Build dconf modules $enable_dconf - Build introspection $found_introspection -diff --git a/data/Makefile.am b/data/Makefile.am -index d9d613fe..2533f444 100644 ---- a/data/Makefile.am -+++ b/data/Makefile.am -@@ -3,7 +3,7 @@ - # ibus - The Input Bus - # - # Copyright (c) 2007-2016 Peng Huang --# Copyright (c) 2007-2016 Red Hat, Inc. -+# Copyright (c) 2007-2018 Red Hat, Inc. - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public -@@ -30,27 +30,4 @@ if ENABLE_DCONF - SUBDIRS += dconf - endif - --schemasdir = $(GCONF_SCHEMA_FILE_DIR) --schemas_in_files = ibus.schemas.in --schemas_DATA = $(schemas_in_files:.schemas.in=.schemas) --@INTLTOOL_SCHEMAS_RULE@ -- --install-data-local: --if GCONF_SCHEMAS_INSTALL -- if test -z "$(DESTDIR)" ; then \ -- for p in $(schemas_DATA) ; do \ -- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) \ -- --makefile-install-rule $(top_builddir)/data/$$p >&1 > /dev/null; \ -- done \ -- fi --endif -- --EXTRA_DIST = \ -- $(schemas_in_files) \ -- $(NULL) -- --DISTCLEANFILES = \ -- $(schemas_DATA) \ -- $(NULL) -- - -include $(top_srcdir)/git.mk -diff --git a/data/dconf/Makefile.am b/data/dconf/Makefile.am -index 433d9937..4ac1e3a6 100644 ---- a/data/dconf/Makefile.am -+++ b/data/dconf/Makefile.am -@@ -34,11 +34,6 @@ dconfprofile_DATA = profile/ibus - dconfdbdir = $(sysconfdir)/dconf/db/ibus.d - dconfdb_DATA = 00-upstream-settings - --org.freedesktop.ibus.gschema.xml.in: $(top_srcdir)/data/ibus.schemas.in -- $(AM_V_GEN) gsettings-schema-convert --force --gconf --xml \ -- --schema-id "org.freedesktop.ibus" \ -- --output $@ $< -- - 00-upstream-settings: $(srcdir)/make-dconf-override-db.sh | $(gsettings_SCHEMAS) - @$(MKDIR_P) db - $(AM_V_GEN) $(srcdir)/make-dconf-override-db.sh > $@ || \ -@@ -75,7 +70,6 @@ CLEANFILES = \ - $(NULL) - - MAINTAINERCLEANFILES = \ -- $(gsettings_schemas_in_files) \ - 00-upstream-settings \ - $(NULL) - -diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml -new file mode 100644 -index 00000000..cbe7118e ---- /dev/null -+++ b/data/dconf/org.freedesktop.ibus.gschema.xml -@@ -0,0 +1,225 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ [] -+ Preload engines -+ Preload engines during ibus starts up -+ -+ -+ [] -+ Engines order -+ Saved engines order in input method list -+ -+ -+ 400 -+ Popup delay milliseconds for IME switcher window -+ Set popup delay milliseconds to show IME switcher window. The default is 400. 0 = Show the window immediately. 0 < Delay milliseconds. 0 > Do not show the window and switch prev/next engines. -+ -+ -+ '' -+ Saved version number -+ The saved version number will be used to check the difference between the version of the previous installed ibus and one of the current ibus. -+ -+ -+ [ 'ara', 'bg', 'cz', 'dev', 'gr', 'gur', 'in', 'jp(kana)', 'mal', 'mkd', 'ru', 'ua' ] -+ Latin layouts which have no ASCII -+ US layout is appended to the Latin layouts. variant can be omitted. -+ -+ -+ true -+ Use xmodmap -+ Run xmodmap if .xmodmap or .Xmodmap exists when ibus engines are switched. -+ -+ -+ false -+ Use system keyboard layout -+ Use system keyboard (XKB) layout -+ -+ -+ true -+ Embed Preedit Text -+ Embed Preedit Text in Application Window -+ -+ -+ true -+ Use global input method -+ Share the same input method among all applications -+ -+ -+ false -+ Enable input method by default -+ Enable input method by default when the application gets input focus -+ -+ -+ [ '/desktop/ibus/engine/pinyin', '/desktop/ibus/engine/bopomofo', '/desktop/ibus/engine/hangul' ] -+ DConf preserve name prefixes -+ Prefixes of DConf keys to stop name conversion -+ -+ -+ -+ -+ -+ [ 'Control+space', 'Zenkaku_Hankaku', 'Alt+Kanji', 'Alt+grave', 'Hangul', 'Alt+Release+Alt_R' ] -+ Trigger shortcut keys -+ The shortcut keys for turning input method on or off -+ -+ -+ [ '<Super>space' ] -+ Trigger shortcut keys for gtk_accelerator_parse -+ The shortcut keys for turning input method on or off -+ -+ -+ [] -+ Enable shortcut keys -+ The shortcut keys for turning input method on -+ -+ -+ [] -+ Disable shortcut keys -+ The shortcut keys for turning input method off -+ -+ -+ [ 'Alt+Shift_L' ] -+ Next engine shortcut keys -+ The shortcut keys for switching to the next input method in the list -+ -+ -+ [ 'Alt+Shift_L' ] -+ Next engine shortcut keys -+ The shortcut keys for switching to the next input method in the list -+ -+ -+ [] -+ Prev engine shortcut keys -+ The shortcut keys for switching to the previous input method -+ -+ -+ [] -+ Prev engine shortcut keys -+ The shortcut keys for switching to the previous input method -+ -+ -+ -+ -+ 0 -+ Auto hide -+ The behavior of property panel. 0 = Do not show, 1 = Auto hide, 2 = Always show -+ -+ -+ -1 -+ Language panel position -+ -+ -+ -1 -+ Language panel position -+ -+ -+ false -+ Follow the input cursor in case the panel is always shown -+ If true, the panel follows the input cursor in case the panel is always shown. If false, the panel is shown at a fixed location. -+ -+ -+ 10000 -+ The milliseconds to show property panel -+ The milliseconds to show property panel after focus-in or properties are changed. -+ -+ -+ 1 -+ Orientation of lookup table -+ Orientation of lookup table. 0 = Horizontal, 1 = Vertical -+ -+ -+ true -+ Show icon on system tray -+ Show icon on system tray -+ -+ -+ false -+ Show input method name -+ Show input method name on language bar -+ -+ -+ '#415099' -+ RGBA value of XKB icon -+ XKB icon shows the layout string and the string is rendered with the RGBA value. The RGBA value can be 1. a color name from X11, 2. a hex value in form '#rrggbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue, 3. a RGB color in form 'rgb(r,g,b)' or 4. a RGBA color in form 'rgba(r,g,b,a)' where 'r', 'g', and 'b' are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and 'a' is a floating point value in the range 0 to 1 of the alpha. -+ -+ -+ 500 -+ The milliseconds to show the panel icon for a property -+ The milliseconds to show the panel icon from the engine icon to a property icon whenever engines are switched if the property is specified by the value of icon-prop-key in IBusEngineDesc. If the value is 0, no delay time and the property icon is shown immediately. -+ -+ -+ false -+ Use custom font -+ Use custom font name for language panel -+ -+ -+ 'Sans 10' -+ Custom font -+ Custom font name for language panel -+ -+ -+ -+ -+ -+ [ '<Control><Shift>u' ] -+ Unicode shortcut keys for gtk_accelerator_parse -+ The shortcut keys for turning Unicode typing on or off -+ -+ -+ [ '<Control><Shift>e' ] -+ Emoji shortcut keys for gtk_accelerator_parse -+ The shortcut keys for turning emoji typing on or off -+ -+ -+ 'Monospace 16' -+ Custom font -+ Custom font name for emoji characters on emoji dialog -+ -+ -+ 'en' -+ Default language for emoji dictionary -+ Choose a default language of emoji dictionaries on the emoji dialog. The value $lang is applied to /usr/share/ibus/dicts/emoji-$lang.dict -+ -+ -+ [] -+ favorite emoji list on emoji dialog -+ You can show the favorite emojis on emoji list if this list has any characters. -+ -+ -+ [] -+ favorite emoji annotation list on emoji dialog -+ You can assign an annotation for a favorite emoji in this list. -+ -+ -+ false -+ Whether emoji annotations can be match partially or not -+ Whether emoji annotations can be matched with a partial string instead of the exact match or not. -+ -+ -+ 3 -+ Match emoji annotations with the specified length -+ Match emoji annotations partially with more than the specified number of characters instead of the exact match. -+ -+ -+ 0 -+ Choose a condition to match emoji annotations partially -+ Choose one of the following conditions to match emoji annotations partially: 0 == Prefix match, 1 == Suffix match, 2 == Containing match -+ -+ -+ true -+ Load the emoji data at the time of startup -+ Load the emoji data at the time of startup if true. About 10MB memory is needed to load the data. Load the emoji data when open the emoji dialog at the beginning if false. -+ -+ -+ false -+ Load the Unicode data at the time of startup -+ Load the Unicode data at the time of startup if true. About 15MB memory is needed to load the data. Load the Unicode data when open the emoji dialog at the beginning if false. The Unicode data is always loaded after the emoji data is loaded even if true. -+ -+ -+ --- -2.20.1 - -From 74a00cc93ba99367e175ad3d3415e585d453d17f Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 16 Oct 2018 18:17:41 +0900 -Subject: [PATCH] data/dconf: Rename org.freedesktop.ibus.gschema.xml[.in] - ---- - data/dconf/Makefile.am | 7 ++----- - 1 files changed, 2 insertions(+), 5 deletions(-) - rename data/dconf/{org.freedesktop.ibus.gschema.xml.in => org.freedesktop.ibus.gschema.xml} (100%) - -diff --git a/data/dconf/Makefile.am b/data/dconf/Makefile.am -index 4ac1e3a6..5360f033 100644 ---- a/data/dconf/Makefile.am -+++ b/data/dconf/Makefile.am -@@ -21,12 +21,10 @@ - # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - # USA - --gsettings_schemas_in_files = org.freedesktop.ibus.gschema.xml.in --gsettings_SCHEMAS = $(gsettings_schemas_in_files:.gschema.xml.in=.gschema.xml) -+gsettings_SCHEMAS = org.freedesktop.ibus.gschema.xml - gsettingsconvertdir = $(datadir)/GConf/gsettings - dist_gsettingsconvert_DATA = ibus.convert - @GSETTINGS_RULES@ --@INTLTOOL_XML_NOMERGE_RULE@ - - dconfprofiledir = $(sysconfdir)/dconf/profile - dconfprofile_DATA = profile/ibus -@@ -56,7 +54,7 @@ install-data-hook: - fi - - EXTRA_DIST = \ -- $(gsettings_schemas_in_files) \ -+ $(gsettings_SCHEMAS) \ - $(man_5_in_files) \ - make-dconf-override-db.sh \ - profile/ibus \ -@@ -64,7 +62,6 @@ EXTRA_DIST = \ - $(NULL) - - CLEANFILES = \ -- $(gsettings_SCHEMAS) \ - $(man_5_DATA) \ - $(man_5_files) \ - $(NULL) --- -2.20.1 - -From a6710817b3d29d6a522f108f96ffe64d2f5367fe Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 16 Oct 2018 19:46:01 +0900 -Subject: [PATCH] Gettext migration for gschema.xml file - -https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration ---- - bindings/vala/config.vapi | 2 +- - configure.ac | 9 ++- - data/dconf/org.freedesktop.ibus.gschema.xml | 2 +- - po/Makevars | 8 ++- - po/POTFILES.in | 10 +-- - setup/Makefile.am | 14 ++-- - ...us-setup.desktop.in => ibus-setup.desktop} | 0 - src/ibusutil.c | 2 +- - src/keyname-table.h | 70 +------------------ - tools/main.vala | 2 +- - ui/gtk3/Makefile.am | 20 +++--- - ui/gtk3/application.vala | 3 +- - ui/gtk3/emojierapp.vala | 3 +- - ui/gtk3/extension.vala | 3 +- - ...p.in.in => ibus-extension-gtk3.desktop.in} | 0 - ...sktop.in.in => ibus-ui-emojier.desktop.in} | 0 - 16 files changed, 40 insertions(+), 108 deletions(-) - rename setup/{ibus-setup.desktop.in => ibus-setup.desktop} (100%) - rename ui/gtk3/{ibus-extension-gtk3.desktop.in.in => ibus-extension-gtk3.desktop.in} (100%) - rename ui/gtk3/{ibus-ui-emojier.desktop.in.in => ibus-ui-emojier.desktop.in} (100%) - -diff --git a/bindings/vala/config.vapi b/bindings/vala/config.vapi -index e3c43dfb..45ab61b0 100644 ---- a/bindings/vala/config.vapi -+++ b/bindings/vala/config.vapi -@@ -9,5 +9,5 @@ namespace Config - public const string PKGDATADIR; - public const string LIBEXECDIR; - public const string GETTEXT_PACKAGE; -- public const string GLIB_LOCALE_DIR; -+ public const string LOCALEDIR; - } -diff --git a/configure.ac b/configure.ac -index 0e9337a7..26a048c8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -111,9 +111,8 @@ GETTEXT_PACKAGE=ibus10 - AC_SUBST(GETTEXT_PACKAGE) - AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", - [The prefix for out gettext translation domains.]) --GLIB_DEFINE_LOCALEDIR(GLIB_LOCALE_DIR) --GLIB_LOCALE_DIR=$localedir --AC_SUBST(GLIB_LOCALE_DIR) -+AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", -+ [Define the location where the catalogs will be installed]) - - # For dislpay date. - m4_define(ibus_datedisplay, -@@ -131,14 +130,14 @@ AC_PROG_INSTALL - AC_PROG_MAKE_SET - - # i18n stuff --AM_GLIB_GNU_GETTEXT -+AM_GNU_GETTEXT_VERSION([0.19.8]) -+AM_GNU_GETTEXT([external]) - - # Define PACKAGE_VERSION_* variables. - AM_DISABLE_STATIC - AC_ISC_POSIX - AC_HEADER_STDC - LT_INIT --IT_PROG_INTLTOOL([0.35.0]) - - # Check functions. - AC_CHECK_FUNCS(daemon) -diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml -index cbe7118e..8724a8ba 100644 ---- a/data/dconf/org.freedesktop.ibus.gschema.xml -+++ b/data/dconf/org.freedesktop.ibus.gschema.xml -@@ -1,4 +1,4 @@ -- -+ - - - -diff --git a/po/Makevars b/po/Makevars -index 3e56bea1..8cf0b78a 100644 ---- a/po/Makevars -+++ b/po/Makevars -@@ -8,7 +8,9 @@ subdir = po - top_builddir = .. - - # These options get passed to xgettext. --XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ -+# The last argument --keyword without keyword prevents xgettext from -+# extracting translatable strings from "Icon" in *.desktop files. -+XGETTEXT_OPTIONS = --from-code=UTF-8 --keyword=_ --keyword=N_ --keyword=C_:1c,2 --keyword=NC_:1c,2 --keyword=g_dngettext:2,3 --keyword=Name --keyword=Comment --keyword --add-comments - - # This is the copyright holder that gets inserted into the header of the - # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -@@ -39,3 +41,7 @@ MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT) - # This is the list of locale categories, beyond LC_MESSAGES, for which the - # message catalogs shall be used. It is usually empty. - EXTRA_LOCALE_CATEGORIES = -+ -+# https://wiki.gnome.org/Initiatives/GnomeGoals/GettextMigration -+PO_DEPENDS_ON_POT = "no" -+DIST_DEPENDS_ON_UPDAE_PO = "no" -diff --git a/po/POTFILES.in b/po/POTFILES.in -index c81292d2..b3b71e81 100644 ---- a/po/POTFILES.in -+++ b/po/POTFILES.in -@@ -1,11 +1,10 @@ - # Files with translatable strings. - # Please keep this file in alphabetical order. --[type: gettext/glade]setup/setup.ui - bus/dbusimpl.c - bus/engineproxy.c - bus/inputcontext.c - bus/panelproxy.c --data/ibus.schemas.in -+data/dconf/org.freedesktop.ibus.gschema.xml - ibus/__init__.py - ibus/_config.py.in - ibus/_gtk.py -@@ -36,9 +35,10 @@ setup/engineabout.py - setup/enginecombobox.py - setup/enginedialog.py - setup/enginetreeview.py --setup/ibus-setup.desktop.in -+setup/ibus-setup.desktop - setup/keyboardshortcut.py - setup/main.py -+setup/setup.ui - src/ibusbus.c - src/ibusconfig.c - src/ibusemojigen.h -@@ -61,8 +61,8 @@ ui/gtk3/candidatepanel.vala - ui/gtk3/emojier.vala - ui/gtk3/emojierapp.vala - ui/gtk3/handle.vala --ui/gtk3/ibus-extension-gtk3.desktop.in.in --ui/gtk3/ibus-ui-emojier.desktop.in.in -+ui/gtk3/ibus-extension-gtk3.desktop.in -+ui/gtk3/ibus-ui-emojier.desktop.in - ui/gtk3/iconwidget.vala - ui/gtk3/keybindingmanager.vala - ui/gtk3/panel.vala -diff --git a/setup/Makefile.am b/setup/Makefile.am -index b7dd7554..17d80c51 100644 ---- a/setup/Makefile.am -+++ b/setup/Makefile.am -@@ -3,8 +3,8 @@ - # ibus - The Input Bus - # - # Copyright (c) 2007-2014 Peng Huang --# Copyright (c) 2015-2017 Takao Fujiwara --# Copyright (c) 2007-2017 Red Hat, Inc. -+# Copyright (c) 2015-2018 Takao Fujiwara -+# Copyright (c) 2007-2018 Red Hat, Inc. - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public -@@ -40,10 +40,8 @@ ibussetup_DATA = \ - bin_SCRIPTS = ibus-setup - ibussetupdir = $(pkgdatadir)/setup - --desktop_in_files = ibus-setup.desktop.in --desktop_DATA = $(desktop_in_files:.desktop.in=.desktop) -+desktop_DATA = ibus-setup.desktop - desktopdir = $(datadir)/applications --@INTLTOOL_DESKTOP_RULE@ - - man_one_in_files = ibus-setup.1.in - man_one_files = $(man_one_in_files:.1.in=.1) -@@ -67,11 +65,7 @@ EXTRA_DIST = \ - $(man_one_in_files) \ - ibus-setup.in \ - setup.ui \ -- ibus-setup.desktop.in \ -- $(NULL) -- --DISTCLEANFILES = \ -- $(desktop_DATA) \ -+ ibus-setup.desktop \ - $(NULL) - - test: -diff --git a/setup/ibus-setup.desktop.in b/setup/ibus-setup.desktop -similarity index 100% -rename from setup/ibus-setup.desktop.in -rename to setup/ibus-setup.desktop -diff --git a/src/ibusutil.c b/src/ibusutil.c -index 3c6f9247..15e36f80 100644 ---- a/src/ibusutil.c -+++ b/src/ibusutil.c -@@ -99,7 +99,7 @@ _load_lang() - struct stat buf; - - #ifdef ENABLE_NLS -- bindtextdomain ("iso_639", GLIB_LOCALE_DIR); -+ bindtextdomain ("iso_639", LOCALEDIR); - bind_textdomain_codeset ("iso_639", "UTF-8"); - #endif - -diff --git a/src/keyname-table.h b/src/keyname-table.h -index 5d133226..f84ecdc3 100644 ---- a/src/keyname-table.h -+++ b/src/keyname-table.h -@@ -6830,6 +6830,9 @@ static const gdk_key gdk_keys_by_name[] = { - #if 0 - - /* -+ * xgettext extracts strings in '#if 0' against intltool and I deleted -+ * all the translatable strings here. -+ * - * Translators, the strings in the “keyboard label” context are - * display names for keyboard keys. Some of them have prefixes like - * XF86 or ISO_ - these should be removed in the translation. Similarly, -@@ -6840,72 +6843,5 @@ static const gdk_key gdk_keys_by_name[] = { - * Scroll_lock - Scroll lock - * KP_Space - Space (keypad) - */ --NC_("keyboard label", "BackSpace") --NC_("keyboard label", "Tab") --NC_("keyboard label", "Return") --NC_("keyboard label", "Pause") --NC_("keyboard label", "Scroll_Lock") --NC_("keyboard label", "Sys_Req") --NC_("keyboard label", "Escape") --NC_("keyboard label", "Multi_key") --NC_("keyboard label", "Home") --NC_("keyboard label", "Left") --NC_("keyboard label", "Up") --NC_("keyboard label", "Right") --NC_("keyboard label", "Down") --NC_("keyboard label", "Page_Up") --NC_("keyboard label", "Page_Down") --NC_("keyboard label", "End") --NC_("keyboard label", "Begin") --NC_("keyboard label", "Print") --NC_("keyboard label", "Insert") --NC_("keyboard label", "Num_Lock") --/* Translators: KP_ means 'key pad' here */ --NC_("keyboard label", "KP_Space") --NC_("keyboard label", "KP_Tab") --NC_("keyboard label", "KP_Enter") --NC_("keyboard label", "KP_Home") --NC_("keyboard label", "KP_Left") --NC_("keyboard label", "KP_Up") --NC_("keyboard label", "KP_Right") --NC_("keyboard label", "KP_Down") --NC_("keyboard label", "KP_Page_Up") --NC_("keyboard label", "KP_Prior") --NC_("keyboard label", "KP_Page_Down") --NC_("keyboard label", "KP_Next") --NC_("keyboard label", "KP_End") --NC_("keyboard label", "KP_Begin") --NC_("keyboard label", "KP_Insert") --NC_("keyboard label", "KP_Delete") --NC_("keyboard label", "Delete") --NC_("keyboard label", "MonBrightnessUp") --NC_("keyboard label", "MonBrightnessDown") --NC_("keyboard label", "KbdBrightnessUp") --NC_("keyboard label", "KbdBrightnessDown") --NC_("keyboard label", "AudioMute") --NC_("keyboard label", "AudioMicMute") --NC_("keyboard label", "AudioLowerVolume") --NC_("keyboard label", "AudioRaiseVolume") --NC_("keyboard label", "AudioPlay") --NC_("keyboard label", "AudioStop") --NC_("keyboard label", "AudioNext") --NC_("keyboard label", "AudioPrev") --NC_("keyboard label", "AudioRecord") --NC_("keyboard label", "AudioPause") --NC_("keyboard label", "AudioRewind") --NC_("keyboard label", "AudioMedia") --NC_("keyboard label", "ScreenSaver") --NC_("keyboard label", "Battery") --NC_("keyboard label", "Launch1") --NC_("keyboard label", "Forward") --NC_("keyboard label", "Back") --NC_("keyboard label", "Sleep") --NC_("keyboard label", "Hibernate") --NC_("keyboard label", "WLAN") --NC_("keyboard label", "WebCam") --NC_("keyboard label", "Display") --NC_("keyboard label", "TouchpadToggle") --NC_("keyboard label", "WakeUp") --NC_("keyboard label", "Suspend") - - #endif -diff --git a/tools/main.vala b/tools/main.vala -index 6e201f30..bf9c0fc9 100644 ---- a/tools/main.vala -+++ b/tools/main.vala -@@ -472,7 +472,7 @@ void print_usage(FileStream stream) { - - public int main(string[] argv) { - GLib.Intl.setlocale(GLib.LocaleCategory.ALL, ""); -- GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.GLIB_LOCALE_DIR); -+ GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); - GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); - GLib.Intl.textdomain(Config.GETTEXT_PACKAGE); - -diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am -index 6ebc96ce..e40971f1 100644 ---- a/ui/gtk3/Makefile.am -+++ b/ui/gtk3/Makefile.am -@@ -165,8 +165,8 @@ EXTRA_DIST = \ - gtkpanel.xml.in \ - notification-item.xml \ - notification-watcher.xml \ -- ibus-ui-emojier.desktop.in.in \ -- ibus-extension-gtk3.desktop.in.in \ -+ ibus-ui-emojier.desktop.in \ -+ ibus-extension-gtk3.desktop.in \ - panelbinding.vala \ - $(NULL) - -@@ -265,32 +265,32 @@ man_sevendir = $(mandir)/man7 - %.7.gz: %.7 - $(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@ - --desktop_in_in_files = \ -- ibus-ui-emojier.desktop.in.in \ -- ibus-extension-gtk3.desktop.in.in \ -+desktop_in_files = \ -+ ibus-ui-emojier.desktop.in \ -+ ibus-extension-gtk3.desktop.in \ - $(NULL) --desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) -+desktop_notrans_files = $(desktop_in_files:.desktop.in=.desktop) - desktop_DATA = \ - org.freedesktop.IBus.Panel.Emojier.desktop \ - org.freedesktop.IBus.Panel.Extension.Gtk3.desktop \ - $(NULL) - desktopdir = $(datadir)/applications --%.desktop.in: %.desktop.in.in -+%.desktop: %.desktop.in - $(AM_V_GEN) sed \ - -e 's|^_Name=|Name=|g' \ - -e 's|@libexecdir[@]|$(libexecdir)|g' $< > $@.tmp && \ - mv $@.tmp $@ - $(NULL) --org.freedesktop.IBus.Panel.Emojier.desktop: ibus-ui-emojier.desktop.in -+org.freedesktop.IBus.Panel.Emojier.desktop: ibus-ui-emojier.desktop - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ - $(NULL) --org.freedesktop.IBus.Panel.Extension.Gtk3.desktop: ibus-extension-gtk3.desktop.in -+org.freedesktop.IBus.Panel.Extension.Gtk3.desktop: ibus-extension-gtk3.desktop - $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@ - $(NULL) - - CLEANFILES += \ - $(desktop_DATA) \ -- $(desktop_in_files) \ -+ $(desktop_notrans_files) \ - $(man_seven_DATA) \ - $(man_seven_files) \ - $(NULL) -diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala -index 806b4b22..cc9ee54c 100644 ---- a/ui/gtk3/application.vala -+++ b/ui/gtk3/application.vala -@@ -26,8 +26,7 @@ class Application { - private Panel m_panel; - - public Application(string[] argv) { -- GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, -- Config.GLIB_LOCALE_DIR); -+ GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); - GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); - IBus.init(); - Gtk.init(ref argv); -diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala -index fab99d9e..e8331989 100644 ---- a/ui/gtk3/emojierapp.vala -+++ b/ui/gtk3/emojierapp.vala -@@ -227,8 +227,7 @@ public class EmojiApplication : Gtk.Application { - - - public static int main (string[] args) { -- GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, -- Config.GLIB_LOCALE_DIR); -+ GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); - GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); - GLib.Intl.textdomain(Config.GETTEXT_PACKAGE); - -diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala -index c729fd7e..ea3cd464 100644 ---- a/ui/gtk3/extension.vala -+++ b/ui/gtk3/extension.vala -@@ -28,8 +28,7 @@ class ExtensionGtk : Gtk.Application { - public ExtensionGtk(string[] args) { - Object(application_id: "org.freedesktop.IBus.Panel.Extension.Gtk3", - flags: ApplicationFlags.FLAGS_NONE); -- GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, -- Config.GLIB_LOCALE_DIR); -+ GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR); - GLib.Intl.bind_textdomain_codeset(Config.GETTEXT_PACKAGE, "UTF-8"); - IBus.init(); - Gtk.init(ref args); -diff --git a/ui/gtk3/ibus-extension-gtk3.desktop.in.in b/ui/gtk3/ibus-extension-gtk3.desktop.in -similarity index 100% -rename from ui/gtk3/ibus-extension-gtk3.desktop.in.in -rename to ui/gtk3/ibus-extension-gtk3.desktop.in -diff --git a/ui/gtk3/ibus-ui-emojier.desktop.in.in b/ui/gtk3/ibus-ui-emojier.desktop.in -similarity index 100% -rename from ui/gtk3/ibus-ui-emojier.desktop.in.in -rename to ui/gtk3/ibus-ui-emojier.desktop.in --- -2.20.1 - -From c1b55431c076dfa3fc26a3a998bfcf729e9ba602 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 26 Oct 2018 18:44:35 +0900 -Subject: [PATCH] src/tests: Fix make check in Fedora 29 - -ibus-bus and ibus-compose failed in Fedora 29. - -1. In ibus-bus with runtest, ibus-daemon failed to restart in -start_exit_async() because it seems to have conflicting IO with runtest -and ibus-daemon failed to close a file descriptor in _restart_server(). -The solution is to add a sleep in start_exit_async(). -Also added ibus_get_address() in test_async_apis_finish() to check -if ibus-daemon finished to restart. - -2. In ibus-compose, the GTK application could not get the ibus module. -The solution is to export GTK_IM_MODULE=ibus. - -3. Added DISABLE_DAEMONIZE_IN_TESTS to get error messages in ibus-daemon. -% make DISABLE_DAEMONIZE_IN_TESTS=1 check ---- - bus/Makefile.am | 1 + - src/tests/Makefile.am | 1 + - src/tests/ibus-bus.c | 15 ++++++++++++++- - src/tests/runtest | 24 +++++++++++++++++------- - 4 files changed, 33 insertions(+), 8 deletions(-) - -diff --git a/bus/Makefile.am b/bus/Makefile.am -index bdae5c92..4383a874 100644 ---- a/bus/Makefile.am -+++ b/bus/Makefile.am -@@ -124,6 +124,7 @@ TESTS_ENVIRONMENT = \ - srcdir=$(srcdir) \ - LD_LIBRARY_PATH="$(top_builddir)/src/.libs:$(top_builddir)/src" \ - DISABLE_GUI_TESTS="$(DISABLE_GUI_TESTS)" \ -+ DISABLE_DAEMONIZE_IN_TESTS="$(DISABLE_DAEMONIZE_IN_TESTS)" \ - $(NULL) - - LOG_COMPILER = $(top_srcdir)/src/tests/runtest -diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am -index c5fef3c8..e337a59b 100644 ---- a/src/tests/Makefile.am -+++ b/src/tests/Makefile.am -@@ -73,6 +73,7 @@ TESTS_ENVIRONMENT = \ - srcdir=$(srcdir) \ - LD_LIBRARY_PATH="$(top_builddir)/src/.libs:$(top_builddir)/src" \ - DISABLE_GUI_TESTS="$(DISABLE_GUI_TESTS)" \ -+ DISABLE_DAEMONIZE_IN_TESTS="$(DISABLE_DAEMONIZE_IN_TESTS)" \ - $(NULL) - - LOG_COMPILER = $(srcdir)/runtest -diff --git a/src/tests/ibus-bus.c b/src/tests/ibus-bus.c -index 7fa1bc4a..0bf9e612 100644 ---- a/src/tests/ibus-bus.c -+++ b/src/tests/ibus-bus.c -@@ -820,6 +820,14 @@ finish_exit_async (GObject *source_object, - static void - start_exit_async (void) - { -+ /* When `./runtest ibus-bus` runs, ibus-daemon sometimes failed to -+ * restart because closing a file descriptor was failed in -+ * bus/server.c:_restart_server() with a following error: -+ * "inotify read(): Bad file descriptor" -+ * Now g_usleep() is added here to write down the buffer and not to -+ * fail to restart ibus-daemon. -+ */ -+ g_usleep (G_USEC_PER_SEC); - ibus_bus_exit_async (bus, - TRUE, /* restart */ - -1, /* timeout */ -@@ -831,6 +839,9 @@ start_exit_async (void) - static gboolean - test_async_apis_finish (gpointer user_data) - { -+ /* INFO: g_warning() causes SEGV with runtest script */ -+ if (ibus_get_address () == NULL) -+ g_warning ("ibus-daemon does not restart yet from start_exit_async()."); - ibus_quit (); - return FALSE; - } -@@ -906,7 +917,9 @@ call_next_async_function (void) - }; - static guint index = 0; - -- // Use g_timeout_add to make sure test_async_apis finishes even if async_functions is empty. -+ /* Use g_timeout_add to make sure test_async_apis finishes even if -+ * async_functions is empty. -+ */ - if (index >= G_N_ELEMENTS (async_functions)) - g_timeout_add (1, test_async_apis_finish, NULL); - else -diff --git a/src/tests/runtest b/src/tests/runtest -index d7f96ea3..ab39e9f2 100755 ---- a/src/tests/runtest -+++ b/src/tests/runtest -@@ -22,6 +22,7 @@ - : ${builddir:=.} - : ${srcdir:=.} - : ${DISABLE_GUI_TESTS:=''} -+: ${DISABLE_DAEMONIZE_IN_TESTS:=''} - - BUS_REQUIRED_TESTS=" - ibus-bus -@@ -162,16 +163,25 @@ run_test_case() - export GSETTINGS_SCHEMA_DIR=$PWD - - # Start ibus-daemon. -- ../$top_builddir/bus/ibus-daemon \ -- --daemonize \ -- --cache=none \ -- --panel=disable \ -- --emoji-extension=disable \ -- --config=default \ -- --verbose; -+ DAEMON_ARGS=' -+ --cache=none -+ --panel=disable -+ --emoji-extension=disable -+ --config=default -+ --verbose -+ ' -+ if test x"$DISABLE_DAEMONIZE_IN_TESTS" = x ; then -+ ../$top_builddir/bus/ibus-daemon \ -+ $DAEMON_ARGS --daemonize; -+ else -+ ../$top_builddir/bus/ibus-daemon \ -+ $DAEMON_ARGS & -+ fi - - # Wait until all necessary components are up. - sleep 1 -+ -+ export GTK_IM_MODULE=ibus - fi - - "../$tst" ${1+"$@"} --- -2.17.1 - -From aa24a526dd7dec9a719e063fb35da90afb5dc5bf Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 26 Oct 2018 19:01:19 +0900 -Subject: [PATCH] src/tests: Fix the location of - org.freedesktop.ibus.gschema.xml - -The location has been changed since xgettext migration. ---- - src/tests/runtest | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/tests/runtest b/src/tests/runtest -index ab39e9f2..4e980c71 100755 ---- a/src/tests/runtest -+++ b/src/tests/runtest -@@ -103,8 +103,8 @@ for t in $DISABLE_GUI_TESTS; do - done - - # IBusEngine has GSettings --if test ! -f "$top_builddir/data/dconf/$IBUS_SCHEMA_FILE" ; then -- echo "NOT FOUND $top_builddir/data/dconf/$IBUS_SCHEMA_FILE" -+if test ! -f "$top_srcdir/data/dconf/$IBUS_SCHEMA_FILE" ; then -+ echo "NOT FOUND $top_srcdir/data/dconf/$IBUS_SCHEMA_FILE" - exit -1 - fi - -@@ -148,7 +148,7 @@ run_test_case() - export GTK_IM_MODULE_FILE - $GTK_QUERY_MODULE "$IM_IBUS_SO" > $GTK_IM_MODULE_FILE - -- cp "../$top_builddir/data/dconf/$IBUS_SCHEMA_FILE" $PWD -+ cp "../$top_srcdir/data/dconf/$IBUS_SCHEMA_FILE" $PWD - glib-compile-schemas $PWD - if test $? -ne 0 ; then - echo "FAILED glib-compile-schemas" --- -2.20.1 - -From 3914d3a2b1aeda8779b2d8a9d91088802530b3a9 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 30 Oct 2018 11:54:52 +0900 -Subject: [PATCH] data/dconf: Add comments in org.freedesktop.ibus.gschema.xml - ---- - data/dconf/org.freedesktop.ibus.gschema.xml | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml -index 8724a8ba..5938d3b8 100644 ---- a/data/dconf/org.freedesktop.ibus.gschema.xml -+++ b/data/dconf/org.freedesktop.ibus.gschema.xml -@@ -7,7 +7,9 @@ - - - [] -+ - Preload engines -+ - Preload engines during ibus starts up - - --- -2.20.1 - -From b6086665bcf12914e6e1ac99b606dc6dee363f26 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 30 Oct 2018 11:57:19 +0900 -Subject: [PATCH] data/dconf: Fix a typo - ---- - data/dconf/org.freedesktop.ibus.gschema.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml -index 5938d3b8..7ae8f0f6 100644 ---- a/data/dconf/org.freedesktop.ibus.gschema.xml -+++ b/data/dconf/org.freedesktop.ibus.gschema.xml -@@ -7,7 +7,7 @@ - - - [] -- -+ - Preload engines - - Preload engines during ibus starts up --- -2.20.1 - -From 3172c3b23faefe76b3b7adfc75f9be34a0fb2e02 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Wed, 31 Oct 2018 17:42:38 +0900 -Subject: [PATCH] RHEL code reviews - ---- - src/ibuskeymap.c | 2 +- - src/ibuspanelservice.c | 6 +++++- - src/tests/ibus-keypress.c | 2 +- - util/IMdkit/FrameMgr.c | 1 + - 4 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/ibuskeymap.c b/src/ibuskeymap.c -index 27a56754..5abfb99a 100644 ---- a/src/ibuskeymap.c -+++ b/src/ibuskeymap.c -@@ -143,7 +143,7 @@ ibus_keymap_parse_line (gchar *str, - /* Do not assign *p1 to g_ascii_isalpha() directly for the syntax check */ - if (i == 0 && - strncmp (p2, "addupper", sizeof ("addupper") - 1) == 0 && -- (ch = *p1) && g_ascii_isalpha (ch)) { -+ (ch = *p1) && (ch >= 0) && g_ascii_isalpha (ch)) { - gchar buf[] = "a"; - buf[0] = g_ascii_toupper(ch); - keymap[keycode][0] = keymap[keycode][3] = keysym; -diff --git a/src/ibuspanelservice.c b/src/ibuspanelservice.c -index 9d87e19b..984cc890 100644 ---- a/src/ibuspanelservice.c -+++ b/src/ibuspanelservice.c -@@ -1615,7 +1615,11 @@ ibus_panel_service_panel_extension_register_keys (IBusPanelService *panel, - va_start (var_args, first_property_name); - do { - keys = va_arg (var_args, IBusProcessKeyEventData *); -- g_return_if_fail (keys != NULL); -+ if (keys == NULL) { -+ va_end (var_args); -+ g_warning ("Failed to va_arg for IBusProcessKeyEventData"); -+ return; -+ } - g_variant_builder_init (&child, G_VARIANT_TYPE ("av")); - for (; keys; keys++) { - if (keys->keyval == 0 && keys->keycode == 0 && keys->state == 0) -diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c -index 3486523b..17920226 100644 ---- a/src/tests/ibus-keypress.c -+++ b/src/tests/ibus-keypress.c -@@ -173,7 +173,7 @@ set_engine_cb (GObject *object, - IBusBus *bus = IBUS_BUS (object); - GtkWidget *entry = GTK_WIDGET (data); - GdkDisplay *display; -- Display *xdisplay; -+ Display *xdisplay = NULL; - GError *error = NULL; - int i, j; - -diff --git a/util/IMdkit/FrameMgr.c b/util/IMdkit/FrameMgr.c -index 084b8810..0e91b78e 100644 ---- a/util/IMdkit/FrameMgr.c -+++ b/util/IMdkit/FrameMgr.c -@@ -1414,6 +1414,7 @@ static int FrameInstGetSize (FrameInst fi) - break; - } - /*endswitch*/ -+ assert (i >= 0); - i = _FrameInstIncrement (fi->template, i); - } - /*endwhile*/ --- -2.17.1 - -From a40631e166137c9042a68c2d76844e7afc53d388 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 9 Nov 2018 14:49:44 +0900 -Subject: [PATCH] Detect mouse click to commit Hangul preedit - -If preedit text is not committed with the mouse click, preedit text -is moved to the new cursor position in Hangul typing. -Since set_cursor_location() is received before the reset() signal is -sent to ibus-daemon and commit_text() signal is received from -ibus-daemon, UpdatePreeditTextWithMode D-Bus method is newly added -and now ibus clients commit the preedit. - -BUG=https://github.com/ibus/ibus/issues/1980 ---- - bus/ibusimpl.c | 11 ++++ - bus/inputcontext.c | 108 ++++++++++++++++++++++++------- - bus/inputcontext.h | 19 +++++- - client/gtk2/ibusimcontext.c | 95 +++++++++++++++++++++++++--- - src/ibusinputcontext.c | 122 ++++++++++++++++++++++++++++++++---- - src/ibusinputcontext.h | 27 +++++++- - 6 files changed, 338 insertions(+), 44 deletions(-) - -diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c -index 80f3acfb..bbbb5770 100644 ---- a/bus/ibusimpl.c -+++ b/bus/ibusimpl.c -@@ -815,6 +815,17 @@ bus_ibus_impl_set_focused_context (BusIBusImpl *ibus, - engine = bus_input_context_get_engine (ibus->focused_context); - if (engine) { - g_object_ref (engine); -+ /* _ic_focus_in() can be called before _ic_focus_out() is -+ * called under the async processes of two ibus clients. -+ * E.g. gedit is a little slower v.s. a simple GtkTextView -+ * application is the fastest when you click a Hangul -+ * preedit text between the applications. -+ * preedit will be committed with focus-out in the ibus client -+ * likes ibus-im.so -+ * so do not commit preedit here in focus-in event. -+ */ -+ bus_input_context_clear_preedit_text (ibus->focused_context, -+ FALSE); - bus_input_context_set_engine (ibus->focused_context, NULL); - bus_input_context_set_emoji_extension (ibus->focused_context, - NULL); -diff --git a/bus/inputcontext.c b/bus/inputcontext.c -index 4f98b849..1b8e7adb 100644 ---- a/bus/inputcontext.c -+++ b/bus/inputcontext.c -@@ -73,6 +73,7 @@ struct _BusInputContext { - guint preedit_cursor_pos; - gboolean preedit_visible; - guint preedit_mode; -+ gboolean client_commit_preedit; - - /* auxiliary text */ - IBusText *auxiliary_text; -@@ -212,6 +213,9 @@ static IBusPropList *props_empty = NULL; - static const gchar introspection_xml[] = - "" - " " -+ /* properties */ -+ " " -+ " \n" - /* methods */ - " " - " " -@@ -273,6 +277,12 @@ static const gchar introspection_xml[] = - " " - " " - " " -+ " " -+ " " -+ " " -+ " " -+ " " -+ " " - " " - " " - " " -@@ -297,9 +307,6 @@ static const gchar introspection_xml[] = - " " - " " - " " -- -- /* properties */ -- " " - " " - ""; - -@@ -1069,6 +1076,12 @@ _ic_reset (BusInputContext *context, - GDBusMethodInvocation *invocation) - { - if (context->engine) { -+ if (context->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -+ if (context->client_commit_preedit) -+ bus_input_context_clear_preedit_text (context, FALSE); -+ else -+ bus_input_context_clear_preedit_text (context, TRUE); -+ } - bus_engine_proxy_reset (context->engine); - } - g_dbus_method_invocation_return_value (invocation, NULL); -@@ -1354,6 +1367,13 @@ _ic_set_content_type (BusInputContext *context, - } - } - -+static void -+_ic_set_client_commit_preedit (BusInputContext *context, -+ GVariant *value) -+{ -+ g_variant_get (value, "(b)", &context->client_commit_preedit); -+} -+ - static gboolean - bus_input_context_service_set_property (IBusService *service, - GDBusConnection *connection, -@@ -1379,9 +1399,14 @@ bus_input_context_service_set_property (IBusService *service, - if (!bus_input_context_service_authorized_method (service, connection)) - return FALSE; - -+ g_return_val_if_fail (BUS_IS_INPUT_CONTEXT (service), FALSE); -+ - if (g_strcmp0 (property_name, "ContentType") == 0) { -- BusInputContext *context = (BusInputContext *) service; -- _ic_set_content_type (context, value); -+ _ic_set_content_type (BUS_INPUT_CONTEXT (service), value); -+ return TRUE; -+ } -+ if (g_strcmp0 (property_name, "ClientCommitPreedit") == 0) { -+ _ic_set_client_commit_preedit (BUS_INPUT_CONTEXT (service), value); - return TRUE; - } - -@@ -1453,22 +1478,44 @@ bus_input_context_focus_in (BusInputContext *context) - - /** - * bus_input_context_clear_preedit_text: -+ * @context: A #BusInputContext -+ * @with_signal: %FALSE if the preedit is already updated in ibus clients -+ * likes ibus-im.so. Otherwise %TRUE. - * -- * Clear context->preedit_text. If the preedit mode is IBUS_ENGINE_PREEDIT_COMMIT, commit it before clearing. -+ * Clear context->preedit_text. If the preedit mode is -+ * IBUS_ENGINE_PREEDIT_COMMIT, commit it before clearing. - */ --static void --bus_input_context_clear_preedit_text (BusInputContext *context) -+void -+bus_input_context_clear_preedit_text (BusInputContext *context, -+ gboolean with_signal) - { -+ IBusText *preedit_text; -+ guint preedit_mode; -+ gboolean preedit_visible; -+ - g_assert (BUS_IS_INPUT_CONTEXT (context)); - -- if (context->preedit_visible && -- context->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -- bus_input_context_commit_text (context, context->preedit_text); -+ if (!with_signal) { -+ g_object_unref (context->preedit_text); -+ context->preedit_mode = IBUS_ENGINE_PREEDIT_CLEAR; -+ context->preedit_text = (IBusText *) g_object_ref_sink (text_empty); -+ context->preedit_cursor_pos = 0; -+ context->preedit_visible = FALSE; -+ return; - } - -- /* always clear preedit text */ -+ /* always clear preedit text to reset the cursor position in the -+ * client application before commit the preeit text. */ -+ preedit_text = g_object_ref (context->preedit_text); -+ preedit_mode = context->preedit_mode; -+ preedit_visible = context->preedit_visible; - bus_input_context_update_preedit_text (context, - text_empty, 0, FALSE, IBUS_ENGINE_PREEDIT_CLEAR, TRUE); -+ -+ if (preedit_visible && preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -+ bus_input_context_commit_text (context, preedit_text); -+ } -+ g_object_unref (preedit_text); - } - - void -@@ -1479,7 +1526,10 @@ bus_input_context_focus_out (BusInputContext *context) - if (!context->has_focus) - return; - -- bus_input_context_clear_preedit_text (context); -+ if (context->client_commit_preedit) -+ bus_input_context_clear_preedit_text (context, FALSE); -+ else -+ bus_input_context_clear_preedit_text (context, TRUE); - bus_input_context_update_auxiliary_text (context, text_empty, FALSE); - bus_input_context_update_lookup_table (context, - lookup_table_empty, -@@ -2338,7 +2388,7 @@ bus_input_context_disable (BusInputContext *context) - { - g_assert (BUS_IS_INPUT_CONTEXT (context)); - -- bus_input_context_clear_preedit_text (context); -+ bus_input_context_clear_preedit_text (context, TRUE); - bus_input_context_update_auxiliary_text (context, text_empty, FALSE); - bus_input_context_update_lookup_table (context, - lookup_table_empty, -@@ -2385,7 +2435,7 @@ bus_input_context_unset_engine (BusInputContext *context) - { - g_assert (BUS_IS_INPUT_CONTEXT (context)); - -- bus_input_context_clear_preedit_text (context); -+ bus_input_context_clear_preedit_text (context, TRUE); - bus_input_context_update_auxiliary_text (context, text_empty, FALSE); - bus_input_context_update_lookup_table (context, - lookup_table_empty, -@@ -2807,14 +2857,26 @@ bus_input_context_update_preedit_text (BusInputContext *context, - } else if (PREEDIT_CONDITION) { - GVariant *variant = ibus_serializable_serialize ( - (IBusSerializable *)context->preedit_text); -- bus_input_context_emit_signal (context, -- "UpdatePreeditText", -- g_variant_new ( -- "(vub)", -- variant, -- context->preedit_cursor_pos, -- extension_visible), -- NULL); -+ if (context->client_commit_preedit) { -+ bus_input_context_emit_signal ( -+ context, -+ "UpdatePreeditTextWithMode", -+ g_variant_new ("(vubu)", -+ variant, -+ context->preedit_cursor_pos, -+ extension_visible, -+ context->preedit_mode), -+ NULL); -+ } else { -+ bus_input_context_emit_signal ( -+ context, -+ "UpdatePreeditText", -+ g_variant_new ("(vub)", -+ variant, -+ context->preedit_cursor_pos, -+ extension_visible), -+ NULL); -+ } - } else { - g_signal_emit (context, - context_signals[UPDATE_PREEDIT_TEXT], -diff --git a/bus/inputcontext.h b/bus/inputcontext.h -index a46d5c06..7105fff8 100644 ---- a/bus/inputcontext.h -+++ b/bus/inputcontext.h -@@ -2,8 +2,8 @@ - /* vim:set et sts=4: */ - /* ibus - The Input Bus - * Copyright (C) 2008-2014 Peng Huang -- * Copyright (C) 2017 Takao Fujiwara -- * Copyright (C) 2008-2014 Red Hat, Inc. -+ * Copyright (C) 2017-2018 Takao Fujiwara -+ * Copyright (C) 2008-2018 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -377,5 +377,20 @@ void bus_input_context_update_lookup_table - void bus_input_context_panel_extension_received - (BusInputContext *context, - IBusExtensionEvent *event); -+ -+/** -+ * bus_input_context_clear_preedit_text: -+ * -+ * Clear context->preedit_text. If the preedit mode is -+ * IBUS_ENGINE_PREEDIT_COMMIT and with_signal is %TRUE, commit it before -+ * clearing. -+ * If with_signal is %FALSE, this just clears the preedit coditions -+ * and the actual preedit is handled in ibus clients. -+ */ -+void bus_input_context_clear_preedit_text -+ (BusInputContext *context, -+ gboolean -+ with_signal); -+ - G_END_DECLS - #endif -diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index e4de52d9..73a0eaec 100644 ---- a/client/gtk2/ibusimcontext.c -+++ b/client/gtk2/ibusimcontext.c -@@ -2,8 +2,8 @@ - /* vim:set et sts=4: */ - /* ibus - The Input Bus - * Copyright (C) 2008-2013 Peng Huang -- * Copyright (C) 2015-2017 Takao Fujiwara -- * Copyright (C) 2008-2017 Red Hat, Inc. -+ * Copyright (C) 2015-2018 Takao Fujiwara -+ * Copyright (C) 2008-2018 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -61,6 +61,7 @@ struct _IBusIMContext { - PangoAttrList *preedit_attrs; - gint preedit_cursor_pos; - gboolean preedit_visible; -+ guint preedit_mode; - - GdkRectangle cursor_area; - gboolean has_focus; -@@ -132,8 +133,14 @@ static void ibus_im_context_set_surrounding - gint len, - gint cursor_index); - -- - /* static methods*/ -+static void _ibus_context_update_preedit_text_cb -+ (IBusInputContext *ibuscontext, -+ IBusText *text, -+ gint cursor_pos, -+ gboolean visible, -+ guint mode, -+ IBusIMContext *ibusimcontext); - static void _create_input_context (IBusIMContext *context); - static gboolean _set_cursor_location_internal - (IBusIMContext *context); -@@ -744,6 +751,7 @@ ibus_im_context_init (GObject *obj) - ibusimcontext->preedit_attrs = NULL; - ibusimcontext->preedit_cursor_pos = 0; - ibusimcontext->preedit_visible = FALSE; -+ ibusimcontext->preedit_mode = IBUS_ENGINE_PREEDIT_CLEAR; - - // Init cursor area - ibusimcontext->cursor_area.x = -1; -@@ -854,6 +862,24 @@ ibus_im_context_finalize (GObject *obj) - G_OBJECT_CLASS(parent_class)->finalize (obj); - } - -+static void -+ibus_im_context_clear_preedit_text (IBusIMContext *ibusimcontext) -+{ -+ g_assert (ibusimcontext->ibuscontext); -+ if (ibusimcontext->preedit_visible && -+ ibusimcontext->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -+ gchar *preedit_string = g_strdup (ibusimcontext->preedit_string); -+ _ibus_context_update_preedit_text_cb (ibusimcontext->ibuscontext, -+ ibus_text_new_from_string (""), -+ 0, -+ FALSE, -+ IBUS_ENGINE_PREEDIT_CLEAR, -+ ibusimcontext); -+ g_signal_emit (ibusimcontext, _signal_commit_id, 0, preedit_string); -+ g_free (preedit_string); -+ } -+} -+ - static gboolean - ibus_im_context_filter_keypress (GtkIMContext *context, - GdkEventKey *event) -@@ -1003,6 +1029,7 @@ ibus_im_context_focus_out (GtkIMContext *context) - - ibusimcontext->has_focus = FALSE; - if (ibusimcontext->ibuscontext) { -+ ibus_im_context_clear_preedit_text (ibusimcontext); - ibus_input_context_focus_out (ibusimcontext->ibuscontext); - } - -@@ -1022,6 +1049,12 @@ ibus_im_context_reset (GtkIMContext *context) - IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); - - if (ibusimcontext->ibuscontext) { -+ /* Commented out ibus_im_context_clear_preedit_text(). -+ * Hangul needs to receive the reset callback with button press -+ * but other IMEs should avoid to receive the reset callback -+ * so the signal would need to be customized with GtkSetting. -+ * IBus uses button-press-event instead. -+ */ - ibus_input_context_reset (ibusimcontext->ibuscontext); - } - gtk_im_context_reset (ibusimcontext->slave); -@@ -1068,21 +1101,67 @@ ibus_im_context_get_preedit_string (GtkIMContext *context, - } - - -+static gboolean -+ibus_im_context_button_press_event_cb (GtkWidget *widget, -+ GdkEventButton *event, -+ IBusIMContext *ibusimcontext) -+{ -+ if (event->button != 1) -+ return FALSE; -+ -+ if (ibusimcontext->preedit_visible && -+ ibusimcontext->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -+ ibus_im_context_clear_preedit_text (ibusimcontext); -+ if (ibusimcontext->ibuscontext) -+ ibus_input_context_reset (ibusimcontext->ibuscontext); -+ } -+ return FALSE; -+} -+ - static void - ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) - { -+ IBusIMContext *ibusimcontext; -+#if !GTK_CHECK_VERSION (3, 93, 0) -+ GtkWidget *widget; -+#endif -+ - IDEBUG ("%s", __FUNCTION__); - -- IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context); -+ ibusimcontext = IBUS_IM_CONTEXT (context); - - if (ibusimcontext->client_window) { -+#if !GTK_CHECK_VERSION (3, 93, 0) -+ gdk_window_get_user_data (ibusimcontext->client_window, -+ (gpointer *)&widget); -+ /* firefox needs GtkWidget instead of GtkWindow */ -+ if (GTK_IS_WIDGET (widget)) { -+ g_signal_handlers_disconnect_by_func ( -+ widget, -+ (GCallback)ibus_im_context_button_press_event_cb, -+ ibusimcontext); -+ } -+#endif - g_object_unref (ibusimcontext->client_window); - ibusimcontext->client_window = NULL; - } - -- if (client != NULL) -+ if (client != NULL) { - ibusimcontext->client_window = g_object_ref (client); -+#if !GTK_CHECK_VERSION (3, 93, 0) -+ gdk_window_get_user_data (ibusimcontext->client_window, -+ (gpointer *)&widget); - -+ /* firefox needs GtkWidget instead of GtkWindow */ -+ if (GTK_IS_WIDGET (widget)) { -+ g_signal_connect ( -+ widget, -+ "button-press-event", -+ G_CALLBACK (ibus_im_context_button_press_event_cb), -+ ibusimcontext); -+ } -+#endif -+ } - if (ibusimcontext->slave) - gtk_im_context_set_client_window (ibusimcontext->slave, client); - } -@@ -1530,6 +1609,7 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext, - IBusText *text, - gint cursor_pos, - gboolean visible, -+ guint mode, - IBusIMContext *ibusimcontext) - { - IDEBUG ("%s", __FUNCTION__); -@@ -1586,6 +1666,7 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext, - - flag = ibusimcontext->preedit_visible != visible; - ibusimcontext->preedit_visible = visible; -+ ibusimcontext->preedit_mode = mode; - - if (ibusimcontext->preedit_visible) { - if (flag) { -@@ -1676,7 +1757,7 @@ _create_input_context_done (IBusBus *bus, - g_error_free (error); - } - else { -- -+ ibus_input_context_set_client_commit_preedit (context, TRUE); - ibusimcontext->ibuscontext = context; - - g_signal_connect (ibusimcontext->ibuscontext, -@@ -1692,7 +1773,7 @@ _create_input_context_done (IBusBus *bus, - G_CALLBACK (_ibus_context_delete_surrounding_text_cb), - ibusimcontext); - g_signal_connect (ibusimcontext->ibuscontext, -- "update-preedit-text", -+ "update-preedit-text-with-mode", - G_CALLBACK (_ibus_context_update_preedit_text_cb), - ibusimcontext); - g_signal_connect (ibusimcontext->ibuscontext, -diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c -index ae7048ad..a809ef08 100644 ---- a/src/ibusinputcontext.c -+++ b/src/ibusinputcontext.c -@@ -2,7 +2,8 @@ - /* vim:set et sts=4: */ - /* ibus - The Input Bus - * Copyright (C) 2008-2013 Peng Huang -- * Copyright (C) 2008-2013 Red Hat, Inc. -+ * Copyright (C) 2018 Takao Fujiwara -+ * Copyright (C) 2008-2018 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -39,6 +40,7 @@ enum { - FORWARD_KEY_EVENT, - DELETE_SURROUNDING_TEXT, - UPDATE_PREEDIT_TEXT, -+ UPDATE_PREEDIT_TEXT_WITH_MODE, - SHOW_PREEDIT_TEXT, - HIDE_PREEDIT_TEXT, - UPDATE_AUXILIARY_TEXT, -@@ -217,6 +219,34 @@ ibus_input_context_class_init (IBusInputContextClass *class) - G_TYPE_UINT, - G_TYPE_BOOLEAN); - -+ /** -+ * IBusInputContext::update-preedit-text-with-mode: -+ * @context: An IBusInputContext. -+ * @text: Text to be updated. -+ * @cursor_pos: Cursor position. -+ * @visible: Whether the update is visible. -+ * @mode: Preedit mode. -+ * -+ * Emitted to update preedit text with the mode. -+ * -+ * (Note: The text object is floating, and it will be released after the -+ * signal. If signal handler wants to keep the object, the handler should -+ * use g_object_ref_sink() to get the ownership of the object.) -+ */ -+ context_signals[UPDATE_PREEDIT_TEXT_WITH_MODE] = -+ g_signal_new (I_("update-preedit-text-with-mode"), -+ G_TYPE_FROM_CLASS (class), -+ G_SIGNAL_RUN_LAST, -+ 0, -+ NULL, NULL, -+ _ibus_marshal_VOID__OBJECT_UINT_BOOLEAN_UINT, -+ G_TYPE_NONE, -+ 4, -+ IBUS_TYPE_TEXT, -+ G_TYPE_UINT, -+ G_TYPE_BOOLEAN, -+ G_TYPE_UINT); -+ - /** - * IBusInputContext::show-preedit-text: - * @context: An IBusInputContext. -@@ -542,6 +572,28 @@ ibus_input_context_g_signal (GDBusProxy *proxy, - g_object_unref (text); - return; - } -+ if (g_strcmp0 (signal_name, "UpdatePreeditTextWithMode") == 0) { -+ GVariant *variant = NULL; -+ gint32 cursor_pos; -+ gboolean visible; -+ guint mode = 0; -+ g_variant_get (parameters, -+ "(vubu)", &variant, &cursor_pos, &visible, &mode); -+ IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (variant)); -+ g_variant_unref (variant); -+ -+ g_signal_emit (context, -+ context_signals[UPDATE_PREEDIT_TEXT_WITH_MODE], -+ 0, -+ text, -+ cursor_pos, -+ visible, -+ mode); -+ -+ if (g_object_is_floating (text)) -+ g_object_unref (text); -+ return; -+ } - - /* lookup signal in table */ - gint i; -@@ -1043,10 +1095,11 @@ ibus_input_context_set_surrounding_text (IBusInputContext *context, - guint32 cursor_pos, - guint32 anchor_pos) - { -+ IBusInputContextPrivate *priv; -+ - g_assert (IBUS_IS_INPUT_CONTEXT (context)); - g_assert (IBUS_IS_TEXT (text)); - -- IBusInputContextPrivate *priv; - priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context); - - if (cursor_pos != priv->surrounding_cursor_pos || -@@ -1090,12 +1143,15 @@ ibus_input_context_set_content_type (IBusInputContext *context, - guint purpose, - guint hints) - { -+ GVariant *cached_content_type; -+ GVariant *content_type; -+ - g_assert (IBUS_IS_INPUT_CONTEXT (context)); - -- GVariant *cached_content_type = -+ cached_content_type = - g_dbus_proxy_get_cached_property ((GDBusProxy *) context, - "ContentType"); -- GVariant *content_type = g_variant_new ("(uu)", purpose, hints); -+ content_type = g_variant_new ("(uu)", purpose, hints); - - g_variant_ref_sink (content_type); - if (cached_content_type == NULL || -@@ -1142,18 +1198,22 @@ ibus_input_context_get_engine_async_finish (IBusInputContext *context, - GAsyncResult *res, - GError **error) - { -+ GVariant *variant; -+ GVariant *engine_desc_variant; -+ IBusEngineDesc *desc; -+ - g_assert (IBUS_IS_INPUT_CONTEXT (context)); - g_assert (G_IS_ASYNC_RESULT (res)); - g_assert (error == NULL || *error == NULL); - -- GVariant *variant = g_dbus_proxy_call_finish ((GDBusProxy *) context, -- res, error); -+ variant = g_dbus_proxy_call_finish ((GDBusProxy *) context, res, error); - if (variant == NULL) { - return NULL; - } - -- GVariant *engine_desc_variant = g_variant_get_child_value (variant, 0); -- IBusEngineDesc *desc = IBUS_ENGINE_DESC (ibus_serializable_deserialize (engine_desc_variant)); -+ engine_desc_variant = g_variant_get_child_value (variant, 0); -+ desc = IBUS_ENGINE_DESC ( -+ ibus_serializable_deserialize (engine_desc_variant)); - g_variant_unref (engine_desc_variant); - g_variant_unref (variant); - -@@ -1163,9 +1223,13 @@ ibus_input_context_get_engine_async_finish (IBusInputContext *context, - IBusEngineDesc * - ibus_input_context_get_engine (IBusInputContext *context) - { -- g_assert (IBUS_IS_INPUT_CONTEXT (context)); - GVariant *result = NULL; - GError *error = NULL; -+ GVariant *engine_desc_variant; -+ IBusEngineDesc *desc; -+ -+ g_assert (IBUS_IS_INPUT_CONTEXT (context)); -+ - result = g_dbus_proxy_call_sync ((GDBusProxy *) context, - "GetEngine", /* method_name */ - NULL, /* parameters */ -@@ -1189,8 +1253,9 @@ ibus_input_context_get_engine (IBusInputContext *context) - return NULL; - } - -- GVariant *engine_desc_variant = g_variant_get_child_value (result, 0); -- IBusEngineDesc *desc = IBUS_ENGINE_DESC (ibus_serializable_deserialize (engine_desc_variant)); -+ engine_desc_variant = g_variant_get_child_value (result, 0); -+ desc = IBUS_ENGINE_DESC ( -+ ibus_serializable_deserialize (engine_desc_variant)); - g_variant_unref (engine_desc_variant); - g_variant_unref (result); - -@@ -1214,6 +1279,41 @@ ibus_input_context_set_engine (IBusInputContext *context, - ); - } - -+void -+ibus_input_context_set_client_commit_preedit (IBusInputContext *context, -+ gboolean client_commit) -+{ -+ GVariant *cached_content_type; -+ GVariant *var_client_commit; -+ -+ g_assert (IBUS_IS_INPUT_CONTEXT (context)); -+ -+ cached_content_type = -+ g_dbus_proxy_get_cached_property ((GDBusProxy *) context, -+ "ClientCommitPreedit"); -+ var_client_commit = g_variant_new ("(b)", client_commit); -+ -+ g_variant_ref_sink (var_client_commit); -+ if (cached_content_type == NULL) { -+ g_dbus_proxy_call ((GDBusProxy *) context, -+ "org.freedesktop.DBus.Properties.Set", -+ g_variant_new ("(ssv)", -+ IBUS_INTERFACE_INPUT_CONTEXT, -+ "ClientCommitPreedit", -+ var_client_commit), -+ G_DBUS_CALL_FLAGS_NONE, -+ -1, -+ NULL, /* cancellable */ -+ NULL, /* callback */ -+ NULL /* user_data */ -+ ); -+ } -+ -+ if (cached_content_type != NULL) -+ g_variant_unref (cached_content_type); -+ g_variant_unref (var_client_commit); -+} -+ - #define DEFINE_FUNC(name, Name) \ - void \ - ibus_input_context_##name (IBusInputContext *context) \ -diff --git a/src/ibusinputcontext.h b/src/ibusinputcontext.h -index a77cf92f..09992148 100644 ---- a/src/ibusinputcontext.h -+++ b/src/ibusinputcontext.h -@@ -2,7 +2,8 @@ - /* vim:set et sts=4: */ - /* ibus - The Input Bus - * Copyright (C) 2008-2013 Peng Huang -- * Copyright (C) 2008-2013 Red Hat, Inc. -+ * Copyright (C) 2018 Takao Fujiwara -+ * Copyright (C) 2008-2018 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public -@@ -498,5 +499,29 @@ void ibus_input_context_set_content_type - guint purpose, - guint hints); - -+/** -+ * ibus_input_context_set_client_commit_preedit: -+ * @context: An #IBusInputContext. -+ * @client_commit: %TRUE if your input context commits pre-edit texts -+ * with Space or Enter key events or mouse click events. %FALSE if -+ * ibus-daemon commits pre-edit texts with those events. -+ * The default is %FALSE. The behavior is decided with -+ * ibus_engine_update_preedit_text_with_mode() to commit, clear or -+ * keep the pre-edit text and this API is important in ibus-hangul. -+ * -+ * Set whether #IBusInputContext commits pre-edit texts or not. -+ * If %TRUE, 'update-preedit-text-with-mode' signal is emitted -+ * instead of 'update-preedit-text' signal. -+ * If your client receives the 'update-preedit-text-with-mode' signal, -+ * the client needs to implement commit_text() of pre-edit text when -+ * GtkIMContextClass.focus_out() is called in case an IME desires that -+ * behavior but it depends on each IME. -+ * -+ * See also ibus_engine_update_preedit_text_with_mode(). -+ */ -+void ibus_input_context_set_client_commit_preedit ( -+ IBusInputContext *context, -+ gboolean client_commit); -+ - G_END_DECLS - #endif --- -2.17.1 - -From 7b3b8c8b0c6a41ab524e0be9474825da9cba96ac Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 13 Nov 2018 14:27:52 +0900 -Subject: [PATCH] client/gtk2: Do not delete IBUS_CAP_SURROUNDING_TEXT - -retrieve-surrounding signal could be failed with the first typing -on firefox. It could be a bug in firefox but now IBusIMContext does not -delete IBUS_CAP_SURROUNDING_TEXT in the capabilities as a workaround -when retrieve-surrounding signal is failed. -Also added retrieve-surrounding signal after some committing text. - -BUG=https://github.com/ibus/ibus/issues/2054 ---- - client/gtk2/ibusimcontext.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index 73a0eaec..82af51a1 100644 ---- a/client/gtk2/ibusimcontext.c -+++ b/client/gtk2/ibusimcontext.c -@@ -298,6 +298,7 @@ ibus_im_context_commit_event (IBusIMContext *ibusimcontext, - IBusText *text = ibus_text_new_from_unichar (ch); - g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text); - g_object_unref (text); -+ _request_surrounding_text (ibusimcontext); - return TRUE; - } - return FALSE; -@@ -386,9 +387,12 @@ _request_surrounding_text (IBusIMContext *context) - g_signal_emit (context, _signal_retrieve_surrounding_id, 0, - &return_value); - if (!return_value) { -- context->caps &= ~IBUS_CAP_SURROUNDING_TEXT; -- ibus_input_context_set_capabilities (context->ibuscontext, -- context->caps); -+ /* #2054 firefox::IMContextWrapper::GetCurrentParagraph() could -+ * fail with the first typing on firefox but it succeeds with -+ * the second typing. -+ */ -+ g_warning ("%s has no capability of surrounding-text feature", -+ g_get_prgname ()); - } - } - } -@@ -877,6 +881,7 @@ ibus_im_context_clear_preedit_text (IBusIMContext *ibusimcontext) - ibusimcontext); - g_signal_emit (ibusimcontext, _signal_commit_id, 0, preedit_string); - g_free (preedit_string); -+ _request_surrounding_text (ibusimcontext); - } - } - --- -2.17.1 - -From 4c40afba9c862b4f6651b1b971553e5e89e83343 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 6 Dec 2018 16:53:57 +0900 -Subject: [PATCH] client/gtk2: Always reset and clear preedit on mouse click - -Thinking about the reset signal again, now I think it's good to emit -the reset signal and clear the preedit on mouse click for any engines -besides Hangul because the behavior could be handled by each engine -with the reset signal. - -BUG=https://github.com/ibus/ibus/issues/1980 ---- - client/gtk2/ibusimcontext.c | 26 +++++++++++++------------- - 1 file changed, 13 insertions(+), 13 deletions(-) - -diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index 82af51a1..ed7fea6e 100644 ---- a/client/gtk2/ibusimcontext.c -+++ b/client/gtk2/ibusimcontext.c -@@ -869,16 +869,19 @@ ibus_im_context_finalize (GObject *obj) - static void - ibus_im_context_clear_preedit_text (IBusIMContext *ibusimcontext) - { -+ gchar *preedit_string = NULL; - g_assert (ibusimcontext->ibuscontext); - if (ibusimcontext->preedit_visible && - ibusimcontext->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -- gchar *preedit_string = g_strdup (ibusimcontext->preedit_string); -- _ibus_context_update_preedit_text_cb (ibusimcontext->ibuscontext, -- ibus_text_new_from_string (""), -- 0, -- FALSE, -- IBUS_ENGINE_PREEDIT_CLEAR, -- ibusimcontext); -+ preedit_string = g_strdup (ibusimcontext->preedit_string); -+ } -+ _ibus_context_update_preedit_text_cb (ibusimcontext->ibuscontext, -+ ibus_text_new_from_string (""), -+ 0, -+ FALSE, -+ IBUS_ENGINE_PREEDIT_CLEAR, -+ ibusimcontext); -+ if (preedit_string) { - g_signal_emit (ibusimcontext, _signal_commit_id, 0, preedit_string); - g_free (preedit_string); - _request_surrounding_text (ibusimcontext); -@@ -1114,12 +1117,9 @@ ibus_im_context_button_press_event_cb (GtkWidget *widget, - if (event->button != 1) - return FALSE; - -- if (ibusimcontext->preedit_visible && -- ibusimcontext->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT) { -- ibus_im_context_clear_preedit_text (ibusimcontext); -- if (ibusimcontext->ibuscontext) -- ibus_input_context_reset (ibusimcontext->ibuscontext); -- } -+ ibus_im_context_clear_preedit_text (ibusimcontext); -+ if (ibusimcontext->ibuscontext) -+ ibus_input_context_reset (ibusimcontext->ibuscontext); - return FALSE; - } - --- -2.19.1 - -From ba41173c45a4ba6e047f94ac53474433c7643591 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Fri, 7 Dec 2018 17:38:09 +0900 -Subject: [PATCH] src: Show compose preedit with custom compose file - -IBusEngineSimple is fixed for custom compose files - - Show preeedit with custom compose file - - Tentative compose preedit can be deleted by Backspace - -BUG=https://github.com/ibus/ibus/issues/2058 ---- - src/ibusenginesimple.c | 93 ++++++++++++++++++++++++------------------ - 1 file changed, 53 insertions(+), 40 deletions(-) - -diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c -index aae6b8df..ba9d92b6 100644 ---- a/src/ibusenginesimple.c -+++ b/src/ibusenginesimple.c -@@ -357,7 +357,7 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple) - } else { - int hexchars = 0; - while (priv->compose_buffer[hexchars] != 0) { -- guint16 keysym= priv->compose_buffer[hexchars]; -+ guint16 keysym = priv->compose_buffer[hexchars]; - gunichar unichar = ibus_keysym_to_unicode (keysym, FALSE); - if (unichar > 0) - outbuf[len] = unichar; -@@ -620,6 +620,8 @@ check_table (IBusEngineSimple *simple, - - guint16 *prev_seq; - -+ priv->tentative_match = 0; -+ priv->tentative_match_len = 0; - /* Back up to the first sequence that matches to make sure - * we find the exact match if their is one. - */ -@@ -654,9 +656,9 @@ check_table (IBusEngineSimple *simple, - - ibus_engine_simple_commit_char (simple, value); - priv->compose_buffer[0] = 0; -- ibus_engine_simple_update_preedit_text (simple); - // g_debug ("U+%04X\n", value); - } -+ ibus_engine_simple_update_preedit_text (simple); - return TRUE; - } - -@@ -1057,6 +1059,51 @@ ibus_engine_simple_set_number_on_lookup_table (IBusEngineSimple *simple, - ibus_engine_simple_update_preedit_text (simple); - } - -+static gboolean -+ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple, -+ gint n_compose) -+{ -+ IBusEngineSimplePrivate *priv = simple->priv; -+ gboolean compose_finish; -+ gunichar output_char; -+ GSList *list = global_tables; -+ -+ while (list) { -+ if (check_table (simple, -+ (IBusComposeTable *)list->data, -+ n_compose)) { -+ return TRUE; -+ } -+ list = list->next; -+ } -+ -+ if (ibus_check_compact_table (&ibus_compose_table_compact, -+ priv->compose_buffer, -+ n_compose, -+ &compose_finish, -+ &output_char)) { -+ if (compose_finish) { -+ ibus_engine_simple_commit_char (simple, output_char); -+ priv->compose_buffer[0] = 0; -+ } -+ ibus_engine_simple_update_preedit_text (simple); -+ return TRUE; -+ } -+ -+ if (ibus_check_algorithmically (priv->compose_buffer, -+ n_compose, -+ &output_char)) { -+ if (output_char) { -+ ibus_engine_simple_commit_char (simple, output_char); -+ priv->compose_buffer[0] = 0; -+ } -+ ibus_engine_simple_update_preedit_text (simple); -+ return TRUE; -+ } -+ -+ return FALSE; -+} -+ - static gboolean - ibus_engine_simple_process_key_event (IBusEngine *engine, - guint keyval, -@@ -1076,8 +1123,6 @@ ibus_engine_simple_process_key_event (IBusEngine *engine, - guint hex_keyval; - guint printable_keyval; - gint i; -- gboolean compose_finish; -- gunichar output_char; - - while (n_compose < EMOJI_SOURCE_LEN && priv->compose_buffer[n_compose] != 0) - n_compose++; -@@ -1247,7 +1292,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine, - if (n_compose > 0) { - n_compose--; - priv->compose_buffer[n_compose] = 0; -- ibus_engine_simple_update_preedit_text (simple); -+ priv->tentative_match = 0; -+ ibus_engine_simple_check_all_compose_table (simple, n_compose); - return TRUE; - } - } -@@ -1479,42 +1525,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine, - - return TRUE; - } -- } -- else { -- GSList *list = global_tables; -- while (list) { -- if (check_table (simple, -- (IBusComposeTable *)list->data, -- n_compose)) { -- // g_debug("check_table returns true"); -- return TRUE; -- } -- list = list->next; -- } -- -- if (ibus_check_compact_table (&ibus_compose_table_compact, -- priv->compose_buffer, -- n_compose, -- &compose_finish, -- &output_char)) { -- if (compose_finish) { -- ibus_engine_simple_commit_char (simple, output_char); -- priv->compose_buffer[0] = 0; -- } -- ibus_engine_simple_update_preedit_text (simple); -- return TRUE; -- } -- -- if (ibus_check_algorithmically (priv->compose_buffer, -- n_compose, -- &output_char)) { -- if (output_char) { -- ibus_engine_simple_commit_char (simple, output_char); -- priv->compose_buffer[0] = 0; -- } -- ibus_engine_simple_update_preedit_text (simple); -+ } else { -+ if (ibus_engine_simple_check_all_compose_table (simple, n_compose)) - return TRUE; -- } - } - - /* The current compose_buffer doesn't match anything */ --- -2.19.1 - -From 28b0744ad141bd76281025e9d0857d2182bc2a65 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Mon, 10 Dec 2018 13:21:42 +0900 -Subject: [PATCH] src: Clear preedit in IBusEngineSimple with focus changes - -BUG=https://github.com/ibus/ibus/issues/2063 ---- - src/ibusenginesimple.c | 23 ++++++++++++++++++++--- - 1 file changed, 20 insertions(+), 3 deletions(-) - -diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c -index ba9d92b6..7615f121 100644 ---- a/src/ibusenginesimple.c -+++ b/src/ibusenginesimple.c -@@ -105,6 +105,8 @@ static GSList *global_tables; - - /* functions prototype */ - static void ibus_engine_simple_destroy (IBusEngineSimple *simple); -+static void ibus_engine_simple_focus_in (IBusEngine *engine); -+static void ibus_engine_simple_focus_out (IBusEngine *engine); - static void ibus_engine_simple_reset (IBusEngine *engine); - static gboolean ibus_engine_simple_process_key_event - (IBusEngine *engine, -@@ -136,6 +138,8 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class) - ibus_object_class->destroy = - (IBusObjectDestroyFunc) ibus_engine_simple_destroy; - -+ engine_class->focus_in = ibus_engine_simple_focus_in; -+ engine_class->focus_out = ibus_engine_simple_focus_out; - engine_class->reset = ibus_engine_simple_reset; - engine_class->process_key_event - = ibus_engine_simple_process_key_event; -@@ -176,6 +180,19 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple) - IBUS_OBJECT (simple)); - } - -+static void -+ibus_engine_simple_focus_in (IBusEngine *engine) -+{ -+ IBUS_ENGINE_CLASS (ibus_engine_simple_parent_class)->focus_in (engine); -+} -+ -+static void -+ibus_engine_simple_focus_out (IBusEngine *engine) -+{ -+ ibus_engine_simple_reset (engine); -+ IBUS_ENGINE_CLASS (ibus_engine_simple_parent_class)->focus_out (engine); -+} -+ - static void - ibus_engine_simple_reset (IBusEngine *engine) - { -@@ -188,14 +205,14 @@ ibus_engine_simple_reset (IBusEngine *engine) - priv->in_hex_sequence = FALSE; - priv->tentative_match = 0; - priv->tentative_match_len = 0; -- ibus_engine_hide_preedit_text ((IBusEngine *)simple); - } else if (priv->tentative_emoji || priv->in_emoji_sequence) { - priv->in_emoji_sequence = FALSE; - g_clear_pointer (&priv->tentative_emoji, g_free); -- ibus_engine_hide_preedit_text ((IBusEngine *)simple); - } else if (!priv->in_hex_sequence && !priv->in_emoji_sequence) { -- ibus_engine_hide_preedit_text ((IBusEngine *)simple); -+ priv->tentative_match = 0; -+ priv->tentative_match_len = 0; - } -+ ibus_engine_hide_preedit_text ((IBusEngine *)simple); - } - - static void --- -2.19.1 - -From c7d8771cb9fc652cb638aa7cb8e10ea6b889509e Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 11 Dec 2018 19:16:10 +0900 -Subject: [PATCH] client/gtk2: Fix SEGV on mouse clicks when ibus-daemon not - running - ---- - client/gtk2/ibusimcontext.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index ed7fea6e..ab7ff88a 100644 ---- a/client/gtk2/ibusimcontext.c -+++ b/client/gtk2/ibusimcontext.c -@@ -1117,9 +1117,10 @@ ibus_im_context_button_press_event_cb (GtkWidget *widget, - if (event->button != 1) - return FALSE; - -- ibus_im_context_clear_preedit_text (ibusimcontext); -- if (ibusimcontext->ibuscontext) -+ if (ibusimcontext->ibuscontext) { -+ ibus_im_context_clear_preedit_text (ibusimcontext); - ibus_input_context_reset (ibusimcontext->ibuscontext); -+ } - return FALSE; - } - --- -2.19.1 - -From a78e7f8deb51f01125325da868c8fc75f0436b3e Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Mon, 17 Dec 2018 20:10:34 +0900 -Subject: [PATCH] configure: Generate ibus_localedir variable - ---- - configure.ac | 3 ++- - m4/ibuslocale.m4 | 15 +++++++++++++++ - 2 files changed, 17 insertions(+), 1 deletion(-) - create mode 100644 m4/ibuslocale.m4 - -diff --git a/configure.ac b/configure.ac -index 26a048c8..8fc76239 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -111,7 +111,8 @@ GETTEXT_PACKAGE=ibus10 - AC_SUBST(GETTEXT_PACKAGE) - AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", - [The prefix for out gettext translation domains.]) --AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", -+DEFINE_IBUS_LOCALEDIR -+AC_DEFINE_UNQUOTED(LOCALEDIR, "$ibus_localedir", - [Define the location where the catalogs will be installed]) - - # For dislpay date. -diff --git a/m4/ibuslocale.m4 b/m4/ibuslocale.m4 -new file mode 100644 -index 00000000..d0f45cfb ---- /dev/null -+++ b/m4/ibuslocale.m4 -@@ -0,0 +1,15 @@ -+AC_DEFUN([DEFINE_IBUS_LOCALEDIR], [ -+ibus_save_prefix="$prefix" -+ibus_save_datarootdir="$datarootdir" -+ibus_save_datadir="$datadir" -+ibus_save_localedir="$localedir" -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+datarootdir=`eval echo "$datarootdir"` -+datadir=`eval echo "$datadir"` -+test "x$localedir" = xNONE && localedir="${datadir}/locale" -+ibus_localedir=`eval echo "$localedir"` -+localedir="$ibus_save_localedir" -+datadir="$ibus_save_datadir" -+datarootdir="$ibus_save_datarootdir" -+prefix="$ibus_save_prefix" -+]) --- -2.20.1 - -From 1cd5254811259befe50c8bd81584d1bfe2c63ed0 Mon Sep 17 00:00:00 2001 -From: glasseyes -Date: Mon, 17 Dec 2018 20:20:11 +0900 -Subject: [PATCH] src: use iso 639-3 to have names for more languages - -Keyman and others support them so they shouldn't be in "Other" - -BUG=https://github.com/ibus/ibus/issues/2064 ---- - ibus/lang.py | 8 ++++---- - src/ibusutil.c | 16 ++++++++-------- - 2 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/ibus/lang.py b/ibus/lang.py -index 3b3f552f..64324bd8 100644 ---- a/ibus/lang.py -+++ b/ibus/lang.py -@@ -36,7 +36,7 @@ def get_language_name(_locale): - lang = lang.lower() - if lang in __languages_dict: - lang = __languages_dict[lang] -- lang = gettext.dgettext("iso_639", lang) -+ lang = gettext.dgettext("iso_639-3", lang) - else: - lang = _(u"Other") - lang = gettext.dgettext("ibus", lang) -@@ -46,7 +46,7 @@ def __start_element(name, attrs): - global __languages_dict - try: - name = attrs[u"name"] -- for attr_name in (u"iso_639_2B_code", u"iso_639_2T_code", u"iso_639_1_code"): -+ for attr_name in (u"id", u"part1_code", u"part2_code"): - if attr_name in attrs: - attr_value = attrs[attr_name] - __languages_dict[attr_value] = name -@@ -62,12 +62,12 @@ def __char_data(data): - def __load_lang(): - import os - import _config -- iso_639_xml = os.path.join(_config.ISOCODES_PREFIX, "share/xml/iso-codes/iso_639.xml") -+ iso_639_3_xml = os.path.join(_config.ISOCODES_PREFIX, "share/xml/iso-codes/iso_639-3.xml") - p = xml.parsers.expat.ParserCreate() - p.StartElementHandler = __start_element - p.EndElementHandler = __end_element - p.CharacterDataHandler = __char_data -- p.ParseFile(file(iso_639_xml)) -+ p.ParseFile(file(iso_639_3_xml)) - - __load_lang() - -diff --git a/src/ibusutil.c b/src/ibusutil.c -index 15e36f80..fd1da006 100644 ---- a/src/ibusutil.c -+++ b/src/ibusutil.c -@@ -45,7 +45,7 @@ _iso_codes_parse_xml_node (XMLNode *node) - GList *p; - g_assert (node); - -- if (G_UNLIKELY (g_strcmp0 (node->name, "iso_639_entries") != 0)) { -+ if (G_UNLIKELY (g_strcmp0 (node->name, "iso_639_3_entries") != 0)) { - return FALSE; - } - -@@ -57,9 +57,9 @@ _iso_codes_parse_xml_node (XMLNode - const gchar *key; - gchar *value; - } entries[] = { -- { "iso_639_2B_code", NULL }, -- { "iso_639_2T_code", NULL }, -- { "iso_639_1_code", NULL }, -+ { "id", NULL }, -+ { "part1_code", NULL }, -+ { "part2_code", NULL }, - }; - - if (sub_node->attributes == NULL) { -@@ -99,14 +99,14 @@ _load_lang() - struct stat buf; - - #ifdef ENABLE_NLS -- bindtextdomain ("iso_639", LOCALEDIR); -- bind_textdomain_codeset ("iso_639", "UTF-8"); -+ bindtextdomain ("iso_639-3", LOCALEDIR); -+ bind_textdomain_codeset ("iso_639-3", "UTF-8"); - #endif - - __languages_dict = g_hash_table_new_full (g_str_hash, - g_str_equal, g_free, g_free); - filename = g_build_filename (ISOCODES_PREFIX, -- "share/xml/iso-codes/iso_639.xml", -+ "share/xml/iso-codes/iso_639-3.xml", - NULL); - if (g_stat (filename, &buf) != 0) { - g_warning ("Can not get stat of file %s", filename); -@@ -157,7 +157,7 @@ ibus_get_language_name (const gchar *_lo - if (g_strcmp0 (retval, "Other") == 0) - return dgettext (GETTEXT_PACKAGE, N_("Other")); - else -- return dgettext ("iso_639", retval); -+ return dgettext ("iso_639-3", retval); - #else - return retval; - #endif --- -2.19.1 - -From 7b9c034f570bb1bf89569a01b98d6771b1596722 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Mon, 17 Dec 2018 20:26:32 +0900 -Subject: [PATCH] m4: Add ibuslocale.m4 to Makefile.am - ---- - m4/Makefile.am | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/m4/Makefile.am b/m4/Makefile.am -index 57e00807..dcf84ac3 100644 ---- a/m4/Makefile.am -+++ b/m4/Makefile.am -@@ -3,7 +3,7 @@ - # ibus - The Input Bus - # - # Copyright (c) 2007-2010 Peng Huang --# Copyright (c) 2007-2010 Red Hat, Inc. -+# Copyright (c) 2007-2018 Red Hat, Inc. - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public -@@ -22,6 +22,7 @@ - - EXTRA_DIST = \ - as-version.m4 \ -+ ibuslocale.m4 \ - vapigen.m4 \ - $(NULL) - --- -2.20.1 - -From 9ae2d4658fff3d1e7262fb4fb7ca9ce1af0a27ec Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 20 Dec 2018 16:40:31 +0900 -Subject: [PATCH] client/gtk2: Use button-press-event only with - IBUS_ENGINE_PREEDIT_COMMIT - -BUG=https://github.com/ibus/ibus/issues/1980 ---- - client/gtk2/ibusimcontext.c | 66 ++++++++++++++++++++++++------------- - 1 file changed, 43 insertions(+), 23 deletions(-) - -diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c -index ab7ff88a..f9310867 100644 ---- a/client/gtk2/ibusimcontext.c -+++ b/client/gtk2/ibusimcontext.c -@@ -72,6 +72,8 @@ struct _IBusIMContext { - /* cancellable */ - GCancellable *cancellable; - GQueue *events_queue; -+ -+ gboolean use_button_press_event; - }; - - struct _IBusIMContextClass { -@@ -1109,6 +1111,7 @@ ibus_im_context_get_preedit_string (GtkIMContext *context, - } - - -+#if !GTK_CHECK_VERSION (3, 93, 0) - static gboolean - ibus_im_context_button_press_event_cb (GtkWidget *widget, - GdkEventButton *event, -@@ -1124,13 +1127,37 @@ ibus_im_context_button_press_event_cb (GtkWidget *widget, - return FALSE; - } - -+static void -+_connect_button_press_event (IBusIMContext *ibusimcontext, -+ gboolean do_connect) -+{ -+ GtkWidget *widget = NULL; -+ -+ g_assert (ibusimcontext->client_window); -+ gdk_window_get_user_data (ibusimcontext->client_window, -+ (gpointer *)&widget); -+ /* firefox needs GtkWidget instead of GtkWindow */ -+ if (GTK_IS_WIDGET (widget)) { -+ if (do_connect) { -+ g_signal_connect ( -+ widget, -+ "button-press-event", -+ G_CALLBACK (ibus_im_context_button_press_event_cb), -+ ibusimcontext); -+ } else { -+ g_signal_handlers_disconnect_by_func ( -+ widget, -+ G_CALLBACK (ibus_im_context_button_press_event_cb), -+ ibusimcontext); -+ } -+ } -+} -+#endif -+ - static void - ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) - { - IBusIMContext *ibusimcontext; --#if !GTK_CHECK_VERSION (3, 93, 0) -- GtkWidget *widget; --#endif - - IDEBUG ("%s", __FUNCTION__); - -@@ -1138,15 +1165,8 @@ ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) - - if (ibusimcontext->client_window) { - #if !GTK_CHECK_VERSION (3, 93, 0) -- gdk_window_get_user_data (ibusimcontext->client_window, -- (gpointer *)&widget); -- /* firefox needs GtkWidget instead of GtkWindow */ -- if (GTK_IS_WIDGET (widget)) { -- g_signal_handlers_disconnect_by_func ( -- widget, -- (GCallback)ibus_im_context_button_press_event_cb, -- ibusimcontext); -- } -+ if (ibusimcontext->use_button_press_event) -+ _connect_button_press_event (ibusimcontext, FALSE); - #endif - g_object_unref (ibusimcontext->client_window); - ibusimcontext->client_window = NULL; -@@ -1155,17 +1175,8 @@ ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client) - if (client != NULL) { - ibusimcontext->client_window = g_object_ref (client); - #if !GTK_CHECK_VERSION (3, 93, 0) -- gdk_window_get_user_data (ibusimcontext->client_window, -- (gpointer *)&widget); -- -- /* firefox needs GtkWidget instead of GtkWindow */ -- if (GTK_IS_WIDGET (widget)) { -- g_signal_connect ( -- widget, -- "button-press-event", -- G_CALLBACK (ibus_im_context_button_press_event_cb), -- ibusimcontext); -- } -+ if (ibusimcontext->use_button_press_event) -+ _connect_button_press_event (ibusimcontext, TRUE); - #endif - } - if (ibusimcontext->slave) -@@ -1631,6 +1642,15 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext, - ibusimcontext->preedit_attrs = NULL; - } - -+ if (!ibusimcontext->use_button_press_event && -+ mode == IBUS_ENGINE_PREEDIT_COMMIT) { -+#if !GTK_CHECK_VERSION (3, 93, 0) -+ if (ibusimcontext->client_window) -+ _connect_button_press_event (ibusimcontext, TRUE); -+#endif -+ ibusimcontext->use_button_press_event = TRUE; -+ } -+ - str = text->text; - ibusimcontext->preedit_string = g_strdup (str); - if (text->attrs) { --- -2.19.1 - -From 4ef976a8b934bf76cfd855013b766f6492dc9e8a Mon Sep 17 00:00:00 2001 -From: Mathieu Bridon -Date: Mon, 7 Jan 2019 21:15:35 +0900 -Subject: [PATCH] introspection: Tell the GI scanner to include the C - headers - -This adds the following line to the generated gir file: - - - -This is important, for example for Rust bindings generated from the -gtk-rs tooling. - -BUG=https://github.com/ibus/ibus/pull/2071 ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 8fc76239..77823c3c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -315,7 +315,7 @@ GOBJECT_INTROSPECTION_CHECK([0.6.8]) - - IBUS_GIR_SCANNERFLAGS= - if test x"$found_introspection" = x"yes" ; then -- IBUS_GIR_SCANNERFLAGS="--warn-all --identifier-prefix=IBus --symbol-prefix=ibus" -+ IBUS_GIR_SCANNERFLAGS="--warn-all --identifier-prefix=IBus --symbol-prefix=ibus --c-include=ibus.h" - PKG_CHECK_EXISTS([gobject-introspection-1.0 >= 0.9.6], - [gir_symbol_prefix=yes], - [gir_symbol_prefix=no]) --- -2.19.1 - -From 0fd043c3b4c90855bfb4fceed4bf2f3c3635a041 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 8 Jan 2019 12:02:32 +0900 -Subject: [PATCH] portal: Update APIs for Hangul preedit in Flatpak - -BUG=https://github.com/ibus/ibus/issues/1980 ---- - portal/org.freedesktop.IBus.Portal.xml | 9 ++++++++- - portal/portal.c | 18 +++++++++++++++++- - 2 files changed, 25 insertions(+), 2 deletions(-) - -diff --git a/portal/org.freedesktop.IBus.Portal.xml b/portal/org.freedesktop.IBus.Portal.xml -index afce4daa..376ad424 100644 ---- a/portal/org.freedesktop.IBus.Portal.xml -+++ b/portal/org.freedesktop.IBus.Portal.xml -@@ -1,6 +1,6 @@ - -