From e4d7f1ede0cee7d8f142a14e9bac3f5a1125ad3e Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Mar 30 2018 03:52:30 +0000 Subject: Fixed Bug 1554714 - improve order of unicode matches --- diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index b7299df..89530ca 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -72,3 +72,85 @@ index 8707e432..24029703 100644 -- 2.14.3 +From b184861396279d903e62bf6aad271a2205a79832 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Fri, 30 Mar 2018 12:33:59 +0900 +Subject: [PATCH] ui/gtk3: Sort Unicode candidates + +BUG=rhbz#1554714 +R=Shawn.P.Huang@gmail.com + +Review URL: https://codereview.appspot.com/339430043 +--- + ui/gtk3/emojier.vala | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala +index 24029703..0c0865f1 100644 +--- a/ui/gtk3/emojier.vala ++++ b/ui/gtk3/emojier.vala +@@ -1144,9 +1144,11 @@ public class IBusEmojier : Gtk.ApplicationWindow { + lookup_emojis_from_annotation(string annotation) { + GLib.SList? total_emojis = null; + unowned GLib.SList? sub_emojis = null; ++ unowned GLib.SList? sub_exact_unicodes = null; + unowned GLib.SList? sub_unicodes = null; + int length = annotation.length; + if (m_has_partial_match && length >= m_partial_match_length) { ++ GLib.SList? sorted_emojis = null; + foreach (unowned string key in + m_annotation_to_emojis_dict.get_keys()) { + if (key.length < length) +@@ -1173,16 +1175,29 @@ public class IBusEmojier : Gtk.ApplicationWindow { + sub_emojis = m_annotation_to_emojis_dict.lookup(key); + foreach (unowned string emoji in sub_emojis) { + if (total_emojis.find_custom(emoji, GLib.strcmp) == null) { +- total_emojis.append(emoji); ++ sorted_emojis.insert_sorted(emoji, GLib.strcmp); + } + } + } ++ foreach (string emoji in sorted_emojis) { ++ if (total_emojis.find_custom(emoji, GLib.strcmp) == null) { ++ total_emojis.append(emoji); ++ } ++ } + } else { + sub_emojis = m_annotation_to_emojis_dict.lookup(annotation); + foreach (unowned string emoji in sub_emojis) + total_emojis.append(emoji); + } ++ sub_exact_unicodes = m_name_to_unicodes_dict.lookup(annotation); ++ foreach (unichar code in sub_exact_unicodes) { ++ string ch = code.to_string(); ++ if (total_emojis.find_custom(ch, GLib.strcmp) == null) { ++ total_emojis.append(ch); ++ } ++ } + if (length >= m_partial_match_length) { ++ GLib.SList? sorted_unicodes = null; + foreach (unowned string key in m_name_to_unicodes_dict.get_keys()) { + bool matched = false; + if (key.index_of(annotation) >= 0) +@@ -1192,11 +1207,16 @@ public class IBusEmojier : Gtk.ApplicationWindow { + sub_unicodes = m_name_to_unicodes_dict.lookup(key); + foreach (unichar code in sub_unicodes) { + string ch = code.to_string(); +- if (total_emojis.find_custom(ch, GLib.strcmp) == null) { +- total_emojis.append(ch); ++ if (sorted_unicodes.find_custom(ch, GLib.strcmp) == null) { ++ sorted_unicodes.insert_sorted(ch, GLib.strcmp); + } + } + } ++ foreach (string ch in sorted_unicodes) { ++ if (total_emojis.find_custom(ch, GLib.strcmp) == null) { ++ total_emojis.append(ch); ++ } ++ } + } + return total_emojis; + } +-- +2.14.3 + diff --git a/ibus.spec b/ibus.spec index 9e8360a..48a3c7e 100644 --- a/ibus.spec +++ b/ibus.spec @@ -30,7 +30,7 @@ Name: ibus Version: 1.5.18 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ Group: System Environment/Libraries @@ -431,6 +431,9 @@ dconf update || : %{_datadir}/gtk-doc/html/* %changelog +* Fri Mar 30 2018 Takao Fujiwara - 1.5.18-4 +- Fixed Bug 1554714 - improve order of unicode matches + * Thu Mar 15 2018 Takao Fujiwara - 1.5.18-3 - Fixed Bug 1554813 - Enter key on numpad in Emojier