public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Takao Fujiwara <tfujiwar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ibus] autotool: Enhance Xutf8TextListToTextProperty in ibus-x11
Date: Sun, 31 May 2026 02:07:55 GMT [thread overview]
Message-ID: <178019327523.1.12338765931360479465.rpms-ibus-355503863c93@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 355503863c93742b5a91ca72354c0b691e60e36f
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2022-07-29T17:21:00+09:00
Stats : +95/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/355503863c93742b5a91ca72354c0b691e60e36f?branch=autotool
Log:
Enhance Xutf8TextListToTextProperty in ibus-x11
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index dc9f150..53cd713 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -4435,3 +4435,94 @@ index f8dced6b..92464234 100755
--
2.35.3
+From d47dbfada41aa4fb5df9f7cffe873786fc4849cc Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Mon, 25 Jul 2022 17:22:21 +0900
+Subject: [PATCH] client/x11: Enhance Xutf8TextListToTextProperty
+
+XCompoundTextStyle depends on the current locale and some locales fail
+to to get the compound text style.
+If Xutf8TextListToTextProperty() fails, now ibus-x11 tries to get
+the compound text style with UTF-8 encoding.
+
+BUG=https://github.com/ibus/ibus/issues/2422
+---
+ client/x11/main.c | 41 ++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 34 insertions(+), 7 deletions(-)
+
+diff --git a/client/x11/main.c b/client/x11/main.c
+index fe30c1d6..6057cc03 100644
+--- a/client/x11/main.c
++++ b/client/x11/main.c
+@@ -2,7 +2,7 @@
+ /* vim:set et sts=4: */
+ /* ibus
+ * Copyright (C) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
+- * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
++ * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2007-2015 Red Hat, Inc.
+ *
+ * main.c:
+@@ -48,6 +48,8 @@
+
+ #include <getopt.h>
+
++#define ESC_SEQUENCE_ISO10646_1 "\033%G"
++
+ #define LOG(level, fmt_args...) \
+ if (g_debug_level >= (level)) { \
+ g_debug (fmt_args); \
+@@ -254,9 +256,17 @@ _xim_preedit_callback_draw (XIMS xims, X11IC *x11ic, const gchar *preedit_string
+ text.feedback = feedback;
+
+ if (len > 0) {
+- Xutf8TextListToTextProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+- (char **)&preedit_string,
+- 1, XCompoundTextStyle, &tp);
++ int ret = Xutf8TextListToTextProperty (
++ GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
++ (char **)&preedit_string,
++ 1, XCompoundTextStyle, &tp);
++ if (ret == EXIT_FAILURE) {
++ XFree (tp.value);
++ tp.value = (unsigned char *)g_strdup_printf (
++ "%s%s",
++ ESC_SEQUENCE_ISO10646_1,
++ preedit_string);
++ }
+ text.encoding_is_wchar = 0;
+ text.length = strlen ((char*)tp.value);
+ text.string.multi_byte = (char*)tp.value;
+@@ -883,9 +893,26 @@ _context_commit_text_cb (IBusInputContext *context,
+
+ XTextProperty tp;
+ IMCommitStruct cms = {0};
+-
+- Xutf8TextListToTextProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
+- (gchar **)&(text->text), 1, XCompoundTextStyle, &tp);
++ int ret;
++
++ ret = Xutf8TextListToTextProperty (
++ GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
++ (gchar **)&(text->text), 1, XCompoundTextStyle, &tp);
++ /* XCompoundTextStyle uses the encoding escaped sequence + encoded chars
++ * matched to the specified multibyte characters: text->text, and
++ * libX11.so sorts the encoding sets by locale.
++ * If an encoded string fails to be matched, ibus-x11 specifies the
++ * ISO10641-1 encoding and that escaped sequence is "\033%G":
++ * https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/xlibi18n/lcCT.c
++ * , and the encoding is UTF-8 with utf8_wctomb():
++ * https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/xlibi18n/lcUniConv/utf8.h
++ */
++ if (ret == EXIT_FAILURE) {
++ XFree (tp.value);
++ tp.value = (unsigned char *)g_strdup_printf ("%s%s",
++ ESC_SEQUENCE_ISO10646_1,
++ text->text);
++ }
+
+ cms.major_code = XIM_COMMIT;
+ cms.icid = x11ic->icid;
+--
+2.35.3
+
diff --git a/ibus.spec b/ibus.spec
index d1dd42a..9e23198 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -39,7 +39,7 @@
Name: ibus
Version: 1.5.26
-Release: 14%{?dist}
+Release: 15%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@@ -524,6 +524,9 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
+* Fri Jul 29 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.26-15
+- Enhance Xutf8TextListToTextProperty in ibus-x11
+
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.26-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
reply other threads:[~2026-05-31 2:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178019327523.1.12338765931360479465.rpms-ibus-355503863c93@fedoraproject.org \
--to=tfujiwar@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox