public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Emoji annotation enhancement and some bug fixes
@ 2026-05-31  2:08 Takao Fujiwara
  0 siblings, 0 replies; only message in thread
From: Takao Fujiwara @ 2026-05-31  2:08 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/ibus
            Branch : autotool
            Commit : 2bd879a89e30011d6f97b39d3f10d965c3ca35db
            Author : Takao Fujiwara <tfujiwar@redhat.com>
            Date   : 2025-06-26T09:07:41+09:00
            Stats  : +417/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/ibus/c/2bd879a89e30011d6f97b39d3f10d965c3ca35db?branch=autotool

            Log:
            Emoji annotation enhancement and some bug fixes

- #2267613 Append non-glyph characters at last order for partial annotations
- Fix PageUp/PageDown buttons with hidding candidate popup
- Add warning when specify --disable-appindicator configure option
- Do not require gtk-doc when specify --disable-gtk-doc autogen option

---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index f89022f..9ea8b3c 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -5618,3 +5618,413 @@ index 00000000..fd2afbbb
 -- 
 2.49.0
 
+From 219386a67501e1a0fbbe45b28d5ef57e12a3c7d6 Mon Sep 17 00:00:00 2001
+From: matiwari <matiwari@redhat.com>
+Date: Thu, 9 Jan 2025 12:17:26 +0530
+Subject: [PATCH 1/4] ui/gtk3: Append non-glyph characters at last order for partial annotations
+
+BUG=rhbz#2267613
+---
+ ui/gtk3/emojier.vala | 106 +++++++++++++++++++++++++++++++++++--------
+ 1 file changed, 87 insertions(+), 19 deletions(-)
+
+diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
+index 8c527eca..cd60fc08 100644
+--- a/ui/gtk3/emojier.vala
++++ b/ui/gtk3/emojier.vala
+@@ -165,6 +165,53 @@ public class IBusEmojier : Gtk.ApplicationWindow {
+                 set_label(text);
+         }
+     }
++    /**
++     * ECheckVisibleLabel:
++     * Create a label with the Pango context for the font glyph checking.
++     */
++    private class ECheckVisibleLabel : EWhiteLabel {
++        private Pango.Layout layout;
++        public ECheckVisibleLabel(string text = "") {
++            GLib.Object(
++                name : "IBusEmojierCheckVisibleLabel"
++            );
++            if (text != "")
++                set_label(text);
++            var pango_context = get_pango_context();
++            layout = new Pango.Layout(pango_context);
++            var font_desc =
++                    Pango.FontDescription.from_string(m_emoji_font_family);
++            layout.set_font_description(font_desc);
++        }
++        public bool is_glyph_visible(string emoji) {
++            string cleaned_emoji = emoji
++                .replace("\uFE0E", "")
++                .replace("\uFE0F", "");
++            if (cleaned_emoji == "")
++                return false;
++            layout.set_text(cleaned_emoji, -1);
++            unowned Pango.LayoutLine? line = layout.get_line_readonly(0);
++            if (line == null)
++                return false;
++            Pango.Rectangle ink_rect;
++            Pango.Rectangle logical_rect;
++            line.get_pixel_extents(out ink_rect, out logical_rect);
++            if (ink_rect.width <= 0 || ink_rect.height <= 0)
++                return false;
++            // Check if single glyph is available for single characters
++            if (cleaned_emoji.char_count() == 1) {
++                unowned GLib.SList<Pango.GlyphItem>? runs = line.runs;
++                if (runs != null && runs.length() == 1) {
++                    var run = runs.data;
++                    var font = run.item.analysis.font;
++                    unichar ch = cleaned_emoji.get_char();
++                    if (!font.has_char(ch))
++                        return false;
++                }
++            }
++            return true;
++        }
++    }
+     private class EPaddedLabel : Gtk.Label {
+         public EPaddedLabel(string          text,
+                             Gtk.Align       align) {
+@@ -1268,12 +1315,30 @@ public class IBusEmojier : Gtk.ApplicationWindow {
+     }
+ 
+ 
++    private delegate void CheckGlyph(string                  emoji,
++                                     ref GLib.SList<string>? emojis,
++                                     bool                    do_sort);
++
+     private GLib.SList<string>?
+     lookup_emojis_from_annotation(string annotation) {
+         GLib.SList<string>? total_emojis = null;
++        GLib.SList<string>? non_glyph_emojis = null;
+         unowned GLib.SList<string>? sub_emojis = null;
+         unowned GLib.SList<unichar>? sub_exact_unicodes = null;
+         unowned GLib.SList<unichar>? sub_unicodes = null;
++        var label = new ECheckVisibleLabel();
++        // valac warning for inner func: local functions are experimental
++        CheckGlyph check_if_non_glyph_emojis = (emoji, ref emojis, do_sort) => {
++            if (label.is_glyph_visible(emoji)) {
++                if (do_sort)
++                    emojis.insert_sorted(emoji, GLib.strcmp);
++                else
++                    emojis.append(emoji);
++            } else if (non_glyph_emojis.find_custom(emoji,
++                                                    GLib.strcmp) == null) {
++                non_glyph_emojis.append(emoji);
++            }
++        };
+         int length = annotation.length;
+         if (m_has_partial_match && length >= m_partial_match_length) {
+             GLib.SList<string>? sorted_emojis = null;
+@@ -1303,49 +1368,52 @@ 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) {
+-                        sorted_emojis.insert_sorted(emoji, GLib.strcmp);
++                        check_if_non_glyph_emojis(emoji,
++                                                  ref sorted_emojis,
++                                                  true);
+                     }
+                 }
+             }
+             foreach (string emoji in sorted_emojis) {
+-                if (total_emojis.find_custom(emoji, GLib.strcmp) == null) {
++                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);
++                check_if_non_glyph_emojis(emoji, ref total_emojis, false);
+         }
+         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 (total_emojis.find_custom(ch, GLib.strcmp) == null)
++                check_if_non_glyph_emojis(ch, ref total_emojis, false);
+         }
+         if (length >= m_partial_match_length) {
+             GLib.SList<string>? sorted_unicodes = null;
+             foreach (unowned string key in m_name_to_unicodes_dict.get_keys()) {
+-                bool matched = false;
+-                if (key.index_of(annotation) >= 0)
+-                        matched = true;
+-                if (!matched)
+-                    continue;
+-                sub_unicodes = m_name_to_unicodes_dict.lookup(key);
+-                foreach (unichar code in sub_unicodes) {
+-                    string ch = code.to_string();
+-                    if (sorted_unicodes.find_custom(ch, GLib.strcmp) == null) {
+-                        sorted_unicodes.insert_sorted(ch, GLib.strcmp);
++                if (key.index_of(annotation) >= 0) {
++                    sub_unicodes = m_name_to_unicodes_dict.lookup(key);
++                    foreach (unichar code in sub_unicodes) {
++                        string ch = code.to_string();
++                        if (sorted_unicodes.find_custom(ch,
++                                                        GLib.strcmp) == null) {
++                            check_if_non_glyph_emojis(ch,
++                                                      ref sorted_unicodes,
++                                                      true);
++                        }
+                     }
+                 }
+             }
+             foreach (string ch in sorted_unicodes) {
+-                if (total_emojis.find_custom(ch, GLib.strcmp) == null) {
++                if (total_emojis.find_custom(ch, GLib.strcmp) == null)
+                     total_emojis.append(ch);
+-                }
+             }
+         }
++        foreach (string emoji in non_glyph_emojis) {
++            if (total_emojis.find_custom(emoji, GLib.strcmp) == null)
++                total_emojis.append(emoji);
++        }
+         if (!m_loaded_unicode && m_unicode_deserialize_unicode_signal_id == 0) {
+             m_unicode_deserialize_unicode_signal_id =
+                     m_unicode_progress_object.deserialize_unicode.connect(
+-- 
+2.49.0
+
+From f9592f30a2c2ac9f3b331eddf00845d9584e3bdc Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Fri, 13 Jun 2025 15:57:37 +0900
+Subject: [PATCH 2/4] ui/gtk3: Fix PageUp/PageDown buttons with hidding candidate popup
+
+Gtk.Widget.show_all() changes the visibilities of the child widgets
+and it's not good in case that the parent visibility depends on the
+visibilities of child widgets. Also using no_show_all property could
+introduce the more complicated logic to the candidate popup.
+
+BUG=https://github.com/ibus/ibus/issues/2757
+Fixes: https://github.com/ibus/ibus/commit/6ac6188
+Fixes: https://github.com/ibus/ibus/commit/d5e6e71
+---
+ ui/gtk3/candidatepanel.vala | 7 +++++--
+ ui/gtk3/panel.vala          | 4 ++--
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
+index a4137f05..3cc2c086 100644
+--- a/ui/gtk3/candidatepanel.vala
++++ b/ui/gtk3/candidatepanel.vala
+@@ -214,7 +214,6 @@ public class CandidatePanel : Gtk.Box{
+         m_set_preedit_text_id =
+                 Timeout.add(100,
+                             () => {
+-                                //warning("test set_preedit_text_real");
+                                 m_set_preedit_text_id = 0;
+                                 set_preedit_text_real(text, cursor);
+                                 return Source.REMOVE;
+@@ -480,7 +479,11 @@ public class CandidatePanel : Gtk.Box{
+     }
+ 
+     public new void show() {
+-        m_toplevel.show_all();
++        // m_toplevel.show_all() changes m_candidate_area.get_visible()
++        // in update_real() so show() is just used. Using no_show_all
++        // property for m_candidate_area would introduce the more
++        // complicated logic.
++        m_toplevel.show();
+     }
+ 
+     public new void hide() {
+diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
+index d65ffbb3..61ee2e43 100644
+--- a/ui/gtk3/panel.vala
++++ b/ui/gtk3/panel.vala
+@@ -218,7 +218,7 @@ class Panel : IBus.PanelService {
+ 
+ #if USE_GDK_WAYLAND
+     private CandidatePanel get_active_candidate_panel() {
+-        if (m_wayland_object_path == null) {
++        if (m_is_wayland && m_wayland_object_path == null) {
+             if (m_candidate_panel_x11 == null) {
+                 m_candidate_panel_x11 = candidate_panel_new(true);
+                 set_use_glyph_from_engine_lang();
+@@ -233,7 +233,7 @@ class Panel : IBus.PanelService {
+     }
+ 
+     private Switcher get_active_switcher() {
+-        if (m_wayland_object_path == null) {
++        if (m_is_wayland && m_wayland_object_path == null) {
+             if (m_switcher_x11 == null)
+                 m_switcher_x11 = switcher_new(true);
+             return m_switcher_x11;
+-- 
+2.49.0
+
+From 152a58b5e90d1b6a94b1c09cd5778080e0762949 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Sat, 14 Jun 2025 15:15:58 +0900
+Subject: [PATCH 3/4] configure: Add warning to run `make -C ui/gtk3 maintainer-clean-generic`
+
+When users specify --disable-appindicator, --disable-xim,
+--disable-gtk3-wayland, --disable-emoji-dict options for configure,
+the behavior effects VALA files in ibus/ui/gtk3 and need to
+regenerate C files but many users don't know the steps so added
+a warning in the configure output to inform to run
+`make -C ui/gtk3 maintainer-clean-generic` of the users.
+
+BUG=https://github.com/ibus/ibus/issues/2767
+---
+ configure.ac | 29 ++++++++++++++++++++++++++++-
+ 1 file changed, 28 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a5e4a44c..8a2b32d7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -889,6 +889,30 @@ AC_SUBST(XKBCONFIG_BASE)
+ 
+ AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
+ 
++OUTPUT_TAIL=''
++HAS_OUTPUT_TAIL=0
++AS_IF([test x"$enable_ui" != x"no" &&
++       test -f "$ac_confdir/ui/gtk3/application.c"
++      ],
++      [AS_IF([test x"$enable_appindicator" = x"no" ||
++              test x"$enable_xim" = x"no" ||
++              test x"$enable_gdk3_wayland" != x"yes" ||
++              test x"$enable_emoji_dict" == x"no"
++             ],
++             [OUTPUT_TAIL="$OUTPUT_TAIL
++You invoked the \`configure\` script with either disabled appinicator, xim,
++gdk3_wayland or emoji_dict option so you have to run
++\`make -C ui/gtk3 maintainer-clean-generic\` to regenerate C files with VALA
++before run \`make\`.
++"
++              HAS_OUTPUT_TAIL=1
++             ],
++             [])
++      ],
++      []
++)
++
++
+ # OUTPUT files
+ AC_CONFIG_FILES([
+ po/Makefile.in
+@@ -992,4 +1016,7 @@ Build options:
+   Run test cases                $enable_tests
+   Install tests                 $enable_install_tests
+ ])
+-
++AS_IF([test $HAS_OUTPUT_TAIL -eq 1],
++      [AC_MSG_WARN([$OUTPUT_TAIL])],
++      []
++)
+-- 
+2.49.0
+
+From d6b95085ec6aeaeb5af9cc3d9872348ba359638e Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Wed, 25 Jun 2025 21:56:51 +0900
+Subject: [PATCH 4/4] autogen: Do not require gtk-doc
+
+Since the license of gtk-doc.make and m4/gtk-doc.m4 is GPL but not LGPL,
+IBus does not save these files but add a dummy file m4/gtk-doc-dummy.m4.
+Now you can run `env GTKDOCIZE=echo ./autogen.sh --disable-gtk-doc`.
+
+BUG=https://github.com/ibus/ibus/issues/2770
+---
+ autogen.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 51 insertions(+), 4 deletions(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index cde8aaef..1ae2ccc4 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -5,6 +5,7 @@
+ : ${srcdir:=.}
+ : ${SAVE_DIST_FILES:=0}
+ : ${MAKE:=make}
++: ${GTKDOCIZE:=gtkdocize}
+ 
+ olddir=$(pwd)
+ # shellcheck disable=SC2016
+@@ -33,7 +34,12 @@ cd "$srcdir"
+     exit 1
+ }
+ 
+-(test $(grep -q "^GTK_DOC_CHECK" configure.ac)) || {
++CONFIGFLAGS="$@"
++(test "x$NOCONFIGURE" = "x" ) &&
++$(grep -q "^GTK_DOC_CHECK" configure.ac) && {
++    # $WANT_GTK_DOC: If the source files require gtk-doc
++    # Specify "--disable-gtk-doc" option for autogen.sh if you wish to disable
++    # the gtk-doc builds.
+     WANT_GTK_DOC=1
+     FEDORA_PKG2="$FEDORA_PKG2 gtk-doc"
+ }
+@@ -54,16 +60,57 @@ cd "$srcdir"
+     }
+ }
+ 
+-CONFIGFLAGS="$@"
+ (test "$#" = 0 -a "x$NOCONFIGURE" = "x" ) && {
+     echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
+     echo "*** If you wish to pass any to it, please specify them on the" >&2
+     echo "*** '$0' command line." >&2
+     echo "" >&2
+-    (test $WANT_GTK_DOC -eq 1) && CONFIGFLAGS="--enable-gtk-doc $@"
+ }
+ 
+-(test $WANT_GTK_DOC -eq 1) && gtkdocize --copy
++(test "x$NOCONFIGURE" = "x" ) && {
++    $(echo "x$CONFIGFLAGS" | grep -q disable-gtk-doc) || {
++        (test $WANT_GTK_DOC -eq 1) && CONFIGFLAGS="--enable-gtk-doc $@"
++        (test -f ./m4/gtk-doc-dummy.m4) && $(rm ./m4/gtk-doc-dummy.m4)
++    }
++}
++
++# If $WANT_GTK_DOC is 1, gtkdocize should run basically. You could apply
++# GTKDOCIZE=echo for the workaround if you disable to run dtkdocize likes
++# autoreconf.
++(test $WANT_GTK_DOC -eq 1) && $GTKDOCIZE --copy
++
++(test "x$NOCONFIGURE" = "x" ) &&
++$(echo "x$CONFIGFLAGS" | grep -q disable-gtk-doc) &&
++(test ! -f ./m4/gtk-doc.m4 ) && {
++    # The license of gtk-doc.make and m4/gtk-doc.m4 is GPL but not LGPL
++    # and IBus does not save the static files.
++    cat > ./gtk-doc.make <<_EOF_MAKE
++    EXTRA_DIST=
++    CLEANFILES=
++_EOF_MAKE
++    cat > ./m4/gtk-doc-dummy.m4 <<_EOF_M4
++AC_DEFUN([GTK_DOC_CHECK],
++[
++    have_gtk_doc=no
++    AC_MSG_CHECKING([for gtk-doc])
++    AC_MSG_RESULT($have_gtk_doc)
++
++    dnl enable/disable documentation building
++    AC_ARG_ENABLE([gtk-doc],
++    AS_HELP_STRING([--enable-gtk-doc],
++                   [use gtk-doc to build documentation [[default=no]]]),,
++    [enable_gtk_doc=no])
++
++    AC_MSG_CHECKING([whether to build gtk-doc documentation])
++    AC_MSG_RESULT($enable_gtk_doc)
++    AM_CONDITIONAL([ENABLE_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
++
++    if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then
++        AC_MSG_ERROR([Something wrong in the build.])
++    fi
++])
++_EOF_M4
++}
+ 
+ ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 \
+ autoreconf --verbose --force --install || exit 1
+-- 
+2.49.0
+

diff --git a/ibus.spec b/ibus.spec
index 1be0798..7c25f98 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -63,7 +63,7 @@
 Name:           ibus
 Version:        1.5.32
 # https://github.com/fedora-infra/rpmautospec/issues/101
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        Intelligent Input Bus for Linux OS
 License:        LGPL-2.1-or-later
 URL:            https://github.com/ibus/%name/wiki
@@ -641,6 +641,12 @@ dconf update || :
 %{_datadir}/installed-tests/ibus
 
 %changelog
+* Thu Jun 26 2025 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.32-6
+- #2267613 Append non-glyph characters at last order for partial annotations
+- Fix PageUp/PageDown buttons with hidding candidate popup
+- Add warning when specify --disable-appindicator configure option
+- Do not require gtk-doc when specify --disable-gtk-doc autogen option
+
 * Sat Jun 07 2025 Python Maint <python-maint@redhat.com> - 1.5.32-5
 - Rebuilt for Python 3.14
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31  2:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31  2:08 [rpms/ibus] autotool: Emoji annotation enhancement and some bug fixes Takao Fujiwara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox