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: Update fr-bepo dead keys to update fr layouts only
Date: Sun, 31 May 2026 02:08:56 GMT [thread overview]
Message-ID: <178019333660.1.17555921441773092426.rpms-ibus-638f13bd71bc@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 638f13bd71bcd8b8c9eb730f4151e2d89969a9c2
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-06-07T16:40:12+09:00
Stats : +609/-76 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/638f13bd71bcd8b8c9eb730f4151e2d89969a9c2?branch=autotool
Log:
Update fr-bepo dead keys to update fr layouts only
- Add engine/test-gnome.py
- Add src/tests/ibus-keyval.c
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 75e3b46..f89022f 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -3963,10 +3963,10 @@ index f0827b3e..a2fd1441 100644
--
2.49.0
-From c5ea35f14a65875a61dec76cf90c60988dfbfc27 Mon Sep 17 00:00:00 2001
+From a1c1469a2ba70c013f06995fd7665f3e784cbaf0 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 1 Jun 2025 22:11:12 +0900
-Subject: [PATCH 1/2] src/ibusenginesimple: Improve BEPO compose sequence visuals
+Date: Thu, 5 Jun 2025 19:36:20 +0900
+Subject: [PATCH 1/4] src/ibusenginesimple: Improve BEPO compose sequence visuals
The French (BEPO, AFNOR) keymap utilizes pseudo-deadkeys within
U+FDD0 to U+FDD9 range, which lack readable characters but the
@@ -3977,84 +3977,151 @@ follows it.
BUG=https://github.com/ibus/ibus/issues/2748
BUG=https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8368
---
- src/ibuscomposetable.c | 28 ++++++++++++++++++----------
- src/ibusenginesimple.c | 5 +++++
- 2 files changed, 23 insertions(+), 10 deletions(-)
+ src/ibuscomposetable.c | 27 +++++++++++++++++-
+ src/ibusenginesimple.c | 52 ++++++++++++++++++++++++++++++++---
+ src/ibusenginesimpleprivate.h | 12 ++++++++
+ 3 files changed, 86 insertions(+), 5 deletions(-)
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index ffd40c75..8c58beb1 100644
+index ffd40c75..4764426a 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
-@@ -1982,6 +1982,11 @@ ibus_keysym_to_unicode (guint keysym,
- return combined_unicode; \
- else \
- return isolated_unicode
+@@ -2058,7 +2058,7 @@ ibus_keysym_to_unicode (guint keysym,
+ * we use U+00B7, MIDDLE DOT.
+ */
+ return 0x00B7;
+- default:;
++ default:
+ if (need_space)
+ *need_space = FALSE;
+ }
+@@ -2066,3 +2066,28 @@ ibus_keysym_to_unicode (guint keysym,
+ #undef CASE
+ #undef CASE_COMBINE
+ }
++
++gunichar
++ibus_keysym_to_unicode_with_layout (guint keysym,
++ gboolean combining,
++ gboolean *need_space,
++ const gchar *layout,
++ G_GNUC_UNUSED const gchar *variant) {
+#define CASE_KEYSYM(keysym_val, unicode) \
+ case keysym_val: \
+ if (need_space) \
+ *need_space = FALSE; \
+ return unicode
- switch (keysym) {
- #ifdef IBUS_ENGLISH_DEAD_KEY
- CASE (a, 0x0363, 1);
-@@ -2048,16 +2053,18 @@ ibus_keysym_to_unicode (guint keysym,
- CASE (stroke, 0x0335, 1);
- CASE_COMBINE (tilde, 0x0303, 0x007E, 0);
- CASE_COMBINE (voiced_sound, 0x3099, 0x309B, 0);
-- case IBUS_KEY_Multi_key:
-- if (need_space)
-- *need_space = FALSE;
-- /* We only show the Compose key visibly when it is the
-- * only glyph in the preedit, or when it occurs in the
-- * middle of the sequence. Sadly, the official character,
-- * U+2384, COMPOSITION SYMBOL, is bit too distracting, so
-- * we use U+00B7, MIDDLE DOT.
-- */
-- return 0x00B7;
-+ /* We only show the Compose key visibly when it is the
-+ * only glyph in the preedit, or when it occurs in the
-+ * middle of the sequence. Sadly, the official character,
-+ * U+2384, COMPOSITION SYMBOL, is bit too distracting, so
-+ * we use U+00B7, MIDDLE DOT.
-+ */
-+ CASE_KEYSYM(IBUS_KEY_Multi_key, 0x00B7);
+ /* Refer (BEPO, AFNOR) comments in /usr/share/X11/xkb/symbols/fr file. */
-+ CASE_KEYSYM(0x0100FDD4, 0x00DF); /* ß */
-+ CASE_KEYSYM(0x0100FDD5, 0x1D49); /* ᵉ */
-+ CASE_KEYSYM(0x0100FDD7, 0x221E); /* ∞ */
-+ CASE_KEYSYM(0x0100FDD8, 0x2015); /* ― */
- default:;
- if (need_space)
- *need_space = FALSE;
-@@ -2065,4 +2072,5 @@ ibus_keysym_to_unicode (guint keysym,
- return 0x0;
- #undef CASE
- #undef CASE_COMBINE
++ if (!g_ascii_strncasecmp (layout, "fr", 2)) {
++ switch (keysym) {
++ CASE_KEYSYM(0x0100FDD4, 0x00DF); /* ß */
++ CASE_KEYSYM(0x0100FDD5, 0x1D49); /* ᵉ */
++ CASE_KEYSYM(0x0100FDD7, 0x221E); /* ∞ */
++ CASE_KEYSYM(0x0100FDD8, 0x2015); /* ― */
++ default:;
++ }
++ }
+#undef CASE_KEYSYM
- }
++ return ibus_keysym_to_unicode (keysym, combining, need_space);
++}
diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 15c45c2e..784ed180 100644
+index 15c45c2e..258bd849 100644
--- a/src/ibusenginesimple.c
+++ b/src/ibusenginesimple.c
-@@ -471,6 +471,11 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- g_string_append_c (s, ' ');
+@@ -472,15 +472,59 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
g_string_append_unichar (s, ch);
}
-+ } else if (keysym >= 0x0100fdd0 && keysym <= 0x0100fdd9) {
-+ /* A BEPOs pseudo deadkey */
-+ if (!(ch = ibus_keysym_to_unicode (keysym, FALSE, NULL)))
-+ ch = 0x00B7;
-+ g_string_append_unichar (s, ch);
} else {
++ guint unknown_ch = 0;
ch = ibus_keyval_to_unicode (keysym);
if (ch) {
+- g_string_append_unichar(s, ch);
++ /* Should provide ibus_unicode_get_script() for
++ * other IBus engines?
++ */
++ if (g_unichar_get_script (ch) !=
++ G_UNICODE_SCRIPT_UNKNOWN) {
++ g_string_append_unichar(s, ch);
++ } else {
++ unknown_ch = ch;
++ }
+ /* Can send Unicode char as keysym with <Uxxxx> format
+ * in comopse sequences and should not warn this case.
+ */
+- } else if (g_unichar_validate (keysym)) {
+- ch = keysym;
+- g_string_append_unichar(s, ch);
++ } else if (g_unichar_validate (keysym & 0xffff)) {
++ ch = keysym & 0xffff;
++ if (g_unichar_get_script (ch) !=
++ G_UNICODE_SCRIPT_UNKNOWN) {
++ g_string_append_unichar(s, ch);
++ } else {
++ unknown_ch = ch;
++ }
++ }
++ if (unknown_ch) {
++ gchar *name = NULL;
++ gchar *layout = NULL;
++ gchar *layout_end;
++ g_object_get (simple, "engine-name", &name, NULL);
++ if (!g_ascii_strncasecmp (name, "xkb:", 4)) {
++ layout_end = name + 4;
++ while (*layout_end && *layout_end != ':')
++ layout_end++;
++ if (*layout_end == ':') {
++ layout = g_strndup (name + 4,
++ layout_end - name - 4);
++ }
++ } else {
++ g_warning ("Unexpected engine is used: %s", name);
++ }
++ g_free (name);
++ if (layout) {
++ ch = ibus_keysym_to_unicode_with_layout (keysym,
++ FALSE,
++ NULL,
++ layout,
++ NULL);
++ g_free (layout);
++ }
++ if (ch)
++ g_string_append_unichar(s, ch);
++ else
++ g_string_append_unichar(s, 0x00b7); /* · */
+ }
+ }
+ if (!ch) {
+diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
+index ec764fa7..c01d2eb1 100644
+--- a/src/ibusenginesimpleprivate.h
++++ b/src/ibusenginesimpleprivate.h
+@@ -65,6 +65,18 @@ gboolean ibus_compose_table_check (const IBusComposeTableEx *table,
+ gunichar ibus_keysym_to_unicode (guint keysym,
+ gboolean combining,
+ gboolean *need_space);
++/**
++ * ibus_keysym_to_unicode_with_layout:
++ *
++ * Since: 1.5.33
++ * Stability: Unstable
++ */
++gunichar ibus_keysym_to_unicode_with_layout
++ (guint keysym,
++ gboolean combining,
++ gboolean *need_space,
++ const gchar *layout,
++ G_GNUC_UNUSED const gchar *variant);
+
+ G_END_DECLS
+
--
2.49.0
-From b9eaa72e4471b2415e59f47ded4a987ab9057c99 Mon Sep 17 00:00:00 2001
+From 065cb8316ffcb92d97803c8350f02408c478d7f2 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 1 Jun 2025 22:14:00 +0900
-Subject: [PATCH 2/2] src: Do not load en-US compose table by default
+Date: Thu, 5 Jun 2025 19:44:54 +0900
+Subject: [PATCH 2/4] src: Do not load en-US compose table by default
GTK4 has load en-US compose table in case of no user compose file.
GTK4 now does not load the en-US compose table by default in case
@@ -4119,7 +4186,7 @@ index 35d6ce83..161b89e0 100644
basename = g_strdup_printf ("%08x.cache", compose_table->id);
g_debug ("Saving cache id %s", basename);
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 8c58beb1..2f76ef61 100644
+index 4764426a..169ca8cb 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -24,6 +24,7 @@
@@ -4664,9 +4731,9 @@ index 8c58beb1..2f76ef61 100644
ibus_compose_table_save_cache (compose_table);
return g_slist_prepend (compose_tables, compose_table);
-@@ -2074,3 +2256,10 @@ ibus_keysym_to_unicode (guint keysym,
- #undef CASE_COMBINE
+@@ -2091,3 +2273,10 @@ ibus_keysym_to_unicode_with_layout (guint keysym,
#undef CASE_KEYSYM
+ return ibus_keysym_to_unicode (keysym, combining, need_space);
}
+
+
@@ -4764,7 +4831,7 @@ index cdc96331..6d0c1d1f 100644
typedef struct _IBusEngine IBusEngine;
diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 784ed180..f114da8c 100644
+index 258bd849..7bee2403 100644
--- a/src/ibusenginesimple.c
+++ b/src/ibusenginesimple.c
@@ -139,6 +139,7 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
@@ -4847,7 +4914,7 @@ index 784ed180..f114da8c 100644
ibus_engine_send_message (IBUS_ENGINE (simple), message);
}
-@@ -814,7 +838,8 @@ no_sequence_matches (IBusEngineSimple *simple,
+@@ -853,7 +877,8 @@ no_sequence_matches (IBusEngineSimple *simple,
/* Invalid sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4857,7 +4924,7 @@ index 784ed180..f114da8c 100644
ibus_engine_simple_update_preedit_text (simple);
return TRUE;
}
-@@ -958,6 +983,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
+@@ -997,6 +1022,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
GString *output = g_string_new ("");
gboolean success = FALSE;
gboolean is_32bit = FALSE;
@@ -4865,7 +4932,7 @@ index 784ed180..f114da8c 100644
gunichar output_char = '\0';
/* GtkIMContextSimple output the first compose char in case of
-@@ -969,27 +995,40 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
+@@ -1008,27 +1034,40 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
G_LOCK (global_tables);
tmp_list = global_tables;
while (tmp_list) {
@@ -4922,7 +4989,7 @@ index 784ed180..f114da8c 100644
success = TRUE;
break;
}
-@@ -1095,7 +1134,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1134,7 +1173,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
/* invalid hex sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4932,7 +4999,7 @@ index 784ed180..f114da8c 100644
g_string_set_size (priv->tentative_match, 0);
g_clear_pointer (&priv->tentative_emoji, g_free);
priv->in_hex_sequence = FALSE;
-@@ -1120,7 +1160,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1159,7 +1199,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
/* invalid hex sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4942,7 +5009,7 @@ index 784ed180..f114da8c 100644
g_string_set_size (priv->tentative_match, 0);
g_clear_pointer (&priv->tentative_emoji, g_free);
priv->in_hex_sequence = FALSE;
-@@ -1171,7 +1212,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1210,7 +1251,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
/* invalid hex sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4952,7 +5019,7 @@ index 784ed180..f114da8c 100644
g_string_set_size (priv->tentative_match, 0);
g_clear_pointer (&priv->tentative_emoji, g_free);
priv->in_hex_sequence = FALSE;
-@@ -1272,7 +1314,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1311,7 +1353,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
if (n_compose > 0) {
ibus_engine_simple_send_message_with_code (
simple,
@@ -4962,7 +5029,7 @@ index 784ed180..f114da8c 100644
g_string_set_size (priv->tentative_match, 0);
priv->in_hex_sequence = FALSE;
priv->compose_buffer[0] = 0;
-@@ -1339,7 +1382,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1378,7 +1421,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
/* non-hex character in hex sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4972,7 +5039,7 @@ index 784ed180..f114da8c 100644
return TRUE;
}
} else if (priv->in_emoji_sequence) {
-@@ -1400,7 +1444,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1439,7 +1483,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
/* invalid hex sequence */
ibus_engine_simple_send_message_with_code (
simple,
@@ -4982,7 +5049,7 @@ index 784ed180..f114da8c 100644
g_string_set_size (priv->tentative_match, 0);
priv->in_hex_sequence = FALSE;
priv->compose_buffer[0] = 0;
-@@ -1408,7 +1453,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1447,7 +1492,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
} else if (!check_hex (simple, n_compose)) {
ibus_engine_simple_send_message_with_code (
simple,
@@ -4992,7 +5059,7 @@ index 784ed180..f114da8c 100644
}
ibus_engine_simple_update_preedit_text (simple);
-@@ -1503,7 +1549,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
+@@ -1542,7 +1588,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
g_assert (n_compose < (COMPOSE_BUFFER_SIZE + 1));
ibus_engine_simple_send_message_with_code (
simple,
@@ -5002,7 +5069,7 @@ index 784ed180..f114da8c 100644
backup_char = priv->compose_buffer[n_compose];
priv->compose_buffer[n_compose] = 0;
if (ibus_engine_simple_check_all_compose_table (simple, n_compose))
-@@ -1703,9 +1750,19 @@ gboolean
+@@ -1742,9 +1789,19 @@ gboolean
ibus_engine_simple_add_compose_file (IBusEngineSimple *simple,
const gchar *compose_file)
{
@@ -5025,7 +5092,7 @@ index 784ed180..f114da8c 100644
return TRUE;
}
diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index ec764fa7..9c58c03d 100644
+index c01d2eb1..c3f92920 100644
--- a/src/ibusenginesimpleprivate.h
+++ b/src/ibusenginesimpleprivate.h
@@ -26,6 +26,15 @@
@@ -5090,3 +5157,464 @@ index 326d3b90..c07c02c4 100644
--
2.49.0
+From 2b9c87bd4dc81fba0f21688f6f288734564f2590 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Thu, 5 Jun 2025 19:45:30 +0900
+Subject: [PATCH 3/4] engine: Add test-gnome.py to check gnome-desktop
+
+BUG=https://github.com/ibus/ibus/issues/2748
+---
+ configure.ac | 15 +++++
+ engine/Makefile.am | 99 +++++++++++++++++---------------
+ engine/test-gnome.py | 132 +++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 200 insertions(+), 46 deletions(-)
+ create mode 100755 engine/test-gnome.py
+
+diff --git a/configure.ac b/configure.ac
+index 16d56a4d..a5e4a44c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -601,6 +601,20 @@ AC_ARG_WITH(gtk4-im-module-dir,
+ )
+ AC_SUBST(GTK4_IM_MODULEDIR)
+
++AC_MSG_CHECKING([for $PYTHON GI GnomeDesktop module])
++if AC_RUN_LOG([$PYTHON -c "def _configure_test():
++ from gi import require_version as gi_require_version
++ gi_require_version('GnomeDesktop', '4.0')
++ from gi.repository import GnomeDesktop
++_configure_test()"]); then
++ enable_pygnome_desktop="yes"
++else
++ enable_pygnome_desktop="no"
++fi
++AC_MSG_RESULT([$enable_pygnome_desktop])
++AM_CONDITIONAL([ENABLE_PYGNOME_DESKTOP],
++ [test x"$enable_pygnome_desktop" = x"yes"])
++
+ if test x"$enable_python" = x"yes"; then
+ # Check for dbus-python.
+ AC_ARG_ENABLE(dbus-python-check,
+@@ -941,6 +955,7 @@ Build options:
+ PYTHON $PYTHON
+ PYTHON2 $PYTHON2
+ Python overrides dir $pyoverridesdir
++ Python GI GnomeDesktop module $enable_pygnome_desktop
+ Enable python2 $enable_python2
+ Gtk2 immodule dir $GTK2_IM_MODULEDIR
+ Gtk3 immodule dir $GTK3_IM_MODULEDIR
+diff --git a/engine/Makefile.am b/engine/Makefile.am
+index a2d6063a..3e4d045f 100644
+--- a/engine/Makefile.am
++++ b/engine/Makefile.am
+@@ -4,7 +4,7 @@
+ #
+ # Copyright (c) 2010-2016, Google Inc. All rights reserved.
+ # Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
+-# Copyright (c) 2013-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
++# Copyright (c) 2013-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ #
+ # This library is free software; you can redistribute it and/or
+ # modify it under the terms of the GNU Lesser General Public
+@@ -24,76 +24,83 @@
+ libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la
+
+ AM_CPPFLAGS = \
+- -I$(top_srcdir)/src \
+- -I$(top_builddir)/src \
+- $(NULL)
++ -I$(top_srcdir)/src \
++ -I$(top_builddir)/src \
++ $(NULL)
+
+ AM_CFLAGS = \
+- @GLIB2_CFLAGS@ \
+- @GIO2_CFLAGS@ \
+- @GTHREAD2_CFLAGS@ \
+- -DG_LOG_DOMAIN=\"IBUS\" \
+- -DPKGDATADIR=\"$(pkgdatadir)\" \
+- -DLIBEXECDIR=\"$(libexecdir)\" \
+- -DBINDIR=\"@bindir@\" \
++ @GLIB2_CFLAGS@ \
++ @GIO2_CFLAGS@ \
++ @GTHREAD2_CFLAGS@ \
++ -DG_LOG_DOMAIN=\"IBUS\" \
++ -DPKGDATADIR=\"$(pkgdatadir)\" \
++ -DLIBEXECDIR=\"$(libexecdir)\" \
++ -DBINDIR=\"@bindir@\" \
+ -DIBUS_DISABLE_DEPRECATED \
+- -Wno-unused-variable \
+- -Wno-unused-but-set-variable \
+- -Wno-unused-function \
+- $(NULL)
++ -Wno-unused-variable \
++ -Wno-unused-but-set-variable \
++ -Wno-unused-function \
++ $(NULL)
+
+ AM_LDADD = \
+- @GOBJECT2_LIBS@ \
+- @GLIB2_LIBS@ \
+- @GIO2_LIBS@ \
+- @GTHREAD2_LIBS@ \
+- $(libibus) \
+- $(NULL)
++ @GOBJECT2_LIBS@ \
++ @GLIB2_LIBS@ \
++ @GIO2_LIBS@ \
++ @GTHREAD2_LIBS@ \
++ $(libibus) \
++ $(NULL)
+
+ AM_VALAFLAGS = \
+- --vapidir=$(top_builddir)/bindings/vala \
+- --pkg=ibus-1.0 \
++ --vapidir=$(top_builddir)/bindings/vala \
++ --pkg=ibus-1.0 \
+ --pkg-config="\"$(PKG_CONFIG) --with-path=$(PKG_CONFIG_PATH)\"" \
+- --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
+- $(NULL)
++ --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
++ $(NULL)
++
++TESTS =
++
++if ENABLE_PYGNOME_DESKTOP
++TESTS += test-gnome.py
++endif
+
+ libexec_PROGRAMS = \
+- ibus-engine-simple \
+- $(NULL)
++ ibus-engine-simple \
++ $(NULL)
+
+ ibus_engine_simple_SOURCES = \
+- main.vala \
+- $(NULL)
++ main.vala \
++ $(NULL)
+ ibus_engine_simple_CFLAGS = \
+- $(AM_CFLAGS) \
+- $(NULL)
++ $(AM_CFLAGS) \
++ $(NULL)
+ ibus_engine_simple_LDADD = \
+- $(AM_LDADD) \
+- $(NULL)
++ $(AM_LDADD) \
++ $(NULL)
+ ibus_engine_simple_DEPENDENCIES = \
+- $(libibus) \
+- $(NULL)
++ $(libibus) \
++ $(NULL)
+
+ component_DATA = \
+- simple.xml \
+- $(NULL)
++ simple.xml \
++ $(NULL)
+
+ componentdir = $(pkgdatadir)/component
+
+ MAINTAINERCLEANFILES = \
+- simple.xml.in \
+- $(NULL)
++ simple.xml.in \
++ $(NULL)
+
+ CLEANFILES = \
+- simple.xml \
+- $(NULL)
++ simple.xml \
++ $(NULL)
+
+ EXTRA_DIST = \
+- denylist.txt \
+- gensimple.py \
+- iso639converter.py \
+- simple.xml.in \
+- $(NULL)
++ denylist.txt \
++ gensimple.py \
++ iso639converter.py \
++ simple.xml.in \
++ test-gnome.py \
++ $(NULL)
+
+ simple.xml: simple.xml.in
+ $(AM_V_GEN) sed \
+diff --git a/engine/test-gnome.py b/engine/test-gnome.py
+new file mode 100755
+index 00000000..0a603fb0
+--- /dev/null
++++ b/engine/test-gnome.py
+@@ -0,0 +1,132 @@
++#!/usr/bin/python
++# vim:set fileencoding=utf-8 et sts=4 sw=4:
++#
++# ibus - Intelligent Input Bus for Linux / Unix OS
++#
++# Copyright © 2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
++#
++# This library is free software; you can redistribute it and/or
++# modify it under the terms of the GNU Lesser General Public
++# License as published by the Free Software Foundation; either
++# version 2.1 of the License, or (at your option) any later version.
++#
++# This library is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++# Lesser General Public License for more details.
++#
++# You should have received a copy of the GNU Lesser General Public
++# License along with this library. If not, see <http://www.gnu.org/licenses/>.
++
++# Check gnome-shell/js/misc/keyboardManager.js
++
++from gi import require_version as gi_require_version
++gi_require_version('GnomeDesktop', '4.0')
++
++from gi.repository import GnomeDesktop
++
++import os, re, sys
++
++
++class TestGnomeDesktop:
++ __srcdir = '.'
++ __option_debug = False
++ __simple_filename = 'simple.xml.in'
++ __denylist_filename = 'denylist.txt'
++ __xkb_info = None
++ __simple_contents = None
++ __denylist_lines = None
++
++ @classmethod
++ def parse_args(cls):
++ cls.__srcdir = os.path.dirname(sys.argv[0])
++ if cls.__srcdir == '':
++ cls.__srcdir = '.'
++ if len(sys.argv) > 1:
++ arg1 = sys.argv[1]
++ if arg1 == '--debug':
++ cls.__option_debug = True
++
++ def __init__(self):
++ self.__simple_filename = '%s/%s' % (self.__srcdir,
++ self.__simple_filename)
++ self.__denylist_filename = '%s/%s' % (self.__srcdir,
++ self.__denylist_filename)
++ self.__xkb_info = GnomeDesktop.XkbInfo()
++
++ def read_simple(self):
++ simple_file = open(self.__simple_filename)
++ self.__simple_contents = simple_file.read()
++ simple_file.close()
++
++ def read_denylist(self):
++ denylist_file = open(self.__denylist_filename)
++ self.__denylist_lines = denylist_file.readlines()
++ denylist_file.close()
++ l = []
++ for line in self.__denylist_lines:
++ line = line.rstrip()
++ if len(line) == 0:
++ continue
++ if not line.startswith('#'):
++ l.append(line)
++ self.__denylist_lines = l
++
++ def __check_known_issue_engine_name(self, desc):
++ reason = None
++ if desc == 'xkb:in:eng:eng':
++ wrong_desc = 'xkb:in:eng:en'
++ simple_res = re.search(wrong_desc, self.__simple_contents)
++ if simple_res != None:
++ reason = '# Info: xkeyboard-config 2.42 has incorrect %s ' \
++ "but it's fixed in 2.44" % wrong_desc
++ return reason
++
++ def test_simple_with_gnome(self):
++ errnum = 0
++ for layout_variant in self.__xkb_info.get_all_layouts():
++ languages = self.__xkb_info.get_languages_for_layout(layout_variant)
++ layouts = layout_variant.split('+')
++ if len(languages) == 0:
++ if self.__option_debug:
++ print('# Info: No language: %s' % layout_variant)
++ continue
++ if len(layouts) >= 2:
++ desc = 'xkb:%s:%s:%s' % (layouts[0], layouts[1], languages[0])
++ else:
++ desc = 'xkb:%s::%s' % (layouts[0], languages[0])
++ if self.__option_debug:
++ print('# Debug: Test', layout_variant, languages, desc)
++ simple_res = re.search(desc, self.__simple_contents)
++ if simple_res == None:
++ denylist_res = None
++ for line in self.__denylist_lines:
++ denylist_res = re.match(line, desc)
++ if denylist_res != None:
++ break
++ if denylist_res == None:
++ reason = self.__check_known_issue_engine_name(desc)
++ if reason != None:
++ if self.__option_debug:
++ print(reason)
++ else:
++ errnum = errnum + 1
++ print('# Error: not found: %s' % desc, file=sys.stderr)
++ elif self.__option_debug:
++ print('# Info: %s in denylist' % desc)
++ return errnum
++
++
++def main():
++ TestGnomeDesktop.parse_args()
++ obj = TestGnomeDesktop()
++ obj.read_simple()
++ obj.read_denylist()
++ errnum = obj.test_simple_with_gnome()
++ if errnum == 0:
++ print('Succeeded.')
++ else:
++ print('Failed. %s errors found.' % errnum, file=sys.stderr)
++ sys.exit(1)
++
++main()
+--
+2.49.0
+
+From b0ef1d79b7ae1289823380a194382372990ef333 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Thu, 5 Jun 2025 19:45:56 +0900
+Subject: [PATCH 4/4] src/tests: Add ibus-keyval
+
+Test ibus_keyval_to_unicode() and ibus_unicode_to_keyval()
+
+BUG=https://github.com/ibus/ibus/issues/2748
+---
+ src/tests/Makefile.am | 10 +++++-
+ src/tests/ibus-keyval.c | 74 +++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 83 insertions(+), 1 deletion(-)
+ create mode 100644 src/tests/ibus-keyval.c
+
+diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
+index 628bef5f..125bdb26 100644
+--- a/src/tests/Makefile.am
++++ b/src/tests/Makefile.am
+@@ -3,7 +3,7 @@
+ # ibus - The Input Bus
+ #
+ # Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
+-# Copyright (c) 2015-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
++# Copyright (c) 2015-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ # Copyright (c) 2007-2018 Red Hat, Inc.
+ #
+ # This library is free software; you can redistribute it and/or
+@@ -79,6 +79,10 @@ TESTS_C += ibus-keypress
+ endif
+ endif
+
++if ENABLE_GTK4
++TESTS_C += ibus-keyval
++endif
++
+ TESTS_ENVIRONMENT = \
+ top_builddir=$(top_builddir) \
+ top_srcdir=$(top_srcdir) \
+@@ -224,6 +228,10 @@ ibus_keypress_LDADD = $(prog_ldadd) @GTK3_LIBS@ @XTEST_LIBS@
+ endif
+ endif
+
++ibus_keyval_SOURCES = ibus-keyval.c
++ibus_keyval_CFLAGS = @GTK4_CFLAGS@
++ibus_keyval_LDADD = $(prog_ldadd) @GTK4_LIBS@
++
+ ibus_registry_SOURCES = ibus-registry.c
+ ibus_registry_LDADD = $(prog_ldadd)
+
+diff --git a/src/tests/ibus-keyval.c b/src/tests/ibus-keyval.c
+new file mode 100644
+index 00000000..fd2afbbb
+--- /dev/null
++++ b/src/tests/ibus-keyval.c
+@@ -0,0 +1,74 @@
++/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
++
++#include <config.h>
++
++#include <gtk/gtk.h>
++#include <ibus.h>
++
++#ifdef ENABLE_NLS
++#include <locale.h>
++#endif
++
++#ifndef MAX
++#define MAX(a, b) (a) >= (b) ? (a) : (b)
++#endif
++
++#define MAX_KEYVAL 0x00FFFFFF
++#define MAX_UNICODE 0x0010FFFF
++
++
++static gboolean
++test_keyval (void)
++{
++ guint si, bi;
++ gunichar ibus_uch, gdk_uch;
++
++ for (si = 0; si < MAX_KEYVAL; ++si) {
++ ibus_uch = ibus_keyval_to_unicode (si);
++ gdk_uch = gdk_keyval_to_unicode (si);
++ g_assert_cmpuint (ibus_uch, ==, gdk_uch);
++
++ bi = si | 0x01000000;
++ ibus_uch = ibus_keyval_to_unicode (bi);
++ gdk_uch = gdk_keyval_to_unicode (bi);
++ g_assert_cmpuint (ibus_uch, ==, gdk_uch);
++
++ if (!(si % 0x100000))
++ g_message ("0x%08X/0x%08X is done", si, MAX_KEYVAL);
++ }
++ return TRUE;
++}
++
++
++static gboolean
++test_unicode (void)
++{
++ gunichar i;
++ guint ibus_key, gdk_key;
++ for (i = 0; i < MAX_UNICODE; ++i) {
++ ibus_key = ibus_unicode_to_keyval (i);
++ gdk_key = gdk_unicode_to_keyval (i);
++ g_assert_cmpuint (ibus_key, ==, gdk_key);
++ if (!(i % 0x100000))
++ g_message ("0x%08X/0x%08X is done", i, MAX_UNICODE);
++ }
++ return TRUE;
++}
++
++
++int
++main (int argc, char *argv[])
++{
++#if !GTK_CHECK_VERSION (4, 0, 0)
++ g_message ("The latest GTK 4 is needed for this test case.");
++ return 77;
++#else
++#ifdef ENABLE_NLS
++ setlocale (LC_ALL, "");
++#endif
++ test_keyval ();
++ g_message ("----------");
++ test_unicode ();
++ return EXIT_SUCCESS;
++#endif
++}
+--
+2.49.0
+
diff --git a/ibus.spec b/ibus.spec
index 5eaf157..37bf6aa 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: 3%{?dist}
+Release: 4%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPL-2.1-or-later
URL: https://github.com/ibus/%name/wiki
@@ -641,6 +641,11 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
+* Sat Jun 07 2025 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.32-4
+- Update fr-bepo dead keys to update fr layouts only
+- Add engine/test-gnome.py
+- Add src/tests/ibus-keyval.c
+
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 1.5.32-3
- Rebuilt for Python 3.14
reply other threads:[~2026-05-31 2:08 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=178019333660.1.17555921441773092426.rpms-ibus-638f13bd71bc@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