public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:07 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 9fc0c9da0a16d5b6fdac3d8d78741c4336c9f76d
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2021-08-20T15:55:45+09:00
Stats : +0/-6201 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/9fc0c9da0a16d5b6fdac3d8d78741c4336c9f76d?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 0b56af7..05c3c97 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -1,6204 +1,3 @@
-From 214b60a3af67b6e8dafdb8edba666a369f18be12 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 26 Mar 2021 22:48:08 +0900
-Subject: [PATCH] src/tests: Run gnome-session with no-overview mode
-
-gnome-shell 40 now shows the overview mode by login and
-gnome-desktop-testing-runner cannot get the input focus.
-Running gnome-session with no-overview shell extension can
-get the input focus or mutter is another option.
-The default may be changed to twm if mutter also will be changed
-not to accept the application focus in the future.
-
-Disable Tour dialog which prevent test application from getting the
-input focus.
-
-Don't output FAIL if the actual failure is 0 for Fedora CI.
-
-BUG=https://discourse.gnome.org/t/focus-on-autostart-application-by-login/5863
----
- src/tests/ibus-desktop-testing-runner.in | 69 ++++++++++++++++++++----
- 1 file changed, 60 insertions(+), 9 deletions(-)
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 4232c549..15b2369d 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -4,7 +4,7 @@
- #
- # ibus - The Input Bus
- #
--# Copyright (c) 2018-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2018 Red Hat, Inc.
- #
- # This program is free software; you can redistribute it and/or modify
-@@ -36,7 +36,7 @@
-
-
- PROGNAME=`basename $0`
--VERSION=0.1
-+VERSION=0.2
- DISPLAY=:99.0
- BUILDDIR="."
- SRCDIR="."
-@@ -80,7 +80,9 @@ usage()
- "-b, --builddir=BUILDDIR Set the BUILDDIR\n" \
- "-s, --srcdir=SOURCEDIR Set the SOURCEDIR\n" \
- "-c, --no-graphics Use Xvfb instead of Xorg\n" \
--"-d, --desktop=DESKTOP Run DESTKTOP. The default is gnome-session\n" \
-+"-d, --desktop=DESKTOP Run DESTKTOP. The default is gnome-session.\n" \
-+" Suffix '-with-dbus' can run DESKTOP with dbus session." \
-+" E.g. --desktop=mutter-with-dbus" \
- "-t, --tests=\"TESTS...\" Run TESTS programs which is separated by space\n" \
- "-r, --runner=RUNNER Run TESTS programs with a test RUNNER.\n" \
- " RUNNDER = gnome or default.\n" \
-@@ -115,6 +117,13 @@ parse_args()
- * ) usage; exit 1;;
- esac
- done
-+ DL='$'
-+ echo "$DESKTOP_COMMAND" | grep "\-with\-dbus$DL" > /dev/null
-+ HAS_DBUS_SUFFIX=$?
-+ if [ $HAS_DBUS_SUFFIX -eq 0 ] ; then
-+ DESKTOP_COMMAND=`echo "$DESKTOP_COMMAND" | sed -e 's/-with-dbus$//'`
-+ DESKTOP_COMMAND="dbus-launch --exit-with-session $DESKTOP_COMMAND"
-+ fi
- }
-
- init_desktop()
-@@ -124,8 +133,9 @@ init_desktop()
- rm $RESULT_LOG
- fi
- fi
-- HAS_STDOUT=`echo "$TEST_LOG" | grep ':stdout'`
-- if [ x"$HAS_STDOUT" != x ] ; then
-+ echo "$TEST_LOG" | grep ':stdout' > /dev/null
-+ HAS_STDOUT=$?
-+ if [ $HAS_STDOUT -eq 0 ] ; then
- TEST_LOG=`echo "$TEST_LOG" | sed -e 's|:stdout||'`
- TEST_LOG_STDOUT=1
- fi
-@@ -203,6 +213,39 @@ run_dbus_daemon()
- export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
- }
-
-+init_gnome()
-+{
-+ # Disable Tour dialog to get focus
-+ V=`gsettings get org.gnome.shell welcome-dialog-last-shown-version`
-+ if [ x"$V" = x ] ; then
-+ gsettings set org.gnome.shell welcome-dialog-last-shown-version '100'
-+ fi
-+ # gnome-shell now starts overview mode by login.
-+ # https://extensions.gnome.org/extension/4099/no-overview/
-+ NO_SYS_DIR=/usr/share/gnome-shell/extensions/no-overview@fthx
-+ NO_USER_DIR=$HOME/.local/share/gnome-shell/extensions/no-overview@fthx
-+ if [ ! -d $NO_SYS_DIR ] && [ ! -d $NO_USER_DIR ] ; then
-+ mkdir -p `dirname $NO_USER_DIR`
-+ cp -R no-overview@fthx `dirname $NO_USER_DIR`
-+ fi
-+ V=`gsettings get org.gnome.shell disable-user-extensions`
-+ if [ x"$V" = x"true" ] ; then
-+ gsettings set org.gnome.shell disable-user-extensions false
-+ fi
-+ V=`gsettings get org.gnome.shell enabled-extensions`
-+ echo "$V" | grep "no-overview" > /dev/null
-+ V2=$?
-+ if [ $V2 -ne 0 ] ; then
-+ V3=`echo "$V" | sed -e 's/\[//' -e 's/\]//'`
-+ if [ x"$V3" = x ] ; then
-+ V4="['no-overview@fthx']"
-+ else
-+ V4="[$V3, 'no-overview@fthx']"
-+ fi
-+ gsettings set org.gnome.shell enabled-extensions "$V4"
-+ fi
-+}
-+
- run_desktop()
- {
- if test $HAVE_GRAPHICS -eq 1 ; then
-@@ -217,8 +260,11 @@ run_desktop()
- $DESKTOP_COMMAND &
- PID_GNOME_SESSION=$!
- sleep 30
-- HAS_GNOME=`echo $DESKTOP_COMMAND | grep gnome-session`
-- if [ x"$HAS_GNOME" = x ] ; then
-+ echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null
-+ HAS_GNOME=$?
-+ if [ $HAS_GNOME -eq 0 ] ; then
-+ init_gnome
-+ else
- ibus-daemon --daemonize --verbose
- sleep 3
- fi
-@@ -360,8 +406,13 @@ EOF_RUNNER
- ;;
- esac
- echo ""
-- print_log -e "${GREEN}PASS${NC}: $pass"
-- print_log -e "${RED}FAIL${NC}: $fail"
-+ # Fedora CI assumes the test is failed even if $fail is 0.
-+ if [ $pass -ne 0 ] ; then
-+ print_log -e "${GREEN}PASS${NC}: $pass"
-+ fi
-+ if [ $fail -ne 0 ] ; then
-+ print_log -e "${RED}FAIL${NC}: $fail"
-+ fi
- echo ""
- if [ $TEST_LOG_STDOUT -eq 1 ] ; then
- cat $TEST_LOG
---
-2.28.0
-
-From d105a3941aad53b0c7470a1e9c1033987b029fb8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 12 May 2021 18:54:30 +0900
-Subject: [PATCH] client/gtk2: Implement
- ibus_im_context_set_surrounding_with_selection()
-
-Selection bounds need to be re-calculated when pre-edit text is
-inserted and the selection position is changed.
-GTK4 has a new API GtkIMContext.set_surrounding_with_selection()
-to fix this issue and now IBus GTK module inherits the API.
-
-BUG=https://github.com/ibus/ibus/issues/2013
----
- client/gtk2/ibusimcontext.c | 53 ++++++++++++++++++++++++++++++-------
- 1 file changed, 44 insertions(+), 9 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index e153081d..61194816 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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2020 Red Hat, Inc.
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2021 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
-@@ -165,11 +165,19 @@ static void ibus_im_context_set_cursor_location
- static void ibus_im_context_set_use_preedit
- (GtkIMContext *context,
- gboolean use_preedit);
-+#if !GTK_CHECK_VERSION (4, 1, 2)
- static void ibus_im_context_set_surrounding
- (GtkIMContext *slave,
- const gchar *text,
-- gint len,
-- gint cursor_index);
-+ int len,
-+ int cursor_index);
-+#endif
-+static void ibus_im_context_set_surrounding_with_selection
-+ (GtkIMContext *slave,
-+ const gchar *text,
-+ int len,
-+ int cursor_index,
-+ int anchor_index);
-
- /* static methods*/
- static void _ibus_context_update_preedit_text_cb
-@@ -724,7 +732,12 @@ ibus_im_context_class_init (IBusIMContextClass *class)
- #endif
- im_context_class->set_cursor_location = ibus_im_context_set_cursor_location;
- im_context_class->set_use_preedit = ibus_im_context_set_use_preedit;
-+#if GTK_CHECK_VERSION (4, 1, 2)
-+ im_context_class->set_surrounding_with_selection
-+ = ibus_im_context_set_surrounding_with_selection;
-+#else
- im_context_class->set_surrounding = ibus_im_context_set_surrounding;
-+#endif
- gobject_class->notify = ibus_im_context_notify;
- gobject_class->finalize = ibus_im_context_finalize;
-
-@@ -1624,8 +1637,22 @@ get_selection_anchor_point (IBusIMContext *ibusimcontext,
- static void
- ibus_im_context_set_surrounding (GtkIMContext *context,
- const gchar *text,
-- gint len,
-- gint cursor_index)
-+ int len,
-+ int cursor_index)
-+{
-+ ibus_im_context_set_surrounding_with_selection (context,
-+ text,
-+ len,
-+ cursor_index,
-+ cursor_index);
-+}
-+
-+static void
-+ibus_im_context_set_surrounding_with_selection (GtkIMContext *context,
-+ const gchar *text,
-+ int len,
-+ int cursor_index,
-+ int anchor_index)
- {
- g_return_if_fail (context != NULL);
- g_return_if_fail (IBUS_IS_IM_CONTEXT (context));
-@@ -1647,18 +1674,26 @@ ibus_im_context_set_surrounding (GtkIMContext *context,
- ibustext = ibus_text_new_from_string (p);
- g_free (p);
-
-- guint anchor_pos = get_selection_anchor_point (ibusimcontext,
-- cursor_pos,
-- utf8_len);
-+ gint anchor_pos = get_selection_anchor_point (ibusimcontext,
-+ cursor_pos,
-+ utf8_len);
- ibus_input_context_set_surrounding_text (ibusimcontext->ibuscontext,
- ibustext,
- cursor_pos,
- anchor_pos);
- }
-+#if GTK_CHECK_VERSION (4, 1, 2)
-+ gtk_im_context_set_surrounding_with_selection (ibusimcontext->slave,
-+ text,
-+ len,
-+ cursor_index,
-+ anchor_index);
-+#else
- gtk_im_context_set_surrounding (ibusimcontext->slave,
- text,
- len,
- cursor_index);
-+#endif
- }
-
- static void
---
-2.28.0
-
-From e9e1642870994abfdbd06b0138524ac231c159b8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 16 Jun 2021 18:00:31 +0900
-Subject: [PATCH] Fix code reviews
-
----
- bus/ibusimpl.c | 23 ++++--
- bus/server.c | 10 +--
- client/gtk2/ibusimcontext.c | 8 ++
- client/wayland/main.c | 9 ++-
- client/x11/main.c | 22 +++--
- conf/dconf/main.c | 7 +-
- portal/portal.c | 7 +-
- setup/ibus-setup.in | 2 +-
- src/emoji-parser.c | 46 ++++++-----
- src/ibusaccelgroup.c | 2 +-
- src/ibusbus.c | 10 ++-
- src/ibuscomposetable.c | 91 ++++++++++++++++++---
- src/ibusemoji.c | 8 +-
- src/ibusenginesimple.c | 21 +++--
- src/ibushotkey.c | 4 +-
- src/ibusregistry.c | 9 ++-
- src/ibusshare.c | 36 +++++----
- src/ibustext.c | 5 +-
- src/ibusunicode.c | 17 +++-
- src/tests/ibus-compose.c | 6 +-
- src/tests/ibus-keypress.c | 3 +-
- src/unicode-parser.c | 52 ++++++------
- util/IMdkit/FrameMgr.c | 34 +++++++-
- util/IMdkit/i18nIc.c | 41 ++++++++--
- util/IMdkit/i18nMethod.c | 24 +++++-
- util/IMdkit/i18nOffsetCache.c | 2 +-
- util/IMdkit/i18nPtHdr.c | 148 ++++++++++++++++++++++++++++------
- util/IMdkit/i18nUtil.c | 20 +++++
- util/IMdkit/i18nX.c | 29 ++++---
- 29 files changed, 524 insertions(+), 172 deletions(-)
-
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index e432e849..49a138fe 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2011-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2020 Red Hat, Inc.
-+ * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2021 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
-@@ -624,7 +624,6 @@ bus_ibus_impl_destroy (BusIBusImpl *ibus)
-
- g_list_foreach (ibus->components, (GFunc) bus_component_stop, NULL);
-
-- pid = 0;
- timeout = 0;
- flag = FALSE;
- while (1) {
-@@ -1190,6 +1189,7 @@ _ibus_get_current_input_context (BusIBusImpl *ibus,
- GDBusConnection *connection,
- GError **error)
- {
-+ GVariant *retval = NULL;
- if (error) {
- *error = NULL;
- }
-@@ -1204,8 +1204,14 @@ _ibus_get_current_input_context (BusIBusImpl *ibus,
- const gchar *path = ibus_service_get_object_path (
- (IBusService *) ibus->focused_context);
- /* the format-string 'o' is for a D-Bus object path. */
-- return g_variant_new_object_path (path);
-+ retval = g_variant_new_object_path (path);
-+ if (!retval) {
-+ g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
-+ "Could not get object path from %s",
-+ path ? path : "(null)");
-+ }
- }
-+ return retval;
- }
-
- static void
-@@ -1572,6 +1578,7 @@ _ibus_get_global_engine (BusIBusImpl *ibus,
- GError **error)
- {
- IBusEngineDesc *desc = NULL;
-+ GVariant *retval = NULL;
-
- if (error) {
- *error = NULL;
-@@ -1592,7 +1599,13 @@ _ibus_get_global_engine (BusIBusImpl *ibus,
- GVariant *variant = ibus_serializable_serialize (
- (IBusSerializable *) desc);
- // Set type "v" for introspection_xml.
-- return g_variant_new_variant (variant);
-+ retval = g_variant_new_variant (variant);
-+ if (!retval) {
-+ g_set_error (error,
-+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
-+ "Failed to serialize engine desc.");
-+ }
-+ return retval;
- } while (0);
-
- g_set_error (error,
-diff --git a/bus/server.c b/bus/server.c
-index 6c9e2c02..e8d0ce2b 100644
---- a/bus/server.c
-+++ b/bus/server.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2019 Red Hat, Inc.
-+ * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2021 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,12 +22,11 @@
- */
- #include "server.h"
-
--#include <errno.h>
- #include <glib/gstdio.h>
- #include <gio/gio.h>
--#include <stdlib.h>
--#include <fcntl.h>
- #include <errno.h>
-+#include <fcntl.h>
-+#include <stdlib.h>
- #include <string.h>
-
- #include "dbusimpl.h"
-@@ -282,6 +281,7 @@ bus_server_init (void)
- * `chmod` runs for the last directory only not to change the modes
- * of the parent directories. E.g. "/tmp/ibus".
- */
-+ errno = 0;
- if (g_mkdir_with_parents (unix_dir, 0700) != 0) {
- g_error ("mkdir is failed in: %s: %s",
- unix_dir, g_strerror (errno));
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index 61194816..e7ce5363 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -385,7 +385,9 @@ _process_key_event_done (GObject *object,
-
- ProcessKeyEventData *data = (ProcessKeyEventData *)user_data;
- GdkEvent *event = data->event;
-+#if GTK_CHECK_VERSION (3, 98, 4)
- IBusIMContext *ibusimcontext = data->ibusimcontext;
-+#endif
- GError *error = NULL;
-
- g_slice_free (ProcessKeyEventData, data);
-@@ -1634,6 +1636,7 @@ get_selection_anchor_point (IBusIMContext *ibusimcontext,
- return anchor;
- }
-
-+#if !GTK_CHECK_VERSION (4, 1, 2)
- static void
- ibus_im_context_set_surrounding (GtkIMContext *context,
- const gchar *text,
-@@ -1646,6 +1649,7 @@ ibus_im_context_set_surrounding (GtkIMContext *context,
- cursor_index,
- cursor_index);
- }
-+#endif
-
- static void
- ibus_im_context_set_surrounding_with_selection (GtkIMContext *context,
-@@ -1851,7 +1855,11 @@ _create_gdk_event (IBusIMContext *ibusimcontext,
- if (event->state & GDK_CONTROL_MASK) {
- if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
- else if (c == '2') {
-+#if GLIB_CHECK_VERSION (2, 68, 0)
-+ event->string = g_memdup2 ("\0\0", 2);
-+#else
- event->string = g_memdup ("\0\0", 2);
-+#endif
- event->length = 1;
- buf[0] = '\0';
- goto out;
-diff --git a/client/wayland/main.c b/client/wayland/main.c
-index d86bab9e..1f99c804 100644
---- a/client/wayland/main.c
-+++ b/client/wayland/main.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2019-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2013 Intel Corporation
- * Copyright (C) 2013-2019 Red Hat, Inc.
- *
-@@ -339,16 +339,19 @@ input_method_keyboard_keymap (void *data,
- {
- IBusWaylandIM *wlim = data;
- GMappedFile *map;
-- GError *error;
-+ GError *error = NULL;
-
- if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
- close(fd);
- return;
- }
-
-- error = NULL;
- map = g_mapped_file_new_from_fd (fd, FALSE, &error);
- if (map == NULL) {
-+ if (error) {
-+ g_warning ("Failed to map file fd %s", error->message);
-+ g_error_free (error);
-+ }
- close (fd);
- return;
- }
-diff --git a/client/x11/main.c b/client/x11/main.c
-index c9ee174d..ffd776fd 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-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2007-2015 Red Hat, Inc.
- *
- * main.c:
-@@ -229,12 +229,13 @@ _xim_preedit_callback_draw (XIMS xims, X11IC *x11ic, const gchar *preedit_string
- }
- }
-
-- for (i = 0; i < len; i++) {
-+ for (i = 0; feedback && i < len; i++) {
- if (feedback[i] == 0) {
- feedback[i] = XIMUnderline;
- }
- }
-- feedback[len] = 0;
-+ if (feedback)
-+ feedback[len] = 0;
-
- pcb.major_code = XIM_PREEDIT_DRAW;
- pcb.connect_id = x11ic->connect_id;
-@@ -736,9 +737,20 @@ xim_get_ic_values (XIMS xims, IMChangeICStruct *call_data)
-
- for (i = 0; i < (int) call_data->ic_attr_num; ++i, ++ic_attr) {
- if (g_strcmp0 (XNFilterEvents, ic_attr->name) == 0) {
-+ /* ic_attr->value will be freed in server side and ignore
-+ * leak of malloc with -Wanalyzer-malloc-leak flags in gcc 11.0.1
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- ic_attr->value = (void *) malloc (sizeof (CARD32));
-- *(CARD32 *) ic_attr->value = KeyPressMask | KeyReleaseMask;
-- ic_attr->value_length = sizeof (CARD32);
-+ if (ic_attr->value) {
-+ *(CARD32 *) ic_attr->value = KeyPressMask | KeyReleaseMask;
-+ ic_attr->value_length = sizeof (CARD32);
-+ } else {
-+ g_warning ("Failed to malloc");
-+ ic_attr->value_length = 0;
-+ }
-+#pragma GCC diagnostic pop
- }
- }
-
-diff --git a/conf/dconf/main.c b/conf/dconf/main.c
-index e6878424..c8250f68 100644
---- a/conf/dconf/main.c
-+++ b/conf/dconf/main.c
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2012-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2021 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
-@@ -70,7 +71,9 @@ main (gint argc, gchar **argv)
- GOptionContext *context;
-
- setlocale (LC_ALL, "");
-- g_setenv ("DCONF_PROFILE", "ibus", FALSE);
-+ errno = 0;
-+ if (!g_setenv ("DCONF_PROFILE", "ibus", FALSE))
-+ g_warning ("Failed setenv %s", strerror (errno));
-
- context = g_option_context_new ("- ibus dconf component");
-
-diff --git a/portal/portal.c b/portal/portal.c
-index e78bc92f..c2e4fc7f 100644
---- a/portal/portal.c
-+++ b/portal/portal.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2017-2019 Red Hat, Inc.
-+ * Copyright (C) 2017-2021 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
-@@ -508,7 +508,6 @@ create_input_context_done (IBusBus *bus,
- if (portal_context == NULL) {
- g_dbus_method_invocation_return_gerror (invocation, error);
- g_error_free (error);
-- g_object_unref (portal_context);
- return;
- }
-
-@@ -656,8 +655,10 @@ main (gint argc, gchar **argv)
- exit (-1);
- }
-
-+ errno = 0;
- /* Avoid even loading gvfs to avoid accidental confusion */
-- g_setenv ("GIO_USE_VFS", "local", TRUE);
-+ if (!g_setenv ("GIO_USE_VFS", "local", TRUE))
-+ g_warning ("Failed setenv %s", strerror (errno));
-
- ibus_init ();
-
-diff --git a/setup/ibus-setup.in b/setup/ibus-setup.in
-index 4a6830af..474ce8a8 100644
---- a/setup/ibus-setup.in
-+++ b/setup/ibus-setup.in
-@@ -27,5 +27,5 @@ export IBUS_PREFIX=@prefix@
- export IBUS_DATAROOTDIR=@datarootdir@
- export IBUS_LOCALEDIR=@localedir@
- export IBUS_LIBEXECDIR=${libexecdir}
--exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py $@
-+exec ${PYTHON:-@PYTHON@} @prefix@/share/ibus/setup/main.py "$@"
-
-diff --git a/src/emoji-parser.c b/src/emoji-parser.c
-index b117b1b4..36d36e05 100644
---- a/src/emoji-parser.c
-+++ b/src/emoji-parser.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2016-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2016-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -291,11 +291,9 @@ emoji_data_new_object (EmojiData *data)
- "annotations",
- data->annotations,
- "description",
-- data->description ? data->description
-- : g_strdup (""),
-+ data->description ? data->description : "",
- "category",
-- data->category ? data->category
-- : g_strdup (""),
-+ data->category ? data->category : "",
- NULL);
- data->list = g_slist_append (data->list, emoji);
- }
-@@ -608,7 +606,7 @@ unicode_emoji_test_parse_line (const gchar *line,
- return FALSE;
- }
- unicode_emoji_test_parse_description (segments[1], data);
-- g_strfreev (segments);
-+ g_clear_pointer (&segments, g_strfreev);
- if (data->annotations == NULL) {
- if (data->subcategory) {
- int i;
-@@ -631,7 +629,7 @@ unicode_emoji_test_parse_line (const gchar *line,
- data->annotations = g_slist_append (data->annotations,
- g_strdup (segments[i]));
- }
-- g_strfreev (segments);
-+ g_clear_pointer (&segments, g_strfreev);
- } else {
- g_warning ("No subcategory line\n");
- goto failed_to_parse_unicode_emoji_test_line;
-@@ -672,7 +670,7 @@ unicode_emoji_test_parse_file (const gchar *filename,
- filename, error ? error->message : "");
- goto failed_to_parse_unicode_emoji_test;
- }
-- head = end = content;
-+ end = content;
- while (*end == '\n' && end - content < length) {
- end++;
- n++;
-@@ -1100,10 +1098,12 @@ static void
- category_list_dump (const gchar *category,
- GString *buff)
- {
-+ gchar *line;
- g_return_if_fail (buff != NULL);
-
-- const gchar *line = g_strdup_printf (" N_(\"%s\"),\n", category);
-+ line = g_strdup_printf (" N_(\"%s\"),\n", category);
- g_string_append (buff, line);
-+ g_free (line);
- }
-
- static void
-@@ -1113,7 +1113,7 @@ category_file_save (const gchar *filename,
- gchar *content = NULL;
- gsize length = 0;
- GError *error = NULL;
-- gchar *p;
-+ gchar *p, *substr;
- GString *buff = NULL;
- int i;
- GSList *list_categories = NULL;
-@@ -1139,24 +1139,28 @@ category_file_save (const gchar *filename,
- break;
- }
- if (p != NULL) {
-- g_string_append (buff, g_strndup (content, p - content));
-+ substr = g_strndup (content, p - content);
-+ g_string_append (buff, substr);
-+ g_free (substr);
- g_string_append_c (buff, '\n');
- }
- g_clear_pointer (&content, g_free);
-
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup_printf ("/* This file is generated by %s. */", __FILE__));
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup ("include <glib/gi18n.h>\n"));
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup ("#ifndef __IBUS_EMOJI_GEN_H_\n"));
-- g_string_append (buff, g_strdup ("#define __IBUS_EMOJI_GEN_H_\n"));
-- g_string_append (buff, g_strdup ("const static char *unicode_emoji_categories[] = {\n"));
-+ g_string_append (buff, "\n");
-+ substr = g_strdup_printf ("/* This file is generated by %s. */", __FILE__);
-+ g_string_append (buff, substr);
-+ g_free (substr);
-+ g_string_append (buff, "\n");
-+ g_string_append (buff, "include <glib/gi18n.h>\n");
-+ g_string_append (buff, "\n");
-+ g_string_append (buff, "#ifndef __IBUS_EMOJI_GEN_H_\n");
-+ g_string_append (buff, "#define __IBUS_EMOJI_GEN_H_\n");
-+ g_string_append (buff, "const static char *unicode_emoji_categories[] = {\n");
- list_categories = g_slist_sort (list_categories, (GCompareFunc)g_strcmp0);
- g_slist_foreach (list_categories, (GFunc)category_list_dump, buff);
- g_slist_free (list_categories);
-- g_string_append (buff, g_strdup ("};\n"));
-- g_string_append (buff, g_strdup ("#endif\n"));
-+ g_string_append (buff, "};\n");
-+ g_string_append (buff, "#endif\n");
-
- if (!g_file_set_contents (filename, buff->str, -1, &error)) {
- g_warning ("Failed to save emoji category file %s: %s", filename, error->message);
-diff --git a/src/ibusaccelgroup.c b/src/ibusaccelgroup.c
-index 8a81597e..ef2d3976 100644
---- a/src/ibusaccelgroup.c
-+++ b/src/ibusaccelgroup.c
-@@ -468,7 +468,7 @@ ibus_accelerator_name (guint accelerator_key,
- if (accelerator_mods & IBUS_SUPER_MASK)
- l += sizeof (text_super) - 1;
-
-- accelerator = g_new (gchar, l + 1);
-+ g_return_val_if_fail ((accelerator = g_new (gchar, l + 1)), NULL);
-
- accelerator_mods = saved_mods;
- l = 0;
-diff --git a/src/ibusbus.c b/src/ibusbus.c
-index b7ffbb47..e9b0bcbb 100644
---- a/src/ibusbus.c
-+++ b/src/ibusbus.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -555,12 +555,18 @@ ibus_bus_init (IBusBus *bus)
-
- path = g_path_get_dirname (ibus_get_socket_path ());
-
-- g_mkdir_with_parents (path, 0700);
-+ errno = 0;
-+ if (g_mkdir_with_parents (path, 0700)) {
-+ g_warning ("Failed to mkdir %s: %s", path, g_strerror (errno));
-+ g_free (path);
-+ return;
-+ }
-
- if (stat (path, &buf) == 0) {
- if (buf.st_uid != getuid ()) {
- g_warning ("The owner of %s is not %s!",
- path, ibus_get_user_name ());
-+ g_free (path);
- return;
- }
- if (buf.st_mode != (S_IFDIR | S_IRWXU)) {
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index ef20469c..685ac717 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* ibus - The Input Bus
- * Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2013-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013-2021 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
-@@ -108,6 +108,7 @@ parse_compose_value (IBusComposeData *compose_data,
- }
- ++head;
- p = head;
-+ end = NULL;
- while ((*p != '\0') && (end = strchr (p, '\"'))) {
- if (*(end - 1) == '\\' && *(end - 2) == '\\')
- break;
-@@ -516,10 +517,10 @@ ibus_compose_hash_get_cache_path (guint32 hash)
- "ibus", "compose", NULL);
- }
- path = g_build_filename (dir, basename, NULL);
-- if (g_mkdir_with_parents (dir, 0755) != 0) {
-- g_warning ("Failed to mkdir %s", dir);
-- g_free (path);
-- path = NULL;
-+ errno = 0;
-+ if (g_mkdir_with_parents (dir, 0755)) {
-+ g_warning ("Failed to mkdir %s: %s", dir, g_strerror (errno));
-+ g_clear_pointer (&path, g_free);
- }
-
- g_free (dir);
-@@ -812,10 +813,14 @@ ibus_compose_table_deserialize (const gchar *contents,
- }
- }
- if (data_length) {
-- retval->priv->data_second = g_new (guint32, data_length);
-- memcpy (retval->priv->data_second,
-- data_32bit_second, data_length * sizeof (guint32));
-- retval->priv->second_size = second_size;
-+ if ((retval->priv->data_second = g_new (guint32, data_length))) {
-+ memcpy (retval->priv->data_second,
-+ data_32bit_second, data_length * sizeof (guint32));
-+ retval->priv->second_size = second_size;
-+ } else {
-+ g_warning ("Failed g_new");
-+ retval->priv->second_size = 0;
-+ }
- }
-
-
-@@ -910,6 +915,43 @@ ibus_compose_table_new_with_list (GList *compose_list,
- int n_index_stride,
- guint32 hash)
- {
-+ /* @ibus_compose_seqs: Include both compose sequence and the value(compose
-+ * output) as the tradition GTK. The value is one character only
-+ * and within 16bit. I.e. All compose sequences and the values
-+ * are 16bit.
-+ * @ibus_compose_seqs_32bit_second: Include the compose values only.
-+ * The length of values by compose sequence is more than one characster
-+ * or one of the values is outside 16bit but within 32bit.
-+ * Some values could be more than one character and Emoji character
-+ * could be outside 16bit.
-+ * See also ibus/src/tests/ibus-compose.emoji file for e.g.
-+ * @ibus_compose_seqs_32bit_first: Include the compose sequence only in
-+ * case the value is included in @ibus_compose_seqs_32bit_second.
-+ * @s_size_total: The number of compose sequences.
-+ * @s_size_16bit: The number of compose sequences whose value is one
-+ * character only and within 16bit. I.e. the number of the compose
-+ * sequence in @ibus_compose_seqs is @@s_size_16bit. And
-+ * @s_size_total - @s_size_16bit is the number of the compose sequence
-+ * in @ibus_compose_seqs_32bit_first.
-+ * @v_size_32bit: The total number of compose values. Each length of the
-+ * values is more than one character or one of the value is
-+ * outside 16bit but within 32bit. I.e. The size of
-+ * @ibus_compose_seqs_32bit_second is @v_size_32bit.
-+ * @v_index_32bit: Each index of the compose values in
-+ * @ibus_compose_seqs_32bit_second and this is not a fixed value in
-+ * this API. If a compose sequence is found in
-+ * @ibus_compose_seqs_32bit_first and the next value is 0, 0 is lined
-+ * in @ibus_compose_seqs_32bit_first until @max_compose_len after
-+ * the found compose sequence. And the next value is the length of
-+ * the compose values and the next value is the @v_index_32bit, i.e.
-+ * the index of @ibus_compose_seqs_32bit_second.
-+ * E.g. the following line could be found in
-+ * @ibus_compose_seqs_32bit_first:
-+ * ..., "U17ff", "0", "0", "0", "0", 2, 100, ...
-+ * @ibus_compose_seqs_32bit_second[100] is "ាំ" and the character
-+ * length is 2.
-+ * @max_compose_len is 5 and @n_index_stride is 7.
-+ */
- gsize s_size_total, s_size_16bit, v_size_32bit, v_index_32bit;
- guint n = 0, m = 0;
- int i, j;
-@@ -935,13 +977,25 @@ ibus_compose_table_new_with_list (GList *compose_list,
- }
- }
-
-- if (s_size_16bit)
-+ if (s_size_16bit) {
- ibus_compose_seqs = g_new (guint16, s_size_16bit * n_index_stride);
-+ if (!ibus_compose_seqs) {
-+ g_warning ("Failed g_new");
-+ return NULL;
-+ }
-+ }
- if (s_size_total > s_size_16bit) {
- ibus_compose_seqs_32bit_first =
- g_new (guint16,
- (s_size_total - s_size_16bit) * n_index_stride);
- ibus_compose_seqs_32bit_second = g_new (guint32, v_size_32bit);
-+ if (!ibus_compose_seqs_32bit_first || !ibus_compose_seqs_32bit_second) {
-+ g_warning ("Failed g_new");
-+ g_free (ibus_compose_seqs);
-+ g_free (ibus_compose_seqs_32bit_first);
-+ g_free (ibus_compose_seqs_32bit_second);
-+ return NULL;
-+ }
- }
-
- v_index_32bit = 0;
-@@ -951,32 +1005,45 @@ ibus_compose_table_new_with_list (GList *compose_list,
-
- is_32bit = unichar_length (compose_data->values) > 1 ? TRUE :
- compose_data->values[0] >= 0xFFFF ? TRUE : FALSE;
-+ if (is_32bit) {
-+ g_assert (ibus_compose_seqs_32bit_first);
-+ g_assert (ibus_compose_seqs_32bit_second);
-+ }
- for (i = 0; i < max_compose_len; i++) {
- if (compose_data->sequence[i] == 0) {
- for (j = i; j < max_compose_len; j++) {
-- if (is_32bit)
-+ if (is_32bit) {
-+ g_assert (m < (s_size_total - s_size_16bit)
-+ * n_index_stride);
- ibus_compose_seqs_32bit_first[m++] = 0;
-- else
-+ } else {
-+ g_assert (n < s_size_16bit * n_index_stride);
- ibus_compose_seqs[n++] = 0;
-+ }
- }
- break;
- }
- if (is_32bit) {
-+ g_assert (m < (s_size_total - s_size_16bit) * n_index_stride);
- ibus_compose_seqs_32bit_first[m++] =
- (guint16) compose_data->sequence[i];
- } else {
-+ g_assert (n < s_size_16bit * n_index_stride);
- ibus_compose_seqs[n++] = (guint16) compose_data->sequence[i];
- }
- }
- if (is_32bit) {
- for (j = 0; compose_data->values[j]; j++) {
-+ g_assert (v_index_32bit + j < v_size_32bit);
- ibus_compose_seqs_32bit_second[v_index_32bit + j] =
- compose_data->values[j];
- }
-+ g_assert (m + 1 < (s_size_total - s_size_16bit) * n_index_stride);
- ibus_compose_seqs_32bit_first[m++] = j;
- ibus_compose_seqs_32bit_first[m++] = v_index_32bit;
- v_index_32bit += j;
- } else {
-+ g_assert (n + 1 < s_size_16bit * n_index_stride);
- ibus_compose_seqs[n++] = (guint16) compose_data->values[0];
- ibus_compose_seqs[n++] = 0;
- }
-diff --git a/src/ibusemoji.c b/src/ibusemoji.c
-index ae8907a2..df97264b 100644
---- a/src/ibusemoji.c
-+++ b/src/ibusemoji.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2017-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2017-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -497,7 +497,11 @@ ibus_emoji_data_save (const gchar *path,
-
- dir = g_path_get_dirname (path);
- if (g_strcmp0 (dir, ".") != 0 && g_stat (dir, &buf) != 0) {
-- g_mkdir_with_parents (dir, 0777);
-+ errno = 0;
-+ if (g_mkdir_with_parents (dir, 0777)) {
-+ g_warning ("Failed mkdir %s: %s", dir, g_strerror (errno));
-+ return;
-+ }
- }
- g_free (dir);
- if (!g_file_set_contents (path, contents, length, &error)) {
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 43bd5283..6dbc39c7 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2014-2017 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -466,11 +466,15 @@ check_hex (IBusEngineSimple *simple,
-
- ch = ibus_keyval_to_unicode (priv->compose_buffer[i]);
-
-- if (ch == 0)
-+ if (ch == 0) {
-+ g_string_free (str, TRUE);
- return FALSE;
-+ }
-
-- if (!g_unichar_isxdigit (ch))
-+ if (!g_unichar_isxdigit (ch)) {
-+ g_string_free (str, TRUE);
- return FALSE;
-+ }
-
- buf[g_unichar_to_utf8 (ch, buf)] = '\0';
-
-@@ -487,8 +491,9 @@ check_hex (IBusEngineSimple *simple,
- if (nptr - str->str < str->len) {
- g_string_free (str, TRUE);
- return FALSE;
-- } else
-+ } else {
- g_string_free (str, TRUE);
-+ }
-
- if (g_unichar_validate (n)) {
- priv->tentative_match = n;
-@@ -559,11 +564,15 @@ check_emoji_table (IBusEngineSimple *simple,
-
- ch = ibus_keyval_to_unicode (priv->compose_buffer[i]);
-
-- if (ch == 0)
-+ if (ch == 0) {
-+ g_string_free (str, TRUE);
- return FALSE;
-+ }
-
-- if (!g_unichar_isprint (ch))
-+ if (!g_unichar_isprint (ch)) {
-+ g_string_free (str, TRUE);
- return FALSE;
-+ }
-
- buf[g_unichar_to_utf8 (ch, buf)] = '\0';
-
-diff --git a/src/ibushotkey.c b/src/ibushotkey.c
-index d4ab7c23..e72b8305 100644
---- a/src/ibushotkey.c
-+++ b/src/ibushotkey.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -373,6 +373,8 @@ ibus_hotkey_profile_add_hotkey (IBusHotkeyProfile *profile,
- p->event = event;
- }
-
-+ if (!p)
-+ return FALSE;
- p->hotkeys = g_list_append (p->hotkeys, hotkey);
-
- return TRUE;
-diff --git a/src/ibusregistry.c b/src/ibusregistry.c
-index 3386a5d1..23c5ca1b 100644
---- a/src/ibusregistry.c
-+++ b/src/ibusregistry.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2015-2020 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -438,7 +438,12 @@ ibus_registry_save_cache_file (IBusRegistry *registry,
- g_assert (filename != NULL);
-
- cachedir = g_path_get_dirname (filename);
-- g_mkdir_with_parents (cachedir, 0775);
-+ errno = 0;
-+ if (g_mkdir_with_parents (cachedir, 0775)) {
-+ g_warning ("Failed to mkdir %s: %s", cachedir, g_strerror (errno));
-+ g_free (cachedir);
-+ return FALSE;
-+ }
- g_free (cachedir);
-
- variant = ibus_serializable_serialize (IBUS_SERIALIZABLE (registry));
-diff --git a/src/ibusshare.c b/src/ibusshare.c
-index e0ef2ce0..8974511a 100644
---- a/src/ibusshare.c
-+++ b/src/ibusshare.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2018 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -197,22 +197,17 @@ ibus_get_address (void)
- FILE *pf;
-
- /* free address */
-- if (address != NULL) {
-- g_free (address);
-- address = NULL;
-- }
-+ g_clear_pointer (&address, g_free);
-
- /* get address from env variable */
- address = g_strdup (g_getenv ("IBUS_ADDRESS"));
-- if (address) {
-+ if (address)
- return address;
-- }
-
- /* read address from ~/.config/ibus/bus/soketfile */
- pf = fopen (ibus_get_socket_path (), "r");
-- if (pf == NULL) {
-+ if (pf == NULL)
- return NULL;
-- }
-
- while (!feof (pf)) {
- gchar *p = buffer;
-@@ -224,11 +219,12 @@ ibus_get_address (void)
- continue;
- /* parse IBUS_ADDRESS */
- if (strncmp (p, "IBUS_ADDRESS=", sizeof ("IBUS_ADDRESS=") - 1) == 0) {
-- address = p + sizeof ("IBUS_ADDRESS=") - 1;
-- for (p = (gchar *)address; *p != '\n' && *p != '\0'; p++);
-+ gchar *head = p + sizeof ("IBUS_ADDRESS=") - 1;
-+ for (p = head; *p != '\n' && *p != '\0'; p++);
- if (*p == '\n')
- *p = '\0';
-- address = g_strdup (address);
-+ g_free (address);
-+ address = g_strdup (head);
- continue;
- }
-
-@@ -241,9 +237,8 @@ ibus_get_address (void)
- }
- fclose (pf);
-
-- if (pid == -1 || kill (pid, 0) != 0) {
-+ if (pid == -1 || kill (pid, 0) != 0)
- return NULL;
-- }
-
- return address;
- }
-@@ -256,10 +251,19 @@ ibus_write_address (const gchar *address)
- g_return_if_fail (address != NULL);
-
- path = g_path_get_dirname (ibus_get_socket_path ());
-- g_mkdir_with_parents (path, 0700);
-+ errno = 0;
-+ if (g_mkdir_with_parents (path, 0700)) {
-+ g_warning ("Failed to mkdir %s: %s", path, g_strerror (errno));
-+ g_free (path);
-+ return;
-+ }
- g_free (path);
-
-- g_unlink (ibus_get_socket_path ());
-+ errno = 0;
-+ if (g_unlink (ibus_get_socket_path ())) {
-+ g_warning ("Failed to unlink %s: %s",
-+ ibus_get_socket_path (), g_strerror (errno));
-+ }
- pf = fopen (ibus_get_socket_path (), "w");
- g_return_if_fail (pf != NULL);
-
-diff --git a/src/ibustext.c b/src/ibustext.c
-index a5e3c43b..ed0fe666 100644
---- a/src/ibustext.c
-+++ b/src/ibustext.c
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2021 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
-@@ -220,7 +221,7 @@ ibus_text_new_from_unichar (gunichar c)
- text= g_object_new (IBUS_TYPE_TEXT, NULL);
-
- text->is_static = FALSE;
-- text->text = (gchar *)g_malloc (12);
-+ g_return_val_if_fail ((text->text = (gchar *)g_malloc (12)), NULL);
- len = g_unichar_to_utf8 (c, text->text);
- text->text[len] = 0;
-
-diff --git a/src/ibusunicode.c b/src/ibusunicode.c
-index 9e6f6b2b..f7a897d1 100644
---- a/src/ibusunicode.c
-+++ b/src/ibusunicode.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2018-2019 Red Hat, Inc.
-+ * Copyright (C) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2021 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
-@@ -472,7 +472,12 @@ ibus_unicode_data_save (const gchar *path,
-
- dir = g_path_get_dirname (path);
- if (g_strcmp0 (dir, ".") != 0 && g_stat (dir, &buf) != 0) {
-- g_mkdir_with_parents (dir, 0777);
-+ errno = 0;
-+ if (g_mkdir_with_parents (dir, 0777)) {
-+ g_warning ("Failed to mkdir %s: %s", dir, g_strerror (errno));
-+ return;
-+ }
-+
- }
- g_free (dir);
- if (!g_file_set_contents (path, contents, length, &error)) {
-@@ -967,7 +972,11 @@ ibus_unicode_block_save (const gchar *path,
-
- dir = g_path_get_dirname (path);
- if (g_strcmp0 (dir, ".") != 0 && g_stat (dir, &buf) != 0) {
-- g_mkdir_with_parents (dir, 0777);
-+ errno = 0;
-+ if (g_mkdir_with_parents (dir, 0777)) {
-+ g_warning ("Failed to mkdir %s: %s", dir, g_strerror (errno));
-+ return;
-+ }
- }
- g_free (dir);
- if (!g_file_set_contents (path, contents, length, &error)) {
-diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c
-index 4b4c56e7..81bfc69b 100644
---- a/src/tests/ibus-compose.c
-+++ b/src/tests/ibus-compose.c
-@@ -360,11 +360,13 @@ main (int argc, char *argv[])
- /* Avoid a warning of "AT-SPI: Could not obtain desktop path or name"
- * with gtk_main().
- */
-- g_setenv ("NO_AT_BRIDGE", "1", TRUE);
-+ if (!g_setenv ("NO_AT_BRIDGE", "1", TRUE))
-+ g_message ("Failed setenv NO_AT_BRIDGE\n");
- g_test_init (&argc, &argv, NULL);
- gtk_init (&argc, &argv);
-
-- m_srcdir = argc > 1 ? g_strdup (argv[1]) : g_strdup (".");
-+ m_srcdir = (argc > 1 && strlen (argv[1]) < FILENAME_MAX)
-+ ? g_strdup (argv[1]) : g_strdup (".");
- m_compose_file = g_strdup (g_getenv ("COMPOSE_FILE"));
- #if GLIB_CHECK_VERSION (2, 58, 0)
- test_name = g_get_language_names_with_category ("LC_CTYPE")[0];
-diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c
-index dd1b0042..bab05398 100644
---- a/src/tests/ibus-keypress.c
-+++ b/src/tests/ibus-keypress.c
-@@ -291,7 +291,8 @@ main (int argc, char *argv[])
- /* Avoid a warning of "AT-SPI: Could not obtain desktop path or name"
- * with gtk_main().
- */
-- g_setenv ("NO_AT_BRIDGE", "1", TRUE);
-+ if (!g_setenv ("NO_AT_BRIDGE", "1", TRUE))
-+ g_message ("Failed setenv NO_AT_BRIDGE\n");
- g_test_init (&argc, &argv, NULL);
- gtk_init (&argc, &argv);
-
-diff --git a/src/unicode-parser.c b/src/unicode-parser.c
-index b4303ea8..2c4eb677 100644
---- a/src/unicode-parser.c
-+++ b/src/unicode-parser.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2021 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
-@@ -76,11 +76,9 @@ unicode_data_new_object (UnicodeData *data)
- ibus_unicode_data_new ("code",
- data->code,
- "name",
-- data->name ? g_strdup (data->name)
-- : g_strdup (""),
-+ data->name ? data->name : "",
- "alias",
-- data->alias ? g_strdup (data->alias)
-- : g_strdup (""),
-+ data->alias ? data->alias : "",
- NULL);
- data->list = g_slist_append (data->list, unicode);
- }
-@@ -98,8 +96,7 @@ unicode_block_new_object (UnicodeData *data)
- "end",
- data->end,
- "name",
-- data->name ? g_strdup (data->name)
-- : g_strdup (""),
-+ data->name ? data->name : "",
- NULL);
- data->list = g_slist_append (data->list, block);
- }
-@@ -285,7 +282,7 @@ ucd_parse_file (const gchar *filename,
- filename, error ? error->message : "");
- goto failed_to_parse_ucd_names_list;
- }
-- head = end = content;
-+ end = content;
- while (*end == '\n' && end - content < length) {
- end++;
- n++;
-@@ -352,6 +349,7 @@ static void
- block_list_dump (IBusUnicodeBlock *block,
- GString *buff)
- {
-+ gchar *line;
- g_return_if_fail (buff != NULL);
-
- g_string_append (buff, " /* TRANSLATORS: You might refer the " \
-@@ -359,9 +357,10 @@ block_list_dump (IBusUnicodeBlock *block,
- " the following command:\n" \
- " msgmerge -C gucharmap.po ibus.po " \
- "ibus.pot */\n");
-- gchar *line = g_strdup_printf (" N_(\"%s\"),\n",
-- ibus_unicode_block_get_name (block));
-+ line = g_strdup_printf (" N_(\"%s\"),\n",
-+ ibus_unicode_block_get_name (block));
- g_string_append (buff, line);
-+ g_free (line);
- }
-
- static void
-@@ -371,7 +370,7 @@ ucd_block_translatable_save (const gchar *filename,
- gchar *content = NULL;
- gsize length = 0;
- GError *error = NULL;
-- gchar *p;
-+ gchar *p, *substr;
- GString *buff = NULL;
- int i;
- GSList *list = blocks_list;
-@@ -392,25 +391,30 @@ ucd_block_translatable_save (const gchar *filename,
- break;
- }
- if (p != NULL) {
-- g_string_append (buff, g_strndup (content, p - content));
-+ substr = g_strndup (content, p - content);
-+ g_string_append (buff, substr);
-+ g_free (substr);
- g_string_append_c (buff, '\n');
- }
- g_clear_pointer (&content, g_free);
-
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup_printf ("/* This file is generated by %s. */", __FILE__));
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup ("include <glib/gi18n.h>\n"));
-- g_string_append (buff, g_strdup ("\n"));
-- g_string_append (buff, g_strdup ("#ifndef __IBUS_UNICODE_GEN_H_\n"));
-- g_string_append (buff, g_strdup ("#define __IBUS_UNICODE_GEN_H_\n"));
-- g_string_append (buff, g_strdup ("const static char *unicode_blocks[] = {\n"));
-+ g_string_append (buff, "\n");
-+ substr = g_strdup_printf ("/* This file is generated by %s. */", __FILE__);
-+ g_string_append (buff, substr);
-+ g_free (substr);
-+ g_string_append (buff, "\n");
-+ g_string_append (buff, "include <glib/gi18n.h>\n");
-+ g_string_append (buff, "\n");
-+ g_string_append (buff, "#ifndef __IBUS_UNICODE_GEN_H_\n");
-+ g_string_append (buff, "#define __IBUS_UNICODE_GEN_H_\n");
-+ g_string_append (buff, "const static char *unicode_blocks[] = {\n");
- g_slist_foreach (list, (GFunc)block_list_dump, buff);
-- g_string_append (buff, g_strdup ("};\n"));
-- g_string_append (buff, g_strdup ("#endif\n"));
-+ g_string_append (buff, "};\n");
-+ g_string_append (buff, "#endif\n");
-
- if (!g_file_set_contents (filename, buff->str, -1, &error)) {
-- g_warning ("Failed to save emoji category file %s: %s", filename, error->message);
-+ g_warning ("Failed to save emoji category file %s: %s",
-+ filename, error->message);
- g_error_free (error);
- }
-
-diff --git a/util/IMdkit/FrameMgr.c b/util/IMdkit/FrameMgr.c
-index 0e91b78e..80d019a0 100644
---- a/util/IMdkit/FrameMgr.c
-+++ b/util/IMdkit/FrameMgr.c
-@@ -851,7 +851,7 @@ static Bool _FrameMgrProcessPadding (FrameMgr fm, FmStatus* status)
- return True;
- }
- /*endif*/
-- next_type = FrameInstGetNextType (fm->fi, &info);
-+ FrameInstGetNextType (fm->fi, &info);
- fm->idx += info.num;
- if ((fitr = _FrameIterCounterIncr (fm->iters, info.num)))
- _FrameMgrRemoveIter (fm, fitr);
-@@ -1525,6 +1525,11 @@ static Iter IterInit (XimFrame frame, int count)
- register XimFrameType type;
-
- it = (Iter) Xmalloc (sizeof (IterRec));
-+ if (!it) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return NULL;
-+ }
- it->template = frame;
- it->max_count = (count == NO_VALUE) ? 0 : count;
- it->allow_expansion = (count == NO_VALUE);
-@@ -1669,8 +1674,15 @@ static Bool IterIsLoopEnd (Iter it, Bool *myself)
-
- static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
- {
-- XimFrameType type = it->template->type;
-+ XimFrameType type;
-+
-+ if (!it || !it->template) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return (XimFrameType) NULL;
-+ }
-
-+ type = it->template->type;
- if (it->start_counter)
- {
- (*it->start_watch_proc) (it, it->client_data);
-@@ -1766,7 +1778,15 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
-
- static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info)
- {
-- XimFrameType type = it->template->type;
-+ XimFrameType type;
-+
-+ if (!it->template) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: dereference pointer %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return (XimFrameType) NULL;
-+ }
-+
-+ type = it->template->type;
-
- if (!it->allow_expansion && it->cur_no >= it->max_count)
- return (EOL);
-@@ -1866,6 +1886,9 @@ static FmStatus IterSetSize (Iter it, int num)
- dr.num = NO_VALUE;
- d = ChainMgrSetData (&it->cm, i, dr);
- }
-+ if (!d) {
-+ return FmNoMoreData;
-+ }
- /*endif*/
- if (d->num == NO_VALUE)
- {
-@@ -2254,6 +2277,11 @@ static ExtraData ChainMgrSetData (ChainMgr cm,
- ExtraDataRec data)
- {
- Chain cur = (Chain) Xmalloc (sizeof (ChainRec));
-+ if (!cur) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return NULL;
-+ }
-
- cur->frame_no = frame_no;
- cur->d = data;
-diff --git a/util/IMdkit/i18nIc.c b/util/IMdkit/i18nIc.c
-index 289837a6..14a3dc51 100644
---- a/util/IMdkit/i18nIc.c
-+++ b/util/IMdkit/i18nIc.c
-@@ -470,13 +470,16 @@ static XICAttribute *CreateNestedList (CARD16 attr_id,
- /*endfor*/
-
- nest_list = (XICAttribute *) malloc (sizeof (XICAttribute));
-- if (nest_list == NULL)
-+ if (nest_list == NULL) {
-+ XFree (values);
- return NULL;
-+ }
- /*endif*/
- memset (nest_list, 0, sizeof (XICAttribute));
- nest_list->value = (void *) malloc (value_length);
- if (nest_list->value == NULL) {
- XFree (nest_list);
-+ XFree (values);
- return NULL;
- }
- /*endif*/
-@@ -539,7 +542,13 @@ static int GetICValue (Xi18n i18n_core,
- attr_ret[n].attribute_id = xic_attr[j].attribute_id;
- attr_ret[n].name_length = xic_attr[j].length;
- attr_ret[n].name = malloc (xic_attr[j].length + 1);
-- strcpy(attr_ret[n].name, xic_attr[j].name);
-+ if (!attr_ret[n].name) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strcpy(attr_ret[n].name, xic_attr[j].name);
-+ }
- attr_ret[n].type = xic_attr[j].type;
- n++;
- i++;
-@@ -560,7 +569,13 @@ static int GetICValue (Xi18n i18n_core,
- attr_ret[n].attribute_id = xic_attr[j].attribute_id;
- attr_ret[n].name_length = xic_attr[j].length;
- attr_ret[n].name = malloc (xic_attr[j].length + 1);
-- strcpy(attr_ret[n].name, xic_attr[j].name);
-+ if (!attr_ret[n].name) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strcpy(attr_ret[n].name, xic_attr[j].name);
-+ }
- attr_ret[n].type = xic_attr[j].type;
- n++;
- break;
-@@ -700,10 +715,15 @@ void _Xi18nChangeIC (XIMS ims,
- attrib_list[attrib_num].value_length = value_length;
- FrameMgrGetToken (fm, value);
- attrib_list[attrib_num].value = (void *) malloc (value_length + 1);
-- memmove (attrib_list[attrib_num].value, value, value_length);
-- ((char *)attrib_list[attrib_num].value)[value_length] = '\0';
-+ if (!attrib_list[attrib_num].value) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ memmove (attrib_list[attrib_num].value, value, value_length);
-+ ((char *)attrib_list[attrib_num].value)[value_length] = '\0';
-+ total_value_length += (value_length + 1);
-+ }
- attrib_num++;
-- total_value_length += (value_length + 1);
- }
- /*endwhile*/
-
-@@ -917,6 +937,12 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p)
- FrameMgrGetToken (fm, byte_length);
-
- attrID_list = (CARD16 *) malloc (sizeof (CARD16)*IC_SIZE); /* bogus */
-+ if (!attrID_list) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ FrameMgrFree (fm);
-+ return;
-+ }
- memset (attrID_list, 0, sizeof (CARD16)*IC_SIZE);
-
- number = 0;
-@@ -1026,7 +1052,7 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p)
- {
- _Xi18nSendMessage (ims, connect_id, XIM_ERROR, 0, 0, 0);
- XFree (attrID_list);
-- FrameMgrFree (fm);
-+ goto _Xi18nGetIC_finit;
- return;
- }
- /*endif*/
-@@ -1097,6 +1123,7 @@ void _Xi18nGetIC (XIMS ims, IMProtocol *call_data, unsigned char *p)
- }
- /*endfor*/
-
-+_Xi18nGetIC_finit:
- if (preedit_ret)
- {
- XFree (preedit_ret->value);
-diff --git a/util/IMdkit/i18nMethod.c b/util/IMdkit/i18nMethod.c
-index 36dd28ac..9c44e7fe 100644
---- a/util/IMdkit/i18nMethod.c
-+++ b/util/IMdkit/i18nMethod.c
-@@ -166,8 +166,14 @@ static Bool GetEncodings(Xi18n i18n_core, XIMEncodings **p_encoding)
- {
- (*p_encoding)->supported_encodings[i]
- = (char *) malloc (strlen (p->supported_encodings[i]) + 1);
-- strcpy ((*p_encoding)->supported_encodings[i],
-- p->supported_encodings[i]);
-+ if (!((*p_encoding)->supported_encodings[i])) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+
-+ } else {
-+ strcpy ((*p_encoding)->supported_encodings[i],
-+ p->supported_encodings[i]);
-+ }
- }
- /*endif*/
- return True;
-@@ -187,11 +193,17 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_LOCALE)
- return IMLocale;
- /*endif*/
-+ /* address->im_locale will be released later and don't need
-+ * -Wanalyzer-malloc-leak flag in gcc 11.0.1.
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- address->im_locale = (char *) malloc (strlen (p->value) + 1);
- if (!address->im_locale)
- return IMLocale;
- /*endif*/
- strcpy (address->im_locale, p->value);
-+#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_LOCALE;
- }
- else if (strcmp (p->name, IMServerTransport) == 0)
-@@ -199,11 +211,14 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_ADDRESS)
- return IMServerTransport;
- /*endif*/
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- address->im_addr = (char *) malloc (strlen (p->value) + 1);
- if (!address->im_addr)
- return IMServerTransport;
- /*endif*/
- strcpy(address->im_addr, p->value);
-+#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_ADDRESS;
- }
- else if (strcmp (p->name, IMServerName) == 0)
-@@ -211,11 +226,14 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_NAME)
- return IMServerName;
- /*endif*/
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- address->im_name = (char *) malloc (strlen (p->value) + 1);
- if (!address->im_name)
- return IMServerName;
- /*endif*/
- strcpy (address->im_name, p->value);
-+#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_NAME;
- }
- else if (strcmp (p->name, IMServerWindow) == 0)
-@@ -698,7 +716,7 @@ static void ReturnSelectionNotify (Xi18n i18n_core, XSelectionRequestEvent *ev)
- {
- XEvent event;
- Display *dpy = i18n_core->address.dpy;
-- char buf[4096];
-+ char buf[4096] = { '\0', };
-
- event.type = SelectionNotify;
- event.xselection.requestor = ev->requestor;
-diff --git a/util/IMdkit/i18nOffsetCache.c b/util/IMdkit/i18nOffsetCache.c
-index d5379051..e2fe8c6b 100644
---- a/util/IMdkit/i18nOffsetCache.c
-+++ b/util/IMdkit/i18nOffsetCache.c
-@@ -94,7 +94,7 @@ void _Xi18nSetPropertyOffset (Xi18nOffsetCache *offset_cache, Atom key,
- }
-
- assert (data != NULL);
-- if (offset_cache->size > 0) {
-+ if (offset_cache->size > 0 && i < offset_cache->capacity) {
- data[i].key = key;
- data[i].offset = offset;
- }
-diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c
-index eaeeee1c..8dc52714 100644
---- a/util/IMdkit/i18nPtHdr.c
-+++ b/util/IMdkit/i18nPtHdr.c
-@@ -181,8 +181,13 @@ static void OpenMessageProc(XIMS ims, IMProtocol *call_data, unsigned char *p)
- FrameMgrGetToken (fm, name);
- imopen->lang.length = str_length;
- imopen->lang.name = malloc (str_length + 1);
-- strncpy (imopen->lang.name, name, str_length);
-- imopen->lang.name[str_length] = (char) 0;
-+ if (!imopen->lang.name) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strncpy (imopen->lang.name, name, str_length);
-+ imopen->lang.name[str_length] = (char) 0;
-+ }
-
- FrameMgrFree (fm);
-
-@@ -339,7 +344,7 @@ static XIMExt *MakeExtensionList (Xi18n i18n_core,
- int number,
- int *reply_number)
- {
-- XIMExt *ext_list;
-+ XIMExt *ext_list = NULL;
- XIMExt *im_ext = (XIMExt *) i18n_core->address.extension;
- int im_ext_len = i18n_core->address.ext_num;
- int i;
-@@ -358,7 +363,8 @@ static XIMExt *MakeExtensionList (Xi18n i18n_core,
- {
- for (j = 0; j < (int) number; j++)
- {
-- if (strcmp (lib_extension[j].name, im_ext[i].name) == 0)
-+ if (lib_extension[j].name
-+ && strcmp (lib_extension[j].name, im_ext[i].name) == 0)
- {
- (*reply_number)++;
- break;
-@@ -389,7 +395,13 @@ static XIMExt *MakeExtensionList (Xi18n i18n_core,
- ext_list[i].minor_opcode = im_ext[i].minor_opcode;
- ext_list[i].length = im_ext[i].length;
- ext_list[i].name = malloc (im_ext[i].length + 1);
-- strcpy (ext_list[i].name, im_ext[i].name);
-+ if (!ext_list[i].name) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strcpy (ext_list[i].name, im_ext[i].name);
-+ }
- }
- /*endfor*/
- }
-@@ -401,13 +413,20 @@ static XIMExt *MakeExtensionList (Xi18n i18n_core,
- {
- for (j = 0; j < (int)number; j++)
- {
-- if (strcmp (lib_extension[j].name, im_ext[i].name) == 0)
-+ if (lib_extension[j].name
-+ && strcmp (lib_extension[j].name, im_ext[i].name) == 0)
- {
- ext_list[n].major_opcode = im_ext[i].major_opcode;
- ext_list[n].minor_opcode = im_ext[i].minor_opcode;
- ext_list[n].length = im_ext[i].length;
- ext_list[n].name = malloc (im_ext[i].length + 1);
-- strcpy (ext_list[n].name, im_ext[i].name);
-+ if (!ext_list[n].name) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strcpy (ext_list[n].name, im_ext[i].name);
-+ }
- n++;
- break;
- }
-@@ -450,6 +469,11 @@ static void QueryExtensionMessageProc (XIMS ims,
- FrameMgrGetToken (fm, input_method_ID);
- FrameMgrGetToken (fm, byte_length);
- query_ext->extension = (XIMStr *) malloc (sizeof (XIMStr)*10);
-+ if (!query_ext->extension) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return;
-+ }
- memset (query_ext->extension, 0, sizeof (XIMStr)*10);
- number = 0;
- while (FrameMgrIsIterLoopEnd (fm, &status) == False)
-@@ -461,9 +485,20 @@ static void QueryExtensionMessageProc (XIMS ims,
- FrameMgrSetSize (fm, str_length);
- query_ext->extension[number].length = str_length;
- FrameMgrGetToken (fm, name);
-+ /* I don't know why extension[number].name is detected as leak
-+ * with -Wanalyzer-malloc-leak option in gcc 11.0.1.
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- query_ext->extension[number].name = malloc (str_length + 1);
-- strncpy (query_ext->extension[number].name, name, str_length);
-- query_ext->extension[number].name[str_length] = (char) 0;
-+ if (!query_ext->extension[number].name) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ strncpy (query_ext->extension[number].name, name, str_length);
-+ query_ext->extension[number].name[str_length] = (char) 0;
-+ }
-+#pragma GCC diagnostic pop
- number++;
- }
- /*endwhile*/
-@@ -490,6 +525,8 @@ static void QueryExtensionMessageProc (XIMS ims,
- XFree (query_ext->extension[i].name);
- /*endfor*/
- XFree (query_ext->extension);
-+ if (!ext_list)
-+ return;
-
- fm = FrameMgrInit (query_extension_reply_fr,
- NULL,
-@@ -501,7 +538,10 @@ static void QueryExtensionMessageProc (XIMS ims,
- /* set length of BARRAY item in ext_fr */
- for (i = 0; i < reply_number; i++)
- {
-- str_size = strlen (ext_list[i].name);
-+ if (ext_list[i].name)
-+ str_size = strlen (ext_list[i].name);
-+ else
-+ str_size = 0;
- FrameMgrSetSize (fm, str_size);
- }
- /*endfor*/
-@@ -700,7 +740,13 @@ static XIMAttribute *MakeIMAttributeList (Xi18n i18n_core,
- &value_length);
- attrib_list[list_num].value_length = value_length;
- attrib_list[list_num].value = (void *) malloc (value_length);
-- memset(attrib_list[list_num].value, 0, value_length);
-+ if (attrib_list[list_num].value) {
-+ memset(attrib_list[list_num].value, 0, value_length);
-+ } else {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ }
- GetIMValueFromName (i18n_core,
- connect_id,
- attrib_list[list_num].value,
-@@ -737,10 +783,10 @@ static void GetIMValuesMessageProc (XIMS ims,
- register int i;
- register int j;
- int number;
-- CARD16 *im_attrID_list;
-- char **name_list;
-+ CARD16 *im_attrID_list = NULL;
-+ char **name_list = NULL;
- CARD16 name_number;
-- XIMAttribute *im_attribute_list;
-+ XIMAttribute *im_attribute_list = NULL;
- IMGetIMValuesStruct *getim = (IMGetIMValuesStruct *)&call_data->getim;
- CARD16 connect_id = call_data->any.connect_id;
- CARD16 input_method_ID;
-@@ -753,8 +799,18 @@ static void GetIMValuesMessageProc (XIMS ims,
- FrameMgrGetToken (fm, input_method_ID);
- FrameMgrGetToken (fm, byte_length);
- im_attrID_list = (CARD16 *) malloc (sizeof (CARD16)*20);
-+ if (!im_attrID_list) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto GetIMValuesMessageProc_finit;
-+ }
- memset (im_attrID_list, 0, sizeof (CARD16)*20);
- name_list = (char **)malloc(sizeof(char *) * 20);
-+ if (!name_list) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto GetIMValuesMessageProc_finit;
-+ }
- memset(name_list, 0, sizeof(char *) * 20);
- number = 0;
- while (FrameMgrIsIterLoopEnd (fm, &status) == False)
-@@ -792,8 +848,11 @@ static void GetIMValuesMessageProc (XIMS ims,
- im_attrID_list,
- &number,
- &list_len);
-- if (im_attrID_list)
-- XFree (im_attrID_list);
-+ if (!im_attribute_list) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto GetIMValuesMessageProc_finit2;
-+ }
- /*endif*/
-
- fm = FrameMgrInit (get_im_values_reply_fr,
-@@ -815,11 +874,7 @@ static void GetIMValuesMessageProc (XIMS ims,
- if (!reply)
- {
- _Xi18nSendMessage (ims, connect_id, XIM_ERROR, 0, 0, 0);
-- FrameMgrFree (fm);
-- for (i = 0; i < iter_count; i++)
-- XFree(im_attribute_list[i].value);
-- XFree (im_attribute_list);
-- return;
-+ goto GetIMValuesMessageProc_finit;
- }
- /*endif*/
- memset (reply, 0, total_size);
-@@ -840,12 +895,18 @@ static void GetIMValuesMessageProc (XIMS ims,
- 0,
- reply,
- total_size);
-- FrameMgrFree (fm);
- XFree (reply);
-
-- for (i = 0; i < iter_count; i++)
-- XFree(im_attribute_list[i].value);
-- XFree (im_attribute_list);
-+GetIMValuesMessageProc_finit:
-+ FrameMgrFree (fm);
-+GetIMValuesMessageProc_finit2:
-+ if (im_attrID_list)
-+ XFree (im_attrID_list);
-+ if (im_attribute_list) {
-+ for (i = 0; i < iter_count; i++)
-+ XFree(im_attribute_list[i].value);
-+ XFree (im_attribute_list);
-+ }
- }
-
- static void CreateICMessageProc (XIMS ims,
-@@ -1435,6 +1496,11 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
- if (byte_length > 0)
- {
- enc_nego->encoding = (XIMStr *) malloc (sizeof (XIMStr)*10);
-+ if (!enc_nego->encoding) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto EncodingNegotiatonMessageProc_finit;
-+ }
- memset (enc_nego->encoding, 0, sizeof (XIMStr)*10);
- i = 0;
- while (FrameMgrIsIterLoopEnd (fm, &status) == False)
-@@ -1446,9 +1512,21 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
- FrameMgrSetSize (fm, str_length);
- enc_nego->encoding[i].length = str_length;
- FrameMgrGetToken (fm, name);
-+ /* I don't know why encoding[i].name is detected as leak
-+ * with -Wanalyzer-malloc-leak option in gcc 11.0.1.
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- enc_nego->encoding[i].name = malloc (str_length + 1);
-+ if (!(enc_nego->encoding[i].name)) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto EncodingNegotiatonMessageProc_finit;
-+ }
- strncpy (enc_nego->encoding[i].name, name, str_length);
- enc_nego->encoding[i].name[str_length] = '\0';
-+#pragma GCC diagnostic pop
- i++;
- }
- /*endwhile*/
-@@ -1460,20 +1538,37 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
- if (byte_length > 0)
- {
- enc_nego->encodinginfo = (XIMStr *) malloc (sizeof (XIMStr)*10);
-+ if (!enc_nego->encodinginfo) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto EncodingNegotiatonMessageProc_finit;
-+ }
- memset (enc_nego->encodinginfo, 0, sizeof (XIMStr)*10);
- i = 0;
- while (FrameMgrIsIterLoopEnd (fm, &status) == False)
- {
- char *name;
- int str_length;
--
-+
- FrameMgrGetToken (fm, str_length);
- FrameMgrSetSize (fm, str_length);
- enc_nego->encodinginfo[i].length = str_length;
- FrameMgrGetToken (fm, name);
-+ /* I don't know why encodinginfo[i].name is detected as leak
-+ * with -Wanalyzer-malloc-leak option in gcc 11.0.1.
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
- enc_nego->encodinginfo[i].name = malloc (str_length + 1);
-+ if (!enc_nego->encodinginfo[i].name) {
-+ fprintf (stderr,
-+ "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ goto EncodingNegotiatonMessageProc_finit;
-+ }
- strncpy (enc_nego->encodinginfo[i].name, name, str_length);
- enc_nego->encodinginfo[i].name[str_length] = '\0';
-+#pragma GCC diagnostic pop
- i++;
- }
- /*endwhile*/
-@@ -1524,6 +1619,7 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
- total_size);
- XFree (reply);
-
-+EncodingNegotiatonMessageProc_finit:
- /* free data for encoding list */
- if (enc_nego->encoding)
- {
-diff --git a/util/IMdkit/i18nUtil.c b/util/IMdkit/i18nUtil.c
-index 109dcdf9..c62154e7 100644
---- a/util/IMdkit/i18nUtil.c
-+++ b/util/IMdkit/i18nUtil.c
-@@ -46,6 +46,8 @@ _Xi18nNeedSwap (Xi18n i18n_core, CARD16 connect_id)
- CARD8 im_byteOrder = i18n_core->address.im_byteOrder;
- Xi18nClient *client = _Xi18nFindClient (i18n_core, connect_id);
-
-+ if (!client)
-+ return True;
- return (client->byte_order != im_byteOrder);
- }
-
-@@ -67,6 +69,11 @@ Xi18nClient *_Xi18nNewClient(Xi18n i18n_core)
- new_connect_id = ++connect_id;
- }
- /*endif*/
-+ if (!client) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ return NULL;
-+ }
- memset (client, 0, sizeof (Xi18nClient));
- client->connect_id = new_connect_id;
- client->pending = (XIMPending *) NULL;
-@@ -113,7 +120,14 @@ void _Xi18nDeleteClient (Xi18n i18n_core, CARD16 connect_id)
- ccp0->next = ccp->next;
- /*endif*/
- /* put it back to free list */
-+ /* gcc 11.0.1 warns dereference of NULL with
-+ * -Wanalyzer-null-dereference option
-+ * but target should not be NULL.
-+ */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
- target->next = i18n_core->address.free_clients;
-+#pragma GCC diagnostic pop
- i18n_core->address.free_clients = target;
- return;
- }
-@@ -161,6 +175,12 @@ void _Xi18nSendMessage (XIMS ims,
-
- reply_length = header_size + length;
- reply = (unsigned char *) malloc (reply_length);
-+ if (!reply) {
-+ _Xi18nSendMessage (ims, connect_id, XIM_ERROR, 0, 0, 0);
-+ XFree (reply_hdr);
-+ FrameMgrFree (fm);
-+ return;
-+ }
- replyp = reply;
- memmove (reply, reply_hdr, header_size);
- replyp += header_size;
-diff --git a/util/IMdkit/i18nX.c b/util/IMdkit/i18nX.c
-index 5e5c15fa..152fc4e8 100644
---- a/util/IMdkit/i18nX.c
-+++ b/util/IMdkit/i18nX.c
-@@ -58,16 +58,21 @@ static XClient *NewXClient (Xi18n i18n_core, Window new_client)
- XClient *x_client;
-
- x_client = (XClient *) malloc (sizeof (XClient));
-- x_client->client_win = new_client;
-- x_client->accept_win = XCreateSimpleWindow (dpy,
-- DefaultRootWindow(dpy),
-- 0,
-- 0,
-- 1,
-- 1,
-- 1,
-- 0,
-- 0);
-+ if (!x_client) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-+ __FILE__, __LINE__);
-+ } else {
-+ x_client->client_win = new_client;
-+ x_client->accept_win = XCreateSimpleWindow (dpy,
-+ DefaultRootWindow(dpy),
-+ 0,
-+ 0,
-+ 1,
-+ 1,
-+ 1,
-+ 0,
-+ 0);
-+ }
- client->trans_rec = x_client;
- return ((XClient *) x_client);
- }
-@@ -219,7 +224,7 @@ static void ReadXConnectMessage (XIMS ims, XClientMessageEvent *ev)
- }
- /*endif*/
- _XRegisterFilterByType (dpy,
-- x_client->accept_win,
-+ x_client ? x_client->accept_win : 0,
- ClientMessage,
- ClientMessage,
- WaitXIMProtocol,
-@@ -229,7 +234,7 @@ static void ReadXConnectMessage (XIMS ims, XClientMessageEvent *ev)
- event.xclient.window = new_client;
- event.xclient.message_type = spec->connect_request;
- event.xclient.format = 32;
-- event.xclient.data.l[0] = x_client->accept_win;
-+ event.xclient.data.l[0] = x_client ? x_client->accept_win : 0;
- event.xclient.data.l[1] = major_version;
- event.xclient.data.l[2] = minor_version;
- event.xclient.data.l[3] = XCM_DATA_LIMIT;
---
-2.28.0
-
-From bc7811c6247b7bb8eba2f9f80c4f9f1510cd6b65 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 16 Jun 2021 20:39:35 +0900
-Subject: [PATCH] src/tests: Fix ibus-desktop-testing-runner to get gsettings result
-
-gsettings null string is '' and the quote mark needs to be parsed.
-Also no-overview gsetting should be changed before run gnome-session.
----
- src/tests/ibus-desktop-testing-runner.in | 18 +++++++++++-------
- 1 file changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 15b2369d..54b7e0d7 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -215,9 +215,11 @@ run_dbus_daemon()
-
- init_gnome()
- {
-+ # gsettings set command needs dconf-service with the same $DISPLAY
-+ pkill dconf-service
- # Disable Tour dialog to get focus
- V=`gsettings get org.gnome.shell welcome-dialog-last-shown-version`
-- if [ x"$V" = x ] ; then
-+ if [ x"$V" = x"''" ] ; then
- gsettings set org.gnome.shell welcome-dialog-last-shown-version '100'
- fi
- # gnome-shell now starts overview mode by login.
-@@ -237,7 +239,7 @@ init_gnome()
- V2=$?
- if [ $V2 -ne 0 ] ; then
- V3=`echo "$V" | sed -e 's/\[//' -e 's/\]//'`
-- if [ x"$V3" = x ] ; then
-+ if [ x"$V3" = x"''" ] ; then
- V4="['no-overview@fthx']"
- else
- V4="[$V3, 'no-overview@fthx']"
-@@ -248,6 +250,8 @@ init_gnome()
-
- run_desktop()
- {
-+ echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null
-+ HAS_GNOME=$?
- if test $HAVE_GRAPHICS -eq 1 ; then
- /usr/libexec/Xorg.wrap -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . $DISPLAY &
- else
-@@ -256,15 +260,15 @@ run_desktop()
- PID_XORG=$!
- sleep 1
- export DISPLAY=$DISPLAY
-+ # init_gnome need to be called with $DISPLAY before gnome-session is called
-+ if [ $HAS_GNOME -eq 0 ] ; then
-+ init_gnome
-+ fi
- echo "Running $DESKTOP_COMMAND with $USER in `tty`"
- $DESKTOP_COMMAND &
- PID_GNOME_SESSION=$!
- sleep 30
-- echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null
-- HAS_GNOME=$?
-- if [ $HAS_GNOME -eq 0 ] ; then
-- init_gnome
-- else
-+ if [ $HAS_GNOME -ne 0 ] ; then
- ibus-daemon --daemonize --verbose
- sleep 3
- fi
---
-2.28.0
-
-From 9f9c88be46436b0a7aa8e09e044a2223356b46dc Mon Sep 17 00:00:00 2001
-From: lf- <software@lfcode.ca>
-Date: Fri, 18 Jun 2021 15:39:19 +0900
-Subject: [PATCH] src/ibuscomposetable: Add support for the include
- directive
-
-We also fix an issue with excess space at the start of lines stopping
-comments being recognized.
-
-BUG=https://github.com/ibus/ibus/pull/2296
----
- src/ibuscomposetable.c | 100 ++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 95 insertions(+), 5 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 685ac717..66a5dfa7 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -21,7 +21,6 @@
-
- #include <glib.h>
- #include <glib/gstdio.h>
--#include <locale.h>
- #include <stdlib.h>
- #include <string.h>
-
-@@ -36,6 +35,7 @@
-
- #define IBUS_COMPOSE_TABLE_MAGIC "IBusComposeTable"
- #define IBUS_COMPOSE_TABLE_VERSION (3)
-+#define PATHLEN_MAX 256
-
- typedef struct {
- gunichar *sequence;
-@@ -181,7 +181,8 @@ parse_compose_sequence (IBusComposeData *compose_data,
- int n = 0;
-
- if (g_strv_length (words) < 2) {
-- g_warning ("key sequence format is <a> <b>...: %s", line);
-+ g_warning ("too few words; key sequence format is <a> <b>...: %s",
-+ line);
- goto fail;
- }
-
-@@ -244,10 +245,68 @@ fail:
- }
-
-
-+static gchar *
-+expand_include_path (const gchar *include_path) {
-+ gchar *out = g_malloc0 (PATHLEN_MAX);
-+ gchar *out_lastchar = out + PATHLEN_MAX - 2;
-+ const gchar *i = include_path;
-+ gchar *o = out;
-+
-+ while (*i && o < out_lastchar) {
-+ // expand sequence
-+ if (*i == '%') {
-+ switch (*(i+1)) {
-+ // $HOME
-+ case 'H': {
-+ const gchar *home = getenv ("HOME");
-+ if (!home) {
-+ g_warning ("while parsing XCompose include target %s, "
-+ "%%H replacement failed because HOME is not "
-+ "defined; the include has been ignored",
-+ include_path);
-+ goto fail;
-+ }
-+ o = out + g_strlcat (out, home, PATHLEN_MAX);
-+ break;
-+ }
-+ // locale compose file
-+ case 'L':
-+ g_warning ("while handling XCompose include target %s, found "
-+ "redundant %%L include; the include has been "
-+ "ignored", include_path);
-+ goto fail;
-+ // system compose dir
-+ case 'S':
-+ o = out + g_strlcat (out, "/usr/share/X11/locale",
-+ PATHLEN_MAX);
-+ break;
-+ // escaped %
-+ case '%':
-+ *o++ = '%';
-+ break;
-+ default:
-+ g_warning ("while parsing XCompose include target %s, found "
-+ "unknown substitution character '%c'; the include "
-+ "has been ignored", include_path, *(i+1));
-+ goto fail;
-+ }
-+ i += 2;
-+ } else {
-+ *o++ = *i++;
-+ }
-+ }
-+ return out;
-+fail:
-+ g_free (out);
-+ return NULL;
-+}
-+
-+
- static void
- parse_compose_line (GList **compose_list,
- const gchar *line,
-- int *compose_len)
-+ int *compose_len,
-+ gchar **include)
- {
- gchar **components = NULL;
- IBusComposeData *compose_data = NULL;
-@@ -256,11 +315,32 @@ parse_compose_line (GList **compose_list,
- g_assert (compose_len);
- *compose_len = 0;
-
-+ // eat spaces at the start of the line
-+ while (*line && (*line == ' ' || *line == '\t')) line++;
-+
- if (line[0] == '\0' || line[0] == '#')
- return;
-
-- if (g_str_has_prefix (line, "include "))
-+ if (g_str_has_prefix (line, "include ")) {
-+ const char *rest = line + sizeof ("include ") - 1;
-+ while (*rest && *rest == ' ') rest++;
-+
-+ // grabbed the path part of the line
-+ char *rest2;
-+ if (*rest == '"') {
-+ rest++;
-+ rest2 = g_strdup (rest);
-+ // eat the closing quote
-+ char *i = rest2;
-+ while (*i && *i != '"') i++;
-+ *i = '\0';
-+ } else {
-+ rest2 = g_strdup (rest);
-+ }
-+ *include = expand_include_path (rest2);
-+ g_free (rest2);
- return;
-+ }
-
- components = g_strsplit (line, ":", 2);
-
-@@ -316,8 +396,18 @@ ibus_compose_list_parse_file (const gchar *compose_file,
-
- lines = g_strsplit (contents, "\n", -1);
- g_free (contents);
-+ gchar *include = NULL;
- for (i = 0; lines[i] != NULL; i++) {
-- parse_compose_line (&compose_list, lines[i], &compose_len);
-+ parse_compose_line (&compose_list, lines[i], &compose_len, &include);
-+ if (include && *include) {
-+ GList *rest = ibus_compose_list_parse_file (include,
-+ max_compose_len);
-+ if (rest) {
-+ compose_list = g_list_concat (compose_list, rest);
-+ }
-+ }
-+
-+ g_clear_pointer (&include, g_free);
- if (*max_compose_len < compose_len)
- *max_compose_len = compose_len;
- }
---
-2.28.0
-
-From a755d1601a730b5fa0d463e7820311c12b1f1661 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 18 Jun 2021 15:39:50 +0900
-Subject: [PATCH] src/ibuscomposetable: Do not include the same compose
- file
-
-BUG=https://github.com/ibus/ibus/pull/2296
----
- src/ibuscomposetable.c | 130 +++++++++++++++++++++++++++++++----------
- 1 file changed, 100 insertions(+), 30 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 66a5dfa7..916fcae3 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -34,8 +34,8 @@
- #include "ibusenginesimpleprivate.h"
-
- #define IBUS_COMPOSE_TABLE_MAGIC "IBusComposeTable"
--#define IBUS_COMPOSE_TABLE_VERSION (3)
--#define PATHLEN_MAX 256
-+#define IBUS_COMPOSE_TABLE_VERSION (4)
-+#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
-
- typedef struct {
- gunichar *sequence;
-@@ -247,17 +247,15 @@ fail:
-
- static gchar *
- expand_include_path (const gchar *include_path) {
-- gchar *out = g_malloc0 (PATHLEN_MAX);
-- gchar *out_lastchar = out + PATHLEN_MAX - 2;
-- const gchar *i = include_path;
-- gchar *o = out;
-+ gchar *out = strdup ("");
-+ const gchar *head, *i;
-+ gchar *former, *o;
-
-- while (*i && o < out_lastchar) {
-- // expand sequence
-+ for (head = i = include_path; *i; ++i) {
-+ /* expand sequence */
- if (*i == '%') {
-- switch (*(i+1)) {
-- // $HOME
-- case 'H': {
-+ switch (*(i + 1)) {
-+ case 'H': { /* $HOME */
- const gchar *home = getenv ("HOME");
- if (!home) {
- g_warning ("while parsing XCompose include target %s, "
-@@ -266,23 +264,34 @@ expand_include_path (const gchar *include_path) {
- include_path);
- goto fail;
- }
-- o = out + g_strlcat (out, home, PATHLEN_MAX);
-+ o = out;
-+ former = g_strndup (head, i - head);
-+ out = g_strdup_printf ("%s%s%s", o, former, home);
-+ head = i + 2;
-+ g_free (o);
-+ g_free (former);
- break;
- }
-- // locale compose file
-- case 'L':
-+ case 'L': /* locale compose file */
- g_warning ("while handling XCompose include target %s, found "
- "redundant %%L include; the include has been "
- "ignored", include_path);
- goto fail;
-- // system compose dir
-- case 'S':
-- o = out + g_strlcat (out, "/usr/share/X11/locale",
-- PATHLEN_MAX);
-+ case 'S': /* system compose dir */
-+ o = out;
-+ former = g_strndup (head, i - head);
-+ out = g_strdup_printf ("%s%s%s", o, former, X11_DATADIR);
-+ head = i + 2;
-+ g_free (o);
-+ g_free (former);
- break;
-- // escaped %
-- case '%':
-- *o++ = '%';
-+ case '%': /* escaped % */
-+ o = out;
-+ former = g_strndup (head, i - head);
-+ out = g_strdup_printf ("%s%s%s", o, former, "%");
-+ head = i + 2;
-+ g_free (o);
-+ g_free (former);
- break;
- default:
- g_warning ("while parsing XCompose include target %s, found "
-@@ -290,11 +299,12 @@ expand_include_path (const gchar *include_path) {
- "has been ignored", include_path, *(i+1));
- goto fail;
- }
-- i += 2;
-- } else {
-- *o++ = *i++;
-+ ++i;
- }
- }
-+ o = out;
-+ out = g_strdup_printf ("%s%s", o, head);
-+ g_free (o);
- return out;
- fail:
- g_free (out);
-@@ -315,7 +325,7 @@ parse_compose_line (GList **compose_list,
- g_assert (compose_len);
- *compose_len = 0;
-
-- // eat spaces at the start of the line
-+ /* eat spaces at the start of the line */
- while (*line && (*line == ' ' || *line == '\t')) line++;
-
- if (line[0] == '\0' || line[0] == '#')
-@@ -325,12 +335,12 @@ parse_compose_line (GList **compose_list,
- const char *rest = line + sizeof ("include ") - 1;
- while (*rest && *rest == ' ') rest++;
-
-- // grabbed the path part of the line
-+ /* grabbed the path part of the line */
- char *rest2;
- if (*rest == '"') {
- rest++;
- rest2 = g_strdup (rest);
-- // eat the closing quote
-+ /* eat the closing quote */
- char *i = rest2;
- while (*i && *i != '"') i++;
- *i = '\0';
-@@ -374,6 +384,23 @@ fail:
- }
-
-
-+static gchar *
-+get_en_compose_file (void)
-+{
-+ gchar * const sys_langs[] = { "en_US.UTF-8", "en_US", "en.UTF-8",
-+ "en", NULL };
-+ gchar * const *sys_lang = NULL;
-+ gchar *path = NULL;
-+ for (sys_lang = sys_langs; *sys_lang; sys_lang++) {
-+ path = g_build_filename (X11_DATADIR, *sys_lang, "Compose", NULL);
-+ if (g_file_test (path, G_FILE_TEST_EXISTS))
-+ break;
-+ g_free (path);
-+ }
-+ return path;
-+}
-+
-+
- static GList *
- ibus_compose_list_parse_file (const gchar *compose_file,
- int *max_compose_len)
-@@ -399,6 +426,52 @@ ibus_compose_list_parse_file (const gchar *compose_file,
- gchar *include = NULL;
- for (i = 0; lines[i] != NULL; i++) {
- parse_compose_line (&compose_list, lines[i], &compose_len, &include);
-+ if (*max_compose_len < compose_len)
-+ *max_compose_len = compose_len;
-+ if (include && *include) {
-+ GStatBuf buf_include = { 0, };
-+ GStatBuf buf_parent = { 0, };
-+ gchar *en_compose;
-+ errno = 0;
-+ if (g_stat (include, &buf_include)) {
-+ g_warning ("Cannot access %s: %s",
-+ include,
-+ g_strerror (errno));
-+ g_clear_pointer (&include, g_free);
-+ continue;
-+ }
-+ errno = 0;
-+ if (g_stat (compose_file, &buf_parent)) {
-+ g_warning ("Cannot access %s: %s",
-+ compose_file,
-+ g_strerror (errno));
-+ g_clear_pointer (&include, g_free);
-+ continue;
-+ }
-+ if (buf_include.st_ino == buf_parent.st_ino) {
-+ g_warning ("Found recursive nest same file %s", include);
-+ g_clear_pointer (&include, g_free);
-+ continue;
-+ }
-+ en_compose = get_en_compose_file ();
-+ if (en_compose) {
-+ errno = 0;
-+ if (g_stat (en_compose, &buf_parent)) {
-+ g_warning ("Cannot access %s: %s",
-+ compose_file,
-+ g_strerror (errno));
-+ g_clear_pointer (&include, g_free);
-+ g_free (en_compose);
-+ continue;
-+ }
-+ }
-+ g_free (en_compose);
-+ if (buf_include.st_ino == buf_parent.st_ino) {
-+ g_log ("System en_US Compose is already loaded %s\n", include);
-+ g_clear_pointer (&include, g_free);
-+ continue;
-+ }
-+ }
- if (include && *include) {
- GList *rest = ibus_compose_list_parse_file (include,
- max_compose_len);
-@@ -406,10 +479,7 @@ ibus_compose_list_parse_file (const gchar *compose_file,
- compose_list = g_list_concat (compose_list, rest);
- }
- }
--
- g_clear_pointer (&include, g_free);
-- if (*max_compose_len < compose_len)
-- *max_compose_len = compose_len;
- }
- g_strfreev (lines);
-
---
-2.28.0
-
-From 7f09379b3cb69c7de6d8d667ce398dcfc0000433 Mon Sep 17 00:00:00 2001
-From: lf- <software@lfcode.ca>
-Date: Thu, 24 Jun 2021 16:10:12 +0900
-Subject: [PATCH] src/ibuscomposetable: Fix a buffer overflow in compose
- handling
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-I believe this has no security impact but it is making my Valgrind sad.
-
-Thanks to Omni for the help in finding the root cause of this.
-
-~/.XCompose is:
-```
-<Multi_key> <g> <h> : "η"
-<Multi_key> <g> <v> <t> <h> : "ϑ"
-<Multi_key> <g> <h> : "ɣ"
-```
-
-BUG=https://github.com/ibus/ibus/pull/2297
----
- src/ibuscomposetable.c | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 916fcae3..dd7cbf83 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -410,7 +410,6 @@ ibus_compose_list_parse_file (const gchar *compose_file,
- gsize length = 0;
- GError *error = NULL;
- GList *compose_list = NULL;
-- int compose_len = 0;
- int i;
-
- g_assert (max_compose_len);
-@@ -423,8 +422,9 @@ ibus_compose_list_parse_file (const gchar *compose_file,
-
- lines = g_strsplit (contents, "\n", -1);
- g_free (contents);
-- gchar *include = NULL;
- for (i = 0; lines[i] != NULL; i++) {
-+ int compose_len = 0;
-+ gchar *include = NULL;
- parse_compose_line (&compose_list, lines[i], &compose_len, &include);
- if (*max_compose_len < compose_len)
- *max_compose_len = compose_len;
-@@ -467,7 +467,8 @@ ibus_compose_list_parse_file (const gchar *compose_file,
- }
- g_free (en_compose);
- if (buf_include.st_ino == buf_parent.st_ino) {
-- g_log ("System en_US Compose is already loaded %s\n", include);
-+ g_message ("System en_US Compose is already loaded %s\n",
-+ include);
- g_clear_pointer (&include, g_free);
- continue;
- }
-@@ -583,12 +584,20 @@ ibus_compose_data_compare (gpointer a,
- IBusComposeData *compose_data_b = b;
- int max_compose_len = GPOINTER_TO_INT (data);
- int i;
-+ /* The allocation length of compose_data_a->sequence[] is different from
-+ * one of compose_data_b->sequence[] and max_compose_len indicates
-+ * the sequence length only but not include the compose value length.
-+ * So max_compose_len is greater than any allocation lengths of sequence[]
-+ * and this API should return if code_a or code_b is 0.
-+ */
- for (i = 0; i < max_compose_len; i++) {
- gunichar code_a = compose_data_a->sequence[i];
- gunichar code_b = compose_data_b->sequence[i];
-
- if (code_a != code_b)
- return code_a - code_b;
-+ if (code_a == 0 && code_b == 0)
-+ return 0;
- }
- return 0;
- }
---
-2.28.0
-
-From ab6b9587a497e9662a2936df3dabed4582eeabdb Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 29 Jun 2021 12:40:20 +0900
-Subject: [PATCH] src/tests: Delete G_MESSAGES_DEBUG in desktop-testing for
- gsettings
-
-G_MESSAGES_DEBUG message could be appended to the output of gsettings
-command and it's not useful to check the output.
----
- src/tests/ibus-desktop-testing-runner.in | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 54b7e0d7..0ef72c03 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -217,6 +217,10 @@ init_gnome()
- {
- # gsettings set command needs dconf-service with the same $DISPLAY
- pkill dconf-service
-+ # G_MESSAGES_DEBUG=all or G_MESSAGES_DEBUG=GLib-GIO-DEBUG would append
-+ # debug messages to gsettings output and could not get the result correctly.
-+ backup_G_MESSAGES_DEBUG="$G_MESSAGES_DEBUG"
-+ export -n G_MESSAGES_DEBUG=''
- # Disable Tour dialog to get focus
- V=`gsettings get org.gnome.shell welcome-dialog-last-shown-version`
- if [ x"$V" = x"''" ] ; then
-@@ -238,14 +242,17 @@ init_gnome()
- echo "$V" | grep "no-overview" > /dev/null
- V2=$?
- if [ $V2 -ne 0 ] ; then
-- V3=`echo "$V" | sed -e 's/\[//' -e 's/\]//'`
-- if [ x"$V3" = x"''" ] ; then
-+ V3=`echo "$V" | sed -e 's/@as //' -e 's/\[//' -e 's/\]//'`
-+ if [ x"$V3" = x"''" ] || [ x"$V3" = x"" ]; then
- V4="['no-overview@fthx']"
- else
- V4="[$V3, 'no-overview@fthx']"
- fi
- gsettings set org.gnome.shell enabled-extensions "$V4"
- fi
-+ if [ x"$backup_G_MESSAGES_DEBUG" != x ] ; then
-+ export G_MESSAGES_DEBUG="$backup_G_MESSAGES_DEBUG"
-+ fi
- }
-
- run_desktop()
---
-2.28.0
-
-From b952d30a1b7c741052c168fe1081ecb4d4b1c034 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 14 Jul 2021 22:31:47 +0900
-Subject: [PATCH] Change default Emoji shortcut key
-
-The shortcut key was Ctrl-Shit-e to follow Unicode code point
-shortcut key but now the shorcut key is changed to Ctrl-period
-to follow GTK.
-
-BUG=https://github.com/ibus/ibus/issues/2325
----
- 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 a79e9296..099b9c60 100644
---- a/data/dconf/org.freedesktop.ibus.gschema.xml
-+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
-@@ -183,7 +183,7 @@
- <description>The shortcut keys for turning Unicode typing on or off</description>
- </key>
- <key name="hotkey" type="as">
-- <default>[ '<Control><Shift>e' ]</default>
-+ <default>[ '<Control>period' ]</default>
- <summary>Emoji shortcut keys for gtk_accelerator_parse</summary>
- <description>The shortcut keys for turning emoji typing on or off</description>
- </key>
---
-2.28.0
-
-From a4939f67f9de8275219e2cfcd3873e0fbe59058f Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 16 Jul 2021 13:08:02 +0900
-Subject: [PATCH] setup: Enhance engine search function
-
-ibus-setup can search both the language names and input method names
-in the top language list but when you search a language keyword
-in the language list and move to the input method list after click
-the hit language name, any input methods could not be shown because
-the language didn't hit in any input method names.
-
-In this enhancement, ibus-setup can show the input methods to hit
-the language names.
----
- setup/enginedialog.py | 26 ++++++++++++++++++++------
- 1 file changed, 20 insertions(+), 6 deletions(-)
-
-diff --git a/setup/enginedialog.py b/setup/enginedialog.py
-index e1c322bf..470f801c 100644
---- a/setup/enginedialog.py
-+++ b/setup/enginedialog.py
-@@ -120,12 +120,26 @@ class EngineDialog(Gtk.Dialog):
- return True
- if word in row.untrans.lower():
- return True
-- if row.lang_info and row.name in self.__engines_for_lang:
-- for row_e in self.__engines_for_lang[row.name]:
-- if word in row_e.name.lower():
-- return True
-- if word in row_e.untrans.lower():
-- return True
-+ # Search engine name in language list
-+ if row.lang_info:
-+ if row.name in self.__engines_for_lang.keys():
-+ for row_l in self.__engines_for_lang[row.name]:
-+ if word in row_l.name.lower():
-+ return True
-+ if word in row_l.untrans.lower():
-+ return True
-+ # Search language name in engine list
-+ if not row.lang_info:
-+ for l in self.__engines_for_lang.keys():
-+ if word in l.lower():
-+ for row_l in self.__engines_for_lang[l]:
-+ if row.name == row_l.name:
-+ return True
-+ for (trans, untrans) in self.__untrans_for_lang.items():
-+ if word in untrans.lower():
-+ for row_l in self.__engines_for_lang[trans]:
-+ if row.name == row_l.name:
-+ return True
- return False
-
-
---
-2.28.0
-
-From 7e12d589ee4979fdd0f0b08f1bac9049741ec628 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:52:12 +0900
-Subject: [PATCH 1/6] src/ibuscomposetable: Move ibus_compose_table_check
-
-- Move ibus_compose_table_check and ibus_compose_table_compact_check
- from ibusenginesimple.c to ibuscomposetable.c
-- Fix src/tests/ibus-compose.c to read compose sequences correctly.
----
- src/ibuscomposetable.c | 519 +++++++++++++++++++++++++++++-
- src/ibusenginesimple.c | 583 ++++------------------------------
- src/ibusenginesimpleprivate.h | 17 +-
- src/tests/Makefile.am | 3 +-
- src/tests/ibus-compose.c | 7 +-
- 5 files changed, 601 insertions(+), 528 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index dd7cbf83..f85177a6 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -33,6 +33,13 @@
-
- #include "ibusenginesimpleprivate.h"
-
-+/* This file contains the table of the compose sequences,
-+ * static const guint16 gtk_compose_seqs_compact[] = {}
-+ * It is generated from the compose-parse.py script.
-+ */
-+#include "gtkimcontextsimpleseqs.h"
-+
-+
- #define IBUS_COMPOSE_TABLE_MAGIC "IBusComposeTable"
- #define IBUS_COMPOSE_TABLE_VERSION (4)
- #define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
-@@ -44,6 +51,10 @@ typedef struct {
- } IBusComposeData;
-
-
-+extern const IBusComposeTableCompactEx ibus_compose_table_compact;
-+extern const IBusComposeTableCompactEx ibus_compose_table_compact_32bit;
-+
-+
- static void
- ibus_compose_data_free (IBusComposeData *compose_data)
- {
-@@ -527,20 +538,22 @@ ibus_compose_list_check_duplicated (GList *compose_list,
- is_32bit = (n_outputs > 1) ? TRUE :
- (compose_data->values[0] >= 0xFFFF) ? TRUE : FALSE;
- if (!is_32bit &&
-- ibus_check_compact_table (&ibus_compose_table_compact,
-- keysyms,
-- n_compose,
-- &compose_finish,
-- &output_chars) && compose_finish) {
-+ ibus_compose_table_compact_check (&ibus_compose_table_compact,
-+ keysyms,
-+ n_compose,
-+ &compose_finish,
-+ &output_chars) &&
-+ compose_finish) {
- if (compose_data->values[0] == *output_chars)
- removed_list = g_list_append (removed_list, compose_data);
- g_free (output_chars);
- } else if (is_32bit &&
-- ibus_check_compact_table (&ibus_compose_table_compact_32bit,
-- keysyms,
-- n_compose,
-- &compose_finish,
-- &output_chars) && compose_finish) {
-+ ibus_compose_table_compact_check (
-+ &ibus_compose_table_compact_32bit,
-+ keysyms,
-+ n_compose,
-+ &compose_finish,
-+ &output_chars) && compose_finish) {
-
- if (n_outputs == unichar_length (output_chars)) {
- int j = 0;
-@@ -1354,3 +1367,489 @@ ibus_compose_table_list_add_file (GSList *compose_tables,
- ibus_compose_table_save_cache (compose_table);
- return g_slist_prepend (compose_tables, compose_table);
- }
-+
-+
-+static int
-+compare_seq (const void *key, const void *value)
-+{
-+ int i = 0;
-+ const guint16 *keysyms = key;
-+ const guint16 *seq = value;
-+
-+ while (keysyms[i]) {
-+ if (keysyms[i] < seq[i])
-+ return -1;
-+ else if (keysyms[i] > seq[i])
-+ return 1;
-+
-+ i++;
-+ }
-+
-+ return 0;
-+}
-+
-+
-+gboolean
-+ibus_compose_table_check (const IBusComposeTableEx *table,
-+ guint16 *compose_buffer,
-+ gint n_compose,
-+ gboolean *compose_finish,
-+ gboolean *compose_match,
-+ GString *output,
-+ gboolean is_32bit)
-+{
-+ gint row_stride = table->max_seq_len + 2;
-+ guint16 *data_first;
-+ int n_seqs;
-+ guint16 *seq;
-+
-+ if (compose_finish)
-+ *compose_finish = FALSE;
-+ if (compose_match)
-+ *compose_match = FALSE;
-+ if (output)
-+ g_string_set_size (output, 0);
-+
-+ if (n_compose > table->max_seq_len)
-+ return FALSE;
-+
-+ if (is_32bit) {
-+ if (!table->priv)
-+ return FALSE;
-+ data_first = table->priv->data_first;
-+ n_seqs = table->priv->first_n_seqs;
-+ } else {
-+ data_first = table->data;
-+ n_seqs = table->n_seqs;
-+ }
-+ seq = bsearch (compose_buffer,
-+ data_first, n_seqs,
-+ sizeof (guint16) * row_stride,
-+ compare_seq);
-+
-+ if (seq == NULL)
-+ return FALSE;
-+
-+ guint16 *prev_seq;
-+
-+ /* Back up to the first sequence that matches to make sure
-+ * we find the exact match if their is one.
-+ */
-+ while (seq > data_first) {
-+ prev_seq = seq - row_stride;
-+ if (compare_seq (compose_buffer, prev_seq) != 0)
-+ break;
-+ seq = prev_seq;
-+ }
-+
-+ /* complete sequence */
-+ if (n_compose == table->max_seq_len || seq[n_compose] == 0) {
-+ guint16 *next_seq;
-+ gunichar value = 0;
-+ int num = 0;
-+ int index = 0;
-+ gchar *output_str = NULL;
-+ GError *error = NULL;
-+
-+ if (is_32bit) {
-+ num = seq[table->max_seq_len];
-+ index = seq[table->max_seq_len + 1];
-+ value = table->priv->data_second[index];
-+ } else {
-+ value = seq[table->max_seq_len];
-+ }
-+
-+ if (is_32bit) {
-+ output_str = g_ucs4_to_utf8 (table->priv->data_second + index,
-+ num, NULL, NULL, &error);
-+ if (output_str) {
-+ if (output)
-+ g_string_append (output, output_str);
-+ g_free (output_str);
-+ if (compose_match)
-+ *compose_match = TRUE;
-+ } else {
-+ g_warning ("Failed to output multiple characters: %s",
-+ error->message);
-+ g_error_free (error);
-+ }
-+ } else {
-+ if (output)
-+ g_string_append_unichar (output, value);
-+ if (compose_match)
-+ *compose_match = TRUE;
-+ }
-+
-+ /* We found a tentative match. See if there are any longer
-+ * sequences containing this subsequence
-+ */
-+ next_seq = seq + row_stride;
-+ if (next_seq < data_first + row_stride * n_seqs) {
-+ if (compare_seq (compose_buffer, next_seq) == 0)
-+ return TRUE;
-+ }
-+
-+ if (compose_finish)
-+ *compose_finish = TRUE;
-+ compose_buffer[0] = 0;
-+ }
-+ return TRUE;
-+}
-+
-+
-+static int
-+compare_seq_index (const void *key, const void *value)
-+{
-+ const guint16 *keysyms = key;
-+ const guint16 *seq = value;
-+
-+ if (keysyms[0] < seq[0])
-+ return -1;
-+ else if (keysyms[0] > seq[0])
-+ return 1;
-+ return 0;
-+}
-+
-+
-+/**
-+ * ibus_compose_table_compact_check:
-+ * @table: A const `IBusComposeTableCompactEx`
-+ * @compose_buffer: Typed compose sequence buffer
-+ * @n_compose: The length of `compose_buffer`
-+ * @compose_finish: If %TRUE, `output_chars` should be committed
-+ * @output_chars: An array of gunichar of output compose characters
-+ *
-+ * output_chars is better to use gunichar instead of GString because
-+ * IBusComposeData->values[] is the gunichar array.
-+ */
-+gboolean
-+ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
-+ guint16
-+ *compose_buffer,
-+ gint n_compose,
-+ gboolean
-+ *compose_finish,
-+ gunichar **output_chars)
-+{
-+ gint row_stride;
-+ guint16 *seq_index;
-+ guint16 *seq;
-+ gint i;
-+
-+ if (compose_finish)
-+ *compose_finish = FALSE;
-+ if (output_chars)
-+ *output_chars = NULL;
-+
-+ /* Will never match, if the sequence in the compose buffer is longer
-+ * than the sequences in the table. Further, compare_seq (key, val)
-+ * will overrun val if key is longer than val. */
-+ if (n_compose > table->max_seq_len)
-+ return FALSE;
-+
-+ seq_index = bsearch (compose_buffer,
-+ table->data,
-+ table->n_index_size,
-+ sizeof (guint16) * table->n_index_stride,
-+ compare_seq_index);
-+
-+ if (seq_index == NULL)
-+ return FALSE;
-+
-+ if (n_compose == 1)
-+ return TRUE;
-+
-+ seq = NULL;
-+
-+ if (table->priv) {
-+ for (i = n_compose - 1; i < table->max_seq_len; i++) {
-+ row_stride = i + 2;
-+
-+ if (seq_index[i + 1] - seq_index[i] > 0) {
-+ seq = bsearch (compose_buffer + 1,
-+ table->data + seq_index[i],
-+ (seq_index[i + 1] - seq_index[i]) / row_stride,
-+ sizeof (guint16) * row_stride,
-+ compare_seq);
-+ if (seq) {
-+ if (i == n_compose - 1)
-+ break;
-+ else
-+ return TRUE;
-+ }
-+ }
-+ }
-+ if (!seq) {
-+ return FALSE;
-+ } else {
-+ int index = seq[row_stride - 2];
-+ int length = seq[row_stride - 1];
-+ int j;
-+ if (compose_finish)
-+ *compose_finish = TRUE;
-+ if (output_chars) {
-+ *output_chars = g_new (gunichar, length + 1);
-+ for (j = 0; j < length; j++) {
-+ (*output_chars)[j] = table->priv->data2[index + j];
-+ }
-+ (*output_chars)[length] = 0;
-+ }
-+
-+ return TRUE;
-+ }
-+ } else {
-+ for (i = n_compose - 1; i < table->max_seq_len; i++) {
-+ row_stride = i + 1;
-+
-+ if (seq_index[i + 1] - seq_index[i] > 0) {
-+ seq = bsearch (compose_buffer + 1,
-+ table->data + seq_index[i],
-+ (seq_index[i + 1] - seq_index[i]) / row_stride,
-+ sizeof (guint16) * row_stride,
-+ compare_seq);
-+
-+ if (seq) {
-+ if (i == n_compose - 1)
-+ break;
-+ else
-+ return TRUE;
-+ }
-+ }
-+ }
-+ if (!seq) {
-+ return FALSE;
-+ } else {
-+ if (compose_finish)
-+ *compose_finish = TRUE;
-+ if (output_chars) {
-+ *output_chars = g_new (gunichar, 2);
-+ (*output_chars)[0] = seq[row_stride - 1];
-+ (*output_chars)[1] = 0;
-+ }
-+
-+ return TRUE;
-+ }
-+ }
-+
-+ g_assert_not_reached ();
-+}
-+
-+
-+/* Checks if a keysym is a dead key. Dead key keysym values are defined in
-+ * ../gdk/gdkkeysyms.h and the first is GDK_KEY_dead_grave. As X.Org is updated,
-+ * more dead keys are added and we need to update the upper limit.
-+ * Currently, the upper limit is GDK_KEY_dead_dasia+1. The +1 has to do with
-+ * a temporary issue in the X.Org header files.
-+ * In future versions it will be just the keysym (no +1).
-+ */
-+#define IS_DEAD_KEY(k) \
-+ ((k) >= IBUS_KEY_dead_grave && (k) <= IBUS_KEY_dead_greek)
-+
-+/* This function receives a sequence of Unicode characters and tries to
-+ * normalize it (NFC). We check for the case the the resulting string
-+ * has length 1 (single character).
-+ * NFC normalisation normally rearranges diacritic marks, unless these
-+ * belong to the same Canonical Combining Class.
-+ * If they belong to the same canonical combining class, we produce all
-+ * permutations of the diacritic marks, then attempt to normalize.
-+ */
-+static gboolean
-+check_normalize_nfc (gunichar* combination_buffer, gint n_compose)
-+{
-+ gunichar combination_buffer_temp[IBUS_MAX_COMPOSE_LEN];
-+ gchar *combination_utf8_temp = NULL;
-+ gchar *nfc_temp = NULL;
-+ gint n_combinations;
-+ gunichar temp_swap;
-+ gint i;
-+
-+ n_combinations = 1;
-+
-+ for (i = 1; i < n_compose; i++ )
-+ n_combinations *= i;
-+
-+ /* Xorg reuses dead_tilde for the perispomeni diacritic mark.
-+ * We check if base character belongs to Greek Unicode block,
-+ * and if so, we replace tilde with perispomeni. */
-+ if (combination_buffer[0] >= 0x390 && combination_buffer[0] <= 0x3FF) {
-+ for (i = 1; i < n_compose; i++ )
-+ if (combination_buffer[i] == 0x303)
-+ combination_buffer[i] = 0x342;
-+ }
-+
-+ memcpy (combination_buffer_temp,
-+ combination_buffer,
-+ IBUS_MAX_COMPOSE_LEN * sizeof (gunichar) );
-+
-+ for (i = 0; i < n_combinations; i++ ) {
-+ g_unicode_canonical_ordering (combination_buffer_temp, n_compose);
-+ combination_utf8_temp = g_ucs4_to_utf8 (combination_buffer_temp, -1,
-+ NULL, NULL, NULL);
-+ nfc_temp = g_utf8_normalize (combination_utf8_temp, -1,
-+ G_NORMALIZE_NFC);
-+
-+ if (g_utf8_strlen (nfc_temp, -1) == 1) {
-+ memcpy (combination_buffer,
-+ combination_buffer_temp,
-+ IBUS_MAX_COMPOSE_LEN * sizeof (gunichar) );
-+
-+ g_free (combination_utf8_temp);
-+ g_free (nfc_temp);
-+
-+ return TRUE;
-+ }
-+
-+ g_free (combination_utf8_temp);
-+ g_free (nfc_temp);
-+
-+ if (n_compose > 2) {
-+ gint j = i % (n_compose - 1) + 1;
-+ gint k = (i+1) % (n_compose - 1) + 1;
-+ if (j >= IBUS_MAX_COMPOSE_LEN) {
-+ g_warning ("j >= IBUS_MAX_COMPOSE_LEN for " \
-+ "combination_buffer_temp");
-+ break;
-+ }
-+ if (k >= IBUS_MAX_COMPOSE_LEN) {
-+ g_warning ("k >= IBUS_MAX_COMPOSE_LEN for " \
-+ "combination_buffer_temp");
-+ break;
-+ }
-+ temp_swap = combination_buffer_temp[j];
-+ combination_buffer_temp[j] = combination_buffer_temp[k];
-+ combination_buffer_temp[k] = temp_swap;
-+ } else {
-+ break;
-+ }
-+ }
-+
-+ return FALSE;
-+}
-+
-+
-+gboolean
-+ibus_check_algorithmically (const guint16 *compose_buffer,
-+ gint n_compose,
-+ gunichar *output_char)
-+
-+{
-+ gint i;
-+ gunichar combination_buffer[IBUS_MAX_COMPOSE_LEN];
-+ gchar *combination_utf8, *nfc;
-+
-+ if (output_char)
-+ *output_char = 0;
-+
-+ if (n_compose >= IBUS_MAX_COMPOSE_LEN)
-+ return FALSE;
-+
-+ for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
-+ ;
-+ if (i == n_compose)
-+ return TRUE;
-+
-+ if (i > 0 && i == n_compose - 1) {
-+ combination_buffer[0] = ibus_keyval_to_unicode (compose_buffer[i]);
-+ combination_buffer[n_compose] = 0;
-+ i--;
-+ while (i >= 0) {
-+ combination_buffer[i+1] = ibus_keysym_to_unicode (compose_buffer[i],
-+ TRUE);
-+ if (!combination_buffer[i+1]) {
-+ combination_buffer[i+1] =
-+ ibus_keyval_to_unicode (compose_buffer[i]);
-+ }
-+ i--;
-+ }
-+
-+ /* If the buffer normalizes to a single character,
-+ * then modify the order of combination_buffer accordingly, if
-+ * necessary, and return TRUE.
-+ */
-+ if (check_normalize_nfc (combination_buffer, n_compose)) {
-+ combination_utf8 = g_ucs4_to_utf8 (combination_buffer, -1,
-+ NULL, NULL, NULL);
-+ nfc = g_utf8_normalize (combination_utf8, -1, G_NORMALIZE_NFC);
-+
-+ if (output_char)
-+ *output_char = g_utf8_get_char (nfc);
-+
-+ g_free (combination_utf8);
-+ g_free (nfc);
-+
-+ return TRUE;
-+ }
-+ }
-+
-+ return FALSE;
-+}
-+
-+
-+gunichar
-+ibus_keysym_to_unicode (guint16 keysym,
-+ gboolean combining) {
-+#define CASE(keysym_suffix, unicode) \
-+ case IBUS_KEY_dead_##keysym_suffix: return unicode
-+#define CASE_COMBINE(keysym_suffix, combined_unicode, isolated_unicode) \
-+ case IBUS_KEY_dead_##keysym_suffix: \
-+ if (combining) \
-+ return combined_unicode; \
-+ else \
-+ return isolated_unicode
-+ switch (keysym) {
-+ CASE (a, 0x03041);
-+ CASE (A, 0x03042);
-+ CASE (i, 0x03043);
-+ CASE (I, 0x03044);
-+ CASE (u, 0x03045);
-+ CASE (U, 0x03046);
-+ CASE (e, 0x03047);
-+ CASE (E, 0x03048);
-+ CASE (o, 0x03049);
-+ CASE (O, 0x0304A);
-+ CASE (abovecomma, 0x0313);
-+ CASE_COMBINE (abovedot, 0x0307, 0x02D9);
-+ CASE (abovereversedcomma, 0x0314);
-+ CASE_COMBINE (abovering, 0x030A, 0x02DA);
-+ CASE_COMBINE (acute, 0x0301, 0x00B4);
-+ CASE (belowbreve, 0x032E);
-+ CASE_COMBINE (belowcircumflex, 0x032D, 0xA788);
-+ CASE_COMBINE (belowcomma, 0x0326, 0x002C);
-+ CASE (belowdiaeresis, 0x0324);
-+ CASE_COMBINE (belowdot, 0x0323, 0x002E);
-+ CASE_COMBINE (belowmacron, 0x0331, 0x02CD);
-+ CASE_COMBINE (belowring, 0x030A, 0x02F3);
-+ CASE_COMBINE (belowtilde, 0x0330, 0x02F7);
-+ CASE_COMBINE (breve, 0x0306, 0x02D8);
-+ CASE_COMBINE (capital_schwa, 0x018F, 0x04D8);
-+ CASE_COMBINE (caron, 0x030C, 0x02C7);
-+ CASE_COMBINE (cedilla, 0x0327, 0x00B8);
-+ CASE_COMBINE (circumflex, 0x0302, 0x005E);
-+ CASE (currency, 0x00A4);
-+ // IBUS_KEY_dead_dasia == IBUS_KEY_dead_abovereversedcomma
-+ CASE_COMBINE (diaeresis, 0x0308, 0x00A8);
-+ CASE_COMBINE (doubleacute, 0x030B, 0x02DD);
-+ CASE_COMBINE (doublegrave, 0x030F, 0x02F5);
-+ CASE_COMBINE (grave, 0x0300, 0x0060);
-+ CASE (greek, 0x03BC);
-+ CASE (hook, 0x0309);
-+ CASE (horn, 0x031B);
-+ CASE (invertedbreve, 0x032F);
-+ CASE_COMBINE (iota, 0x0345, 0x037A);
-+ CASE_COMBINE (macron, 0x0304, 0x00AF);
-+ CASE_COMBINE (ogonek, 0x0328, 0x02DB);
-+ // IBUS_KEY_dead_perispomeni == IBUS_KEY_dead_tilde
-+ // IBUS_KEY_dead_psili == IBUS_KEY_dead_abovecomma
-+ CASE_COMBINE (semivoiced_sound, 0x309A, 0x309C);
-+ CASE_COMBINE (small_schwa, 0x1D4A, 0x04D9);
-+ CASE (stroke, 0x002F);
-+ CASE_COMBINE (tilde, 0x0303, 0x007E);
-+ CASE_COMBINE (voiced_sound, 0x3099, 0x309B);
-+ case IBUS_KEY_Multi_key:
-+ return 0x2384;
-+ default:;
-+ }
-+ return 0x0;
-+#undef CASE
-+#undef CASE_COMBINE
-+}
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 6dbc39c7..4644620b 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -91,11 +91,6 @@ struct _IBusEngineSimplePrivate {
- gboolean lookup_table_visible;
- };
-
--struct _IBusComposeTableCompactPrivate
--{
-- const guint32 *data2;
--};
--
- /* From the values below, the value 30 means the number of different first keysyms
- * that exist in the Compose file (from Xorg). When running compose-parse.py without
- * parameters, you get the count that you can put here. Needed when updating the
-@@ -124,6 +119,7 @@ const IBusComposeTableCompactEx ibus_compose_table_compact_32bit = {
- };
-
- guint COMPOSE_BUFFER_SIZE = 20;
-+G_LOCK_DEFINE_STATIC (global_tables);
- static GSList *global_tables;
-
- /* functions prototype */
-@@ -261,74 +257,6 @@ ibus_engine_simple_commit_char (IBusEngineSimple *simple,
- ibus_text_new_from_unichar (ch));
- }
-
--static gunichar
--ibus_keysym_to_unicode (guint16 keysym,
-- gboolean combining) {
--#define CASE(keysym_suffix, unicode) \
-- case IBUS_KEY_dead_##keysym_suffix: return unicode
--#define CASE_COMBINE(keysym_suffix, combined_unicode, isolated_unicode) \
-- case IBUS_KEY_dead_##keysym_suffix: \
-- if (combining) \
-- return combined_unicode; \
-- else \
-- return isolated_unicode
-- switch (keysym) {
-- CASE (a, 0x03041);
-- CASE (A, 0x03042);
-- CASE (i, 0x03043);
-- CASE (I, 0x03044);
-- CASE (u, 0x03045);
-- CASE (U, 0x03046);
-- CASE (e, 0x03047);
-- CASE (E, 0x03048);
-- CASE (o, 0x03049);
-- CASE (O, 0x0304A);
-- CASE (abovecomma, 0x0313);
-- CASE_COMBINE (abovedot, 0x0307, 0x02D9);
-- CASE (abovereversedcomma, 0x0314);
-- CASE_COMBINE (abovering, 0x030A, 0x02DA);
-- CASE_COMBINE (acute, 0x0301, 0x00B4);
-- CASE (belowbreve, 0x032E);
-- CASE_COMBINE (belowcircumflex, 0x032D, 0xA788);
-- CASE_COMBINE (belowcomma, 0x0326, 0x002C);
-- CASE (belowdiaeresis, 0x0324);
-- CASE_COMBINE (belowdot, 0x0323, 0x002E);
-- CASE_COMBINE (belowmacron, 0x0331, 0x02CD);
-- CASE_COMBINE (belowring, 0x030A, 0x02F3);
-- CASE_COMBINE (belowtilde, 0x0330, 0x02F7);
-- CASE_COMBINE (breve, 0x0306, 0x02D8);
-- CASE_COMBINE (capital_schwa, 0x018F, 0x04D8);
-- CASE_COMBINE (caron, 0x030C, 0x02C7);
-- CASE_COMBINE (cedilla, 0x0327, 0x00B8);
-- CASE_COMBINE (circumflex, 0x0302, 0x005E);
-- CASE (currency, 0x00A4);
-- // IBUS_KEY_dead_dasia == IBUS_KEY_dead_abovereversedcomma
-- CASE_COMBINE (diaeresis, 0x0308, 0x00A8);
-- CASE_COMBINE (doubleacute, 0x030B, 0x02DD);
-- CASE_COMBINE (doublegrave, 0x030F, 0x02F5);
-- CASE_COMBINE (grave, 0x0300, 0x0060);
-- CASE (greek, 0x03BC);
-- CASE (hook, 0x0309);
-- CASE (horn, 0x031B);
-- CASE (invertedbreve, 0x032F);
-- CASE_COMBINE (iota, 0x0345, 0x037A);
-- CASE_COMBINE (macron, 0x0304, 0x00AF);
-- CASE_COMBINE (ogonek, 0x0328, 0x02DB);
-- // IBUS_KEY_dead_perispomeni == IBUS_KEY_dead_tilde
-- // IBUS_KEY_dead_psili == IBUS_KEY_dead_abovecomma
-- CASE_COMBINE (semivoiced_sound, 0x309A, 0x309C);
-- CASE_COMBINE (small_schwa, 0x1D4A, 0x04D9);
-- CASE (stroke, 0x002F);
-- CASE_COMBINE (tilde, 0x0303, 0x007E);
-- CASE_COMBINE (voiced_sound, 0x3099, 0x309B);
-- case IBUS_KEY_Multi_key:
-- return 0x2384;
-- default:;
-- }
-- return 0x0;
--#undef CASE
--#undef CASE_COMBINE
--}
-
- static void
- ibus_engine_simple_commit_str (IBusEngineSimple *simple,
-@@ -607,415 +535,6 @@ check_emoji_table (IBusEngineSimple *simple,
- return FALSE;
- }
-
--static int
--compare_seq_index (const void *key, const void *value)
--{
-- const guint16 *keysyms = key;
-- const guint16 *seq = value;
--
-- if (keysyms[0] < seq[0])
-- return -1;
-- else if (keysyms[0] > seq[0])
-- return 1;
-- return 0;
--}
--
--static int
--compare_seq (const void *key, const void *value)
--{
-- int i = 0;
-- const guint16 *keysyms = key;
-- const guint16 *seq = value;
--
-- while (keysyms[i]) {
-- if (keysyms[i] < seq[i])
-- return -1;
-- else if (keysyms[i] > seq[i])
-- return 1;
--
-- i++;
-- }
--
-- return 0;
--}
--
--
--static gboolean
--check_table (IBusEngineSimple *simple,
-- const IBusComposeTableEx *table,
-- gint n_compose,
-- gboolean is_32bit)
--{
-- IBusEngineSimplePrivate *priv = simple->priv;
-- gint row_stride = table->max_seq_len + 2;
-- guint16 *data_first;
-- int n_seqs;
-- guint16 *seq;
--
-- g_assert (IBUS_IS_ENGINE_SIMPLE (simple));
-- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
--
-- if (n_compose > table->max_seq_len)
-- return FALSE;
--
-- if (is_32bit) {
-- if (!table->priv)
-- return FALSE;
-- data_first = table->priv->data_first;
-- n_seqs = table->priv->first_n_seqs;
-- } else {
-- data_first = table->data;
-- n_seqs = table->n_seqs;
-- }
-- seq = bsearch (priv->compose_buffer,
-- data_first, n_seqs,
-- sizeof (guint16) * row_stride,
-- compare_seq);
--
-- if (seq == NULL)
-- return FALSE;
--
-- 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.
-- */
-- while (seq > data_first) {
-- prev_seq = seq - row_stride;
-- if (compare_seq (priv->compose_buffer, prev_seq) != 0) {
-- break;
-- }
-- seq = prev_seq;
-- }
--
-- /* complete sequence */
-- if (n_compose == table->max_seq_len || seq[n_compose] == 0) {
-- guint16 *next_seq;
-- gunichar value = 0;
-- int num = 0;
-- int index = 0;
-- gchar *output_str = NULL;
-- GError *error = NULL;
--
-- if (is_32bit) {
-- num = seq[table->max_seq_len];
-- index = seq[table->max_seq_len + 1];
-- value = table->priv->data_second[index];
-- } else {
-- value = seq[table->max_seq_len];
-- }
--
-- /* We found a tentative match. See if there are any longer
-- * sequences containing this subsequence
-- */
-- next_seq = seq + row_stride;
-- if (next_seq < data_first + row_stride * n_seqs) {
-- if (compare_seq (priv->compose_buffer, next_seq) == 0) {
-- priv->tentative_match = value;
-- priv->tentative_match_len = n_compose;
--
-- ibus_engine_simple_update_preedit_text (simple);
--
-- return TRUE;
-- }
-- }
--
-- if (is_32bit) {
-- output_str = g_ucs4_to_utf8 (table->priv->data_second + index,
-- num, NULL, NULL, &error);
-- if (output_str) {
-- ibus_engine_simple_commit_str(simple, output_str);
-- g_free (output_str);
-- } else {
-- g_warning ("Failed to output multiple characters: %s",
-- error->message);
-- g_error_free (error);
-- }
-- } else {
-- ibus_engine_simple_commit_char (simple, value);
-- }
-- priv->compose_buffer[0] = 0;
-- }
-- ibus_engine_simple_update_preedit_text (simple);
-- return TRUE;
--}
--
--gboolean
--ibus_check_compact_table (const IBusComposeTableCompactEx *table,
-- guint16 *compose_buffer,
-- gint n_compose,
-- gboolean *compose_finish,
-- gunichar **output_chars)
--{
-- gint row_stride;
-- guint16 *seq_index;
-- guint16 *seq;
-- gint i;
--
-- if (compose_finish)
-- *compose_finish = FALSE;
-- if (output_chars)
-- *output_chars = NULL;
--
-- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
--
-- /* Will never match, if the sequence in the compose buffer is longer
-- * than the sequences in the table. Further, compare_seq (key, val)
-- * will overrun val if key is longer than val. */
-- if (n_compose > table->max_seq_len)
-- return FALSE;
--
-- // g_debug ("check_compact_table(n_compose=%d) [%04x, %04x, %04x, %04x]",
-- // n_compose,
-- // compose_buffer[0],
-- // compose_buffer[1],
-- // compose_buffer[2],
-- // compose_buffer[3]);
--
-- seq_index = bsearch (compose_buffer,
-- table->data,
-- table->n_index_size,
-- sizeof (guint16) * table->n_index_stride,
-- compare_seq_index);
--
-- if (seq_index == NULL) {
-- // g_debug ("compact: no\n");
-- return FALSE;
-- }
--
-- if (n_compose == 1) {
-- // g_debug ("compact: yes\n");
-- return TRUE;
-- }
--
-- // g_debug ("compact: %04x ", *seq_index);
-- seq = NULL;
--
-- if (table->priv) {
-- for (i = n_compose - 1; i < table->max_seq_len; i++) {
-- row_stride = i + 2;
--
-- if (seq_index[i + 1] - seq_index[i] > 0) {
-- seq = bsearch (compose_buffer + 1,
-- table->data + seq_index[i],
-- (seq_index[i + 1] - seq_index[i]) / row_stride,
-- sizeof (guint16) * row_stride,
-- compare_seq);
-- if (seq) {
-- if (i == n_compose - 1)
-- break;
-- else
-- return TRUE;
-- }
-- }
-- }
-- if (!seq) {
-- return FALSE;
-- } else {
-- int index = seq[row_stride - 2];
-- int length = seq[row_stride - 1];
-- int j;
-- if (compose_finish)
-- *compose_finish = TRUE;
-- if (output_chars) {
-- *output_chars = g_new (gunichar, length + 1);
-- for (j = 0; j < length; j++)
-- (*output_chars)[j] = table->priv->data2[index + j];
-- (*output_chars)[length] = 0;
-- }
--
-- // g_debug ("U+%04X\n", value);
-- return TRUE;
-- }
-- } else {
-- for (i = n_compose - 1; i < table->max_seq_len; i++) {
-- row_stride = i + 1;
--
-- if (seq_index[i + 1] - seq_index[i] > 0) {
-- seq = bsearch (compose_buffer + 1,
-- table->data + seq_index[i],
-- (seq_index[i + 1] - seq_index[i]) / row_stride,
-- sizeof (guint16) * row_stride,
-- compare_seq);
--
-- if (seq) {
-- if (i == n_compose - 1)
-- break;
-- else
-- return TRUE;
-- }
-- }
-- }
-- if (!seq) {
-- return FALSE;
-- } else {
-- if (compose_finish)
-- *compose_finish = TRUE;
-- if (output_chars) {
-- *output_chars = g_new (gunichar, 2);
-- (*output_chars)[0] = seq[row_stride - 1];
-- (*output_chars)[1] = 0;
-- }
--
-- // g_debug ("U+%04X\n", value);
-- return TRUE;
-- }
-- }
--
-- g_assert_not_reached ();
--}
--
--
--/* Checks if a keysym is a dead key. Dead key keysym values are defined in
-- * ../gdk/gdkkeysyms.h and the first is GDK_KEY_dead_grave. As X.Org is updated,
-- * more dead keys are added and we need to update the upper limit.
-- * Currently, the upper limit is GDK_KEY_dead_dasia+1. The +1 has to do with
-- * a temporary issue in the X.Org header files.
-- * In future versions it will be just the keysym (no +1).
-- */
--#define IS_DEAD_KEY(k) \
-- ((k) >= IBUS_KEY_dead_grave && (k) <= (IBUS_KEY_dead_dasia + 1))
--
--/* This function receives a sequence of Unicode characters and tries to
-- * normalize it (NFC). We check for the case the the resulting string
-- * has length 1 (single character).
-- * NFC normalisation normally rearranges diacritic marks, unless these
-- * belong to the same Canonical Combining Class.
-- * If they belong to the same canonical combining class, we produce all
-- * permutations of the diacritic marks, then attempt to normalize.
-- */
--static gboolean
--check_normalize_nfc (gunichar* combination_buffer, gint n_compose)
--{
-- gunichar combination_buffer_temp[IBUS_MAX_COMPOSE_LEN];
-- gchar *combination_utf8_temp = NULL;
-- gchar *nfc_temp = NULL;
-- gint n_combinations;
-- gunichar temp_swap;
-- gint i;
--
-- n_combinations = 1;
--
-- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
--
-- for (i = 1; i < n_compose; i++ )
-- n_combinations *= i;
--
-- /* Xorg reuses dead_tilde for the perispomeni diacritic mark.
-- * We check if base character belongs to Greek Unicode block,
-- * and if so, we replace tilde with perispomeni. */
-- if (combination_buffer[0] >= 0x390 && combination_buffer[0] <= 0x3FF) {
-- for (i = 1; i < n_compose; i++ )
-- if (combination_buffer[i] == 0x303)
-- combination_buffer[i] = 0x342;
-- }
--
-- memcpy (combination_buffer_temp,
-- combination_buffer,
-- IBUS_MAX_COMPOSE_LEN * sizeof (gunichar) );
--
-- for (i = 0; i < n_combinations; i++ ) {
-- g_unicode_canonical_ordering (combination_buffer_temp, n_compose);
-- combination_utf8_temp = g_ucs4_to_utf8 (combination_buffer_temp, -1, NULL, NULL, NULL);
-- nfc_temp = g_utf8_normalize (combination_utf8_temp, -1, G_NORMALIZE_NFC);
--
-- if (g_utf8_strlen (nfc_temp, -1) == 1) {
-- memcpy (combination_buffer,
-- combination_buffer_temp,
-- IBUS_MAX_COMPOSE_LEN * sizeof (gunichar) );
--
-- g_free (combination_utf8_temp);
-- g_free (nfc_temp);
--
-- return TRUE;
-- }
--
-- g_free (combination_utf8_temp);
-- g_free (nfc_temp);
--
-- if (n_compose > 2) {
-- gint j = i % (n_compose - 1) + 1;
-- gint k = (i+1) % (n_compose - 1) + 1;
-- if (j >= IBUS_MAX_COMPOSE_LEN) {
-- g_warning ("j >= IBUS_MAX_COMPOSE_LEN for " \
-- "combination_buffer_temp");
-- break;
-- }
-- if (k >= IBUS_MAX_COMPOSE_LEN) {
-- g_warning ("k >= IBUS_MAX_COMPOSE_LEN for " \
-- "combination_buffer_temp");
-- break;
-- }
-- temp_swap = combination_buffer_temp[j];
-- combination_buffer_temp[j] = combination_buffer_temp[k];
-- combination_buffer_temp[k] = temp_swap;
-- }
-- else
-- break;
-- }
--
-- return FALSE;
--}
--
--gboolean
--ibus_check_algorithmically (const guint16 *compose_buffer,
-- gint n_compose,
-- gunichar *output_char)
--
--{
-- gint i;
-- gunichar combination_buffer[IBUS_MAX_COMPOSE_LEN];
-- gchar *combination_utf8, *nfc;
--
-- if (output_char)
-- *output_char = 0;
--
-- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
--
-- if (n_compose >= IBUS_MAX_COMPOSE_LEN)
-- return FALSE;
--
-- for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
-- ;
-- if (i == n_compose)
-- return TRUE;
--
-- if (i > 0 && i == n_compose - 1) {
-- combination_buffer[0] = ibus_keyval_to_unicode (compose_buffer[i]);
-- combination_buffer[n_compose] = 0;
-- i--;
-- while (i >= 0) {
-- combination_buffer[i+1] = ibus_keysym_to_unicode (compose_buffer[i],
-- TRUE);
-- if (!combination_buffer[i+1]) {
-- combination_buffer[i+1] =
-- ibus_keyval_to_unicode (compose_buffer[i]);
-- }
-- i--;
-- }
--
-- /* If the buffer normalizes to a single character,
-- * then modify the order of combination_buffer accordingly, if necessary,
-- * and return TRUE.
-- */
-- if (check_normalize_nfc (combination_buffer, n_compose)) {
-- combination_utf8 = g_ucs4_to_utf8 (combination_buffer, -1, NULL, NULL, NULL);
-- nfc = g_utf8_normalize (combination_utf8, -1, G_NORMALIZE_NFC);
--
-- if (output_char)
-- *output_char = g_utf8_get_char (nfc);
--
-- g_free (combination_utf8);
-- g_free (nfc);
--
-- return TRUE;
-- }
-- }
--
-- return FALSE;
--}
-
- static gboolean
- no_sequence_matches (IBusEngineSimple *simple,
-@@ -1184,34 +703,71 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- gint n_compose)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
-- gboolean compose_finish;
-- gunichar output_char;
-+ gboolean compose_finish = FALSE;
-+ gboolean compose_match = FALSE;
-+ GString *output = g_string_new ("");
-+ gboolean does_hit = FALSE;
-+ gboolean is_32bit = FALSE;
-+ GSList *tmp_list;
- gunichar *output_chars = NULL;
-- gchar *output_str = NULL;
-- GError *error = NULL;
-- GSList *list = global_tables;
-+ gunichar output_char;
-
-- while (list) {
-- if (check_table (simple,
-- (IBusComposeTableEx *)list->data,
-+ G_LOCK (global_tables);
-+ tmp_list = global_tables;
-+ while (tmp_list) {
-+ is_32bit = FALSE;
-+ if (ibus_compose_table_check (
-+ (IBusComposeTableEx *)tmp_list->data,
-+ priv->compose_buffer,
- n_compose,
-- FALSE)) {
-- return TRUE;
-+ &compose_finish,
-+ &compose_match,
-+ output,
-+ is_32bit)) {
-+ does_hit = TRUE;
-+ break;
- }
-- if (check_table (simple,
-- (IBusComposeTableEx *)list->data,
-+ is_32bit = TRUE;
-+ if (ibus_compose_table_check (
-+ (IBusComposeTableEx *)tmp_list->data,
-+ priv->compose_buffer,
- n_compose,
-- TRUE)) {
-- return TRUE;
-+ &compose_finish,
-+ &compose_match,
-+ output,
-+ is_32bit)) {
-+ does_hit = TRUE;
-+ break;
- }
-- list = list->next;
-+ tmp_list = tmp_list->next;
- }
-+ G_UNLOCK (global_tables);
-
-- if (ibus_check_compact_table (&ibus_compose_table_compact,
-- priv->compose_buffer,
-- n_compose,
-- &compose_finish,
-- &output_chars)) {
-+ if (does_hit) {
-+ if (compose_finish) {
-+ if (compose_match) {
-+ if (is_32bit) {
-+ ibus_engine_simple_commit_str (simple, output->str);
-+ } else {
-+ ibus_engine_simple_commit_char (simple,
-+ g_utf8_get_char (output->str));
-+ }
-+ }
-+ } else if (compose_match) {
-+ priv->tentative_match = g_utf8_get_char (output->str);
-+ priv->tentative_match_len = n_compose;
-+ }
-+ ibus_engine_simple_update_preedit_text (simple);
-+ g_string_free (output, TRUE);
-+ return TRUE;
-+ }
-+ g_string_free (output, TRUE);
-+
-+ if (ibus_compose_table_compact_check (&ibus_compose_table_compact,
-+ priv->compose_buffer,
-+ n_compose,
-+ &compose_finish,
-+ &output_chars)) {
- if (compose_finish) {
- ibus_engine_simple_commit_char (simple, *output_chars);
- g_free (output_chars);
-@@ -1220,28 +776,29 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- ibus_engine_simple_update_preedit_text (simple);
- return TRUE;
- }
-- if (ibus_check_compact_table (&ibus_compose_table_compact_32bit,
-- priv->compose_buffer,
-- n_compose,
-- &compose_finish,
-- &output_chars)) {
-+ if (ibus_compose_table_compact_check (&ibus_compose_table_compact_32bit,
-+ priv->compose_buffer,
-+ n_compose,
-+ &compose_finish,
-+ &output_chars)) {
- if (compose_finish) {
-- output_str = g_ucs4_to_utf8 (output_chars, -1, NULL, NULL, &error);
-- if (output_str) {
-- ibus_engine_simple_commit_str (simple, output_str);
-- g_free (output_str);
-+ GError *error = NULL;
-+ char *str = g_ucs4_to_utf8 (output_chars, -1, NULL, NULL, &error);
-+ if (str) {
-+ ibus_engine_simple_commit_str (simple, str);
-+ g_free (str);
- } else {
- g_warning ("Failed to output multiple characters: %s",
- error->message);
- g_error_free (error);
- }
-- g_free (output_chars);
- priv->compose_buffer[0] = 0;
- }
--
-+ g_free (output_chars);
- ibus_engine_simple_update_preedit_text (simple);
- return TRUE;
- }
-+ g_assert (!output_chars);
- if (ibus_check_algorithmically (priv->compose_buffer,
- n_compose,
- &output_char)) {
-diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index 508d9344..47f2a3d4 100644
---- a/src/ibusenginesimpleprivate.h
-+++ b/src/ibusenginesimpleprivate.h
-@@ -37,15 +37,30 @@ struct _IBusComposeTablePrivate
- gsize second_size;
- };
-
-+struct _IBusComposeTableCompactPrivate
-+{
-+ const guint32 *data2;
-+};
-+
- gboolean ibus_check_algorithmically (const guint16 *compose_buffer,
- gint n_compose,
- gunichar *output);
--gboolean ibus_check_compact_table (const IBusComposeTableCompactEx
-+gboolean ibus_compose_table_check (const IBusComposeTableEx *table,
-+ guint16 *compose_buffer,
-+ gint n_compose,
-+ gboolean *compose_finish,
-+ gboolean *compose_match,
-+ GString *output,
-+ gboolean is_32bit);
-+gboolean ibus_compose_table_compact_check
-+ (const IBusComposeTableCompactEx
- *table,
- guint16 *compose_buffer,
- gint n_compose,
- gboolean *compose_finish,
- gunichar **output_chars);
-+gunichar ibus_keysym_to_unicode (guint16 keysym,
-+ gboolean combining);
-
- G_END_DECLS
-
-diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
-index 0a2e523c..13c06eb4 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-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2007-2018 Red Hat, Inc.
- #
- # This library is free software; you can redistribute it and/or
-@@ -30,6 +30,7 @@ AM_CPPFLAGS = \
- @GLIB2_CFLAGS@ \
- @GIO2_CFLAGS@ \
- -DIBUS_DISABLE_DEPRECATION_WARNINGS \
-+ -DX11_DATA_PREFIX=\"$(X11_PREFIX)\" \
- -I$(top_srcdir)/src \
- -I$(top_builddir)/src \
- $(NULL)
-diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c
-index 81bfc69b..0be01d27 100644
---- a/src/tests/ibus-compose.c
-+++ b/src/tests/ibus-compose.c
-@@ -6,6 +6,7 @@
- #define GREEN "\033[0;32m"
- #define RED "\033[0;31m"
- #define NC "\033[0m"
-+#define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
-
- IBusBus *m_bus;
- gchar *m_compose_file;
-@@ -35,7 +36,7 @@ get_compose_path ()
- break;
- if (g_strcmp0 (*l, "C") == 0)
- break;
-- compose_path = g_build_filename ("/usr/share/X11/locale",
-+ compose_path = g_build_filename (X11_DATADIR,
- *l,
- "Compose",
- NULL);
-@@ -155,7 +156,7 @@ set_engine_cb (GObject *object, GAsyncResult *res, gpointer data)
- for (i = 0;
- i < (m_compose_table->n_seqs * index_stride);
- i += index_stride) {
-- for (j = i; j < i + (index_stride - 1); j++) {
-+ for (j = i; j < i + (index_stride - 2); j++) {
- guint keyval = m_compose_table->data[j];
- guint keycode = 0;
- guint modifiers = 0;
-@@ -175,7 +176,7 @@ set_engine_cb (GObject *object, GAsyncResult *res, gpointer data)
- for (i = 0;
- i < (priv->first_n_seqs * index_stride);
- i += index_stride) {
-- for (j = i; j < i + (index_stride - 1); j++) {
-+ for (j = i; j < i + (index_stride - 2); j++) {
- guint keyval = priv->data_first[j];
- guint keycode = 0;
- guint modifiers = 0;
---
-2.28.0
-
-From 2fc1a028aa697f1320d85a76548cde12894bf9ab Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:52:18 +0900
-Subject: [PATCH 2/6] src/ibusenginesimple: Multi_key to 0xB7
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Use · instead of ⎄ to display Multi_key in pre-edit.
-
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3669
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3220
----
- src/ibuscomposetable.c | 8 ++++++-
- src/ibusenginesimple.c | 49 ++++++++++++++++++++----------------------
- 2 files changed, 30 insertions(+), 27 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index f85177a6..4ebf119b 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1846,7 +1846,13 @@ ibus_keysym_to_unicode (guint16 keysym,
- CASE_COMBINE (tilde, 0x0303, 0x007E);
- CASE_COMBINE (voiced_sound, 0x3099, 0x309B);
- case IBUS_KEY_Multi_key:
-- return 0x2384;
-+ /* 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;
- default:;
- }
- return 0x0;
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 4644620b..57ca10c4 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -289,32 +289,27 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
-
-- gunichar outbuf[COMPOSE_BUFFER_SIZE + 1];
-- int len = 0;
-+ GString *s = g_string_new ("");
-
- if (priv->in_hex_sequence || priv->in_emoji_sequence) {
- int hexchars = 0;
-
- if (priv->in_hex_sequence)
-- outbuf[0] = L'u';
-+ g_string_append_c (s, 'u');
- else
-- outbuf[0] = L'@';
--
-- len = 1;
-+ g_string_append_c (s, '@');
-
- while (priv->compose_buffer[hexchars] != 0) {
-- outbuf[len] = ibus_keyval_to_unicode (
-- priv->compose_buffer[hexchars]);
-- ++len;
-- ++hexchars;
-+ g_string_append_unichar(
-+ s,
-+ ibus_keyval_to_unicode (priv->compose_buffer[hexchars++])
-+ );
- }
--
-- g_assert (len <= COMPOSE_BUFFER_SIZE);
- } else if (priv->tentative_match) {
-- outbuf[len++] = priv->tentative_match;
-+ g_string_append_unichar(s, priv->tentative_match);
- } else if (priv->tentative_emoji && *priv->tentative_emoji) {
- IBusText *text = ibus_text_new_from_string (priv->tentative_emoji);
-- len = strlen (priv->tentative_emoji);
-+ int len = strlen (priv->tentative_emoji);
- ibus_text_append_attribute (text,
- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
-@@ -324,31 +319,33 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- while (priv->compose_buffer[hexchars] != 0) {
- guint16 keysym = priv->compose_buffer[hexchars];
- gunichar unichar = ibus_keysym_to_unicode (keysym, FALSE);
-- if (unichar > 0)
-- outbuf[len] = unichar;
-- else
-- outbuf[len] = ibus_keyval_to_unicode (keysym);
-- if (!outbuf[len]) {
-+ if (unichar > 0) {
-+ g_string_append_unichar(s, unichar);
-+ } else {
-+ unichar = ibus_keyval_to_unicode (keysym);
-+ g_string_append_unichar(s, unichar);
-+ }
-+ if (!unichar) {
- g_warning (
- "Not found alternative character of compose key 0x%X",
- priv->compose_buffer[hexchars]);
- }
-- ++len;
- ++hexchars;
- }
-- g_assert (len <= IBUS_MAX_COMPOSE_LEN);
- }
-
-- outbuf[len] = L'\0';
-- if (len == 0) {
-+ if (s->len == 0) {
- ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-- }
-- else {
-- IBusText *text = ibus_text_new_from_ucs4 (outbuf);
-+ } else if (s->len >= G_MAXINT) {
-+ g_warning ("%s is too long compose length: %lu", s->str, s->len);
-+ } else {
-+ int len = (int)s->len;
-+ IBusText *text = ibus_text_new_from_string (s->str);
- ibus_text_append_attribute (text,
- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
- }
-+ g_string_free (s, TRUE);
- }
-
-
---
-2.28.0
-
-From 3e2609e68c9107ce7c65e2d5876bfdc9f0f8c854 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:52:21 +0900
-Subject: [PATCH 3/6] src: Update ibuskeysyms.h for latest dead keys
-
----
- src/ibuskeysyms.h | 186 +++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 185 insertions(+), 1 deletion(-)
-
-diff --git a/src/ibuskeysyms.h b/src/ibuskeysyms.h
-index d35eb4a7..2fb2ea19 100644
---- a/src/ibuskeysyms.h
-+++ b/src/ibuskeysyms.h
-@@ -274,6 +274,10 @@
- #define IBUS_KEY_dead_invertedbreve 0xfe6d
- #define IBUS_KEY_dead_belowcomma 0xfe6e
- #define IBUS_KEY_dead_currency 0xfe6f
-+#define IBUS_KEY_dead_lowline 0xfe90
-+#define IBUS_KEY_dead_aboveverticalline 0xfe91
-+#define IBUS_KEY_dead_belowverticalline 0xfe92
-+#define IBUS_KEY_dead_longsolidusoverlay 0xfe93
- #define IBUS_KEY_dead_a 0xfe80
- #define IBUS_KEY_dead_A 0xfe81
- #define IBUS_KEY_dead_e 0xfe82
-@@ -1201,6 +1205,7 @@
- #define IBUS_KEY_leftdoublequotemark 0xad2
- #define IBUS_KEY_rightdoublequotemark 0xad3
- #define IBUS_KEY_prescription 0xad4
-+#define IBUS_KEY_permille 0xad5
- #define IBUS_KEY_minutes 0xad6
- #define IBUS_KEY_seconds 0xad7
- #define IBUS_KEY_latincross 0xad9
-@@ -1633,8 +1638,8 @@
- #define IBUS_KEY_ocaron 0x10001d2
- #define IBUS_KEY_obarred 0x1000275
- #define IBUS_KEY_SCHWA 0x100018f
--#define IBUS_KEY_EZH 0x10001b7
- #define IBUS_KEY_schwa 0x1000259
-+#define IBUS_KEY_EZH 0x10001b7
- #define IBUS_KEY_ezh 0x1000292
- #define IBUS_KEY_Lbelowdot 0x1001e36
- #define IBUS_KEY_lbelowdot 0x1001e37
-@@ -2121,5 +2126,184 @@
- #define IBUS_KEY_Sinh_ruu2 0x1000df2
- #define IBUS_KEY_Sinh_luu2 0x1000df3
- #define IBUS_KEY_Sinh_kunddaliya 0x1000df4
-+#define IBUS_KEY_ModeLock 0x1008ff01
-+#define IBUS_KEY_MonBrightnessUp 0x1008ff02
-+#define IBUS_KEY_MonBrightnessDown 0x1008ff03
-+#define IBUS_KEY_KbdLightOnOff 0x1008ff04
-+#define IBUS_KEY_KbdBrightnessUp 0x1008ff05
-+#define IBUS_KEY_KbdBrightnessDown 0x1008ff06
-+#define IBUS_KEY_Standby 0x1008ff10
-+#define IBUS_KEY_AudioLowerVolume 0x1008ff11
-+#define IBUS_KEY_AudioMute 0x1008ff12
-+#define IBUS_KEY_AudioRaiseVolume 0x1008ff13
-+#define IBUS_KEY_AudioPlay 0x1008ff14
-+#define IBUS_KEY_AudioStop 0x1008ff15
-+#define IBUS_KEY_AudioPrev 0x1008ff16
-+#define IBUS_KEY_AudioNext 0x1008ff17
-+#define IBUS_KEY_HomePage 0x1008ff18
-+#define IBUS_KEY_Mail 0x1008ff19
-+#define IBUS_KEY_Start 0x1008ff1a
-+#define IBUS_KEY_Search 0x1008ff1b
-+#define IBUS_KEY_AudioRecord 0x1008ff1c
-+#define IBUS_KEY_Calculator 0x1008ff1d
-+#define IBUS_KEY_Memo 0x1008ff1e
-+#define IBUS_KEY_ToDoList 0x1008ff1f
-+#define IBUS_KEY_Calendar 0x1008ff20
-+#define IBUS_KEY_PowerDown 0x1008ff21
-+#define IBUS_KEY_ContrastAdjust 0x1008ff22
-+#define IBUS_KEY_RockerUp 0x1008ff23
-+#define IBUS_KEY_RockerDown 0x1008ff24
-+#define IBUS_KEY_RockerEnter 0x1008ff25
-+#define IBUS_KEY_Back 0x1008ff26
-+#define IBUS_KEY_Forward 0x1008ff27
-+#define IBUS_KEY_Stop 0x1008ff28
-+#define IBUS_KEY_Refresh 0x1008ff29
-+#define IBUS_KEY_PowerOff 0x1008ff2a
-+#define IBUS_KEY_WakeUp 0x1008ff2b
-+#define IBUS_KEY_Eject 0x1008ff2c
-+#define IBUS_KEY_ScreenSaver 0x1008ff2d
-+#define IBUS_KEY_WWW 0x1008ff2e
-+#define IBUS_KEY_Sleep 0x1008ff2f
-+#define IBUS_KEY_Favorites 0x1008ff30
-+#define IBUS_KEY_AudioPause 0x1008ff31
-+#define IBUS_KEY_AudioMedia 0x1008ff32
-+#define IBUS_KEY_MyComputer 0x1008ff33
-+#define IBUS_KEY_VendorHome 0x1008ff34
-+#define IBUS_KEY_LightBulb 0x1008ff35
-+#define IBUS_KEY_Shop 0x1008ff36
-+#define IBUS_KEY_History 0x1008ff37
-+#define IBUS_KEY_OpenURL 0x1008ff38
-+#define IBUS_KEY_AddFavorite 0x1008ff39
-+#define IBUS_KEY_HotLinks 0x1008ff3a
-+#define IBUS_KEY_BrightnessAdjust 0x1008ff3b
-+#define IBUS_KEY_Finance 0x1008ff3c
-+#define IBUS_KEY_Community 0x1008ff3d
-+#define IBUS_KEY_AudioRewind 0x1008ff3e
-+#define IBUS_KEY_BackForward 0x1008ff3f
-+#define IBUS_KEY_Launch0 0x1008ff40
-+#define IBUS_KEY_Launch1 0x1008ff41
-+#define IBUS_KEY_Launch2 0x1008ff42
-+#define IBUS_KEY_Launch3 0x1008ff43
-+#define IBUS_KEY_Launch4 0x1008ff44
-+#define IBUS_KEY_Launch5 0x1008ff45
-+#define IBUS_KEY_Launch6 0x1008ff46
-+#define IBUS_KEY_Launch7 0x1008ff47
-+#define IBUS_KEY_Launch8 0x1008ff48
-+#define IBUS_KEY_Launch9 0x1008ff49
-+#define IBUS_KEY_LaunchA 0x1008ff4a
-+#define IBUS_KEY_LaunchB 0x1008ff4b
-+#define IBUS_KEY_LaunchC 0x1008ff4c
-+#define IBUS_KEY_LaunchD 0x1008ff4d
-+#define IBUS_KEY_LaunchE 0x1008ff4e
-+#define IBUS_KEY_LaunchF 0x1008ff4f
-+#define IBUS_KEY_ApplicationLeft 0x1008ff50
-+#define IBUS_KEY_ApplicationRight 0x1008ff51
-+#define IBUS_KEY_Book 0x1008ff52
-+#define IBUS_KEY_CD 0x1008ff53
-+#define IBUS_KEY_WindowClear 0x1008ff55
-+#define IBUS_KEY_Close 0x1008ff56
-+#define IBUS_KEY_Copy 0x1008ff57
-+#define IBUS_KEY_Cut 0x1008ff58
-+#define IBUS_KEY_Display 0x1008ff59
-+#define IBUS_KEY_DOS 0x1008ff5a
-+#define IBUS_KEY_Documents 0x1008ff5b
-+#define IBUS_KEY_Excel 0x1008ff5c
-+#define IBUS_KEY_Explorer 0x1008ff5d
-+#define IBUS_KEY_Game 0x1008ff5e
-+#define IBUS_KEY_Go 0x1008ff5f
-+#define IBUS_KEY_iTouch 0x1008ff60
-+#define IBUS_KEY_LogOff 0x1008ff61
-+#define IBUS_KEY_Market 0x1008ff62
-+#define IBUS_KEY_Meeting 0x1008ff63
-+#define IBUS_KEY_MenuKB 0x1008ff65
-+#define IBUS_KEY_MenuPB 0x1008ff66
-+#define IBUS_KEY_MySites 0x1008ff67
-+#define IBUS_KEY_New 0x1008ff68
-+#define IBUS_KEY_News 0x1008ff69
-+#define IBUS_KEY_OfficeHome 0x1008ff6a
-+#define IBUS_KEY_Open 0x1008ff6b
-+#define IBUS_KEY_Option 0x1008ff6c
-+#define IBUS_KEY_Paste 0x1008ff6d
-+#define IBUS_KEY_Phone 0x1008ff6e
-+#define IBUS_KEY_Reply 0x1008ff72
-+#define IBUS_KEY_Reload 0x1008ff73
-+#define IBUS_KEY_RotateWindows 0x1008ff74
-+#define IBUS_KEY_RotationPB 0x1008ff75
-+#define IBUS_KEY_RotationKB 0x1008ff76
-+#define IBUS_KEY_Save 0x1008ff77
-+#define IBUS_KEY_ScrollUp 0x1008ff78
-+#define IBUS_KEY_ScrollDown 0x1008ff79
-+#define IBUS_KEY_ScrollClick 0x1008ff7a
-+#define IBUS_KEY_Send 0x1008ff7b
-+#define IBUS_KEY_Spell 0x1008ff7c
-+#define IBUS_KEY_SplitScreen 0x1008ff7d
-+#define IBUS_KEY_Support 0x1008ff7e
-+#define IBUS_KEY_TaskPane 0x1008ff7f
-+#define IBUS_KEY_Terminal 0x1008ff80
-+#define IBUS_KEY_Tools 0x1008ff81
-+#define IBUS_KEY_Travel 0x1008ff82
-+#define IBUS_KEY_UserPB 0x1008ff84
-+#define IBUS_KEY_User1KB 0x1008ff85
-+#define IBUS_KEY_User2KB 0x1008ff86
-+#define IBUS_KEY_Video 0x1008ff87
-+#define IBUS_KEY_WheelButton 0x1008ff88
-+#define IBUS_KEY_Word 0x1008ff89
-+#define IBUS_KEY_Xfer 0x1008ff8a
-+#define IBUS_KEY_ZoomIn 0x1008ff8b
-+#define IBUS_KEY_ZoomOut 0x1008ff8c
-+#define IBUS_KEY_Away 0x1008ff8d
-+#define IBUS_KEY_Messenger 0x1008ff8e
-+#define IBUS_KEY_WebCam 0x1008ff8f
-+#define IBUS_KEY_MailForward 0x1008ff90
-+#define IBUS_KEY_Pictures 0x1008ff91
-+#define IBUS_KEY_Music 0x1008ff92
-+#define IBUS_KEY_Battery 0x1008ff93
-+#define IBUS_KEY_Bluetooth 0x1008ff94
-+#define IBUS_KEY_WLAN 0x1008ff95
-+#define IBUS_KEY_UWB 0x1008ff96
-+#define IBUS_KEY_AudioForward 0x1008ff97
-+#define IBUS_KEY_AudioRepeat 0x1008ff98
-+#define IBUS_KEY_AudioRandomPlay 0x1008ff99
-+#define IBUS_KEY_Subtitle 0x1008ff9a
-+#define IBUS_KEY_AudioCycleTrack 0x1008ff9b
-+#define IBUS_KEY_CycleAngle 0x1008ff9c
-+#define IBUS_KEY_FrameBack 0x1008ff9d
-+#define IBUS_KEY_FrameForward 0x1008ff9e
-+#define IBUS_KEY_Time 0x1008ff9f
-+#define IBUS_KEY_SelectButton 0x1008ffa0
-+#define IBUS_KEY_View 0x1008ffa1
-+#define IBUS_KEY_TopMenu 0x1008ffa2
-+#define IBUS_KEY_Red 0x1008ffa3
-+#define IBUS_KEY_Green 0x1008ffa4
-+#define IBUS_KEY_Yellow 0x1008ffa5
-+#define IBUS_KEY_Blue 0x1008ffa6
-+#define IBUS_KEY_Suspend 0x1008ffa7
-+#define IBUS_KEY_Hibernate 0x1008ffa8
-+#define IBUS_KEY_TouchpadToggle 0x1008ffa9
-+#define IBUS_KEY_TouchpadOn 0x1008ffb0
-+#define IBUS_KEY_TouchpadOff 0x1008ffb1
-+#define IBUS_KEY_AudioMicMute 0x1008ffb2
-+#define IBUS_KEY_Keyboard 0x1008ffb3
-+#define IBUS_KEY_WWAN 0x1008ffb4
-+#define IBUS_KEY_RFKill 0x1008ffb5
-+#define IBUS_KEY_AudioPreset 0x1008ffb6
-+#define IBUS_KEY_Switch_VT_1 0x1008fe01
-+#define IBUS_KEY_Switch_VT_2 0x1008fe02
-+#define IBUS_KEY_Switch_VT_3 0x1008fe03
-+#define IBUS_KEY_Switch_VT_4 0x1008fe04
-+#define IBUS_KEY_Switch_VT_5 0x1008fe05
-+#define IBUS_KEY_Switch_VT_6 0x1008fe06
-+#define IBUS_KEY_Switch_VT_7 0x1008fe07
-+#define IBUS_KEY_Switch_VT_8 0x1008fe08
-+#define IBUS_KEY_Switch_VT_9 0x1008fe09
-+#define IBUS_KEY_Switch_VT_10 0x1008fe0a
-+#define IBUS_KEY_Switch_VT_11 0x1008fe0b
-+#define IBUS_KEY_Switch_VT_12 0x1008fe0c
-+#define IBUS_KEY_Ungrab 0x1008fe20
-+#define IBUS_KEY_ClearGrab 0x1008fe21
-+#define IBUS_KEY_Next_VMode 0x1008fe22
-+#define IBUS_KEY_Prev_VMode 0x1008fe23
-+#define IBUS_KEY_LogWindowTree 0x1008fe24
-+#define IBUS_KEY_LogGrabInfo 0x1008fe25
-
- #endif /* __IBUS_KEYSYMS_H__ */
---
-2.28.0
-
-From df495660a6da492fe0cac8f7fe748f25a1c3217c Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:52:23 +0900
-Subject: [PATCH 4/6] src/ibusenginesimple: Change gint to int
-
----
- src/ibuscomposetable.c | 128 +++++++++++++++++-----------------
- src/ibusenginesimple.c | 58 +++++++--------
- src/ibusenginesimpleprivate.h | 6 +-
- 3 files changed, 96 insertions(+), 96 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 4ebf119b..aa58f136 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -47,7 +47,7 @@
- typedef struct {
- gunichar *sequence;
- gunichar *values;
-- gchar *comment;
-+ char *comment;
- } IBusComposeData;
-
-
-@@ -85,7 +85,7 @@ unichar_length (gunichar *uni_array)
-
-
- static gboolean
--is_codepoint (const gchar *str)
-+is_codepoint (const char *str)
- {
- int i;
-
-@@ -104,11 +104,11 @@ is_codepoint (const gchar *str)
-
- static gboolean
- parse_compose_value (IBusComposeData *compose_data,
-- const gchar *val,
-- const gchar *line)
-+ const char *val,
-+ const char *line)
- {
-- gchar *head, *end, *p;
-- gchar *ustr = NULL;
-+ char *head, *end, *p;
-+ char *ustr = NULL;
- gunichar *uchars = NULL, *up;
- GError *error = NULL;
- int n_uchars = 0;
-@@ -184,10 +184,10 @@ fail:
-
- static int
- parse_compose_sequence (IBusComposeData *compose_data,
-- const gchar *seq,
-- const gchar *line)
-+ const char *seq,
-+ const char *line)
- {
-- gchar **words = g_strsplit (seq, "<", -1);
-+ char **words = g_strsplit (seq, "<", -1);
- int i;
- int n = 0;
-
-@@ -198,9 +198,9 @@ parse_compose_sequence (IBusComposeData *compose_data,
- }
-
- for (i = 1; words[i] != NULL; i++) {
-- gchar *start = words[i];
-- gchar *end = index (words[i], '>');
-- gchar *match;
-+ char *start = words[i];
-+ char *end = index (words[i], '>');
-+ char *match;
- gunichar codepoint;
-
- if (words[i][0] == '\0')
-@@ -256,18 +256,18 @@ fail:
- }
-
-
--static gchar *
--expand_include_path (const gchar *include_path) {
-- gchar *out = strdup ("");
-- const gchar *head, *i;
-- gchar *former, *o;
-+static char *
-+expand_include_path (const char *include_path) {
-+ char *out = strdup ("");
-+ const char *head, *i;
-+ char *former, *o;
-
- for (head = i = include_path; *i; ++i) {
- /* expand sequence */
- if (*i == '%') {
- switch (*(i + 1)) {
- case 'H': { /* $HOME */
-- const gchar *home = getenv ("HOME");
-+ const char *home = getenv ("HOME");
- if (!home) {
- g_warning ("while parsing XCompose include target %s, "
- "%%H replacement failed because HOME is not "
-@@ -325,11 +325,11 @@ fail:
-
- static void
- parse_compose_line (GList **compose_list,
-- const gchar *line,
-+ const char *line,
- int *compose_len,
-- gchar **include)
-+ char **include)
- {
-- gchar **components = NULL;
-+ char **components = NULL;
- IBusComposeData *compose_data = NULL;
- int l;
-
-@@ -395,13 +395,13 @@ fail:
- }
-
-
--static gchar *
-+static char *
- get_en_compose_file (void)
- {
-- gchar * const sys_langs[] = { "en_US.UTF-8", "en_US", "en.UTF-8",
-- "en", NULL };
-- gchar * const *sys_lang = NULL;
-- gchar *path = NULL;
-+ char * const sys_langs[] = { "en_US.UTF-8", "en_US", "en.UTF-8",
-+ "en", NULL };
-+ char * const *sys_lang = NULL;
-+ char *path = NULL;
- for (sys_lang = sys_langs; *sys_lang; sys_lang++) {
- path = g_build_filename (X11_DATADIR, *sys_lang, "Compose", NULL);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
-@@ -413,11 +413,11 @@ get_en_compose_file (void)
-
-
- static GList *
--ibus_compose_list_parse_file (const gchar *compose_file,
-- int *max_compose_len)
-+ibus_compose_list_parse_file (const char *compose_file,
-+ int *max_compose_len)
- {
-- gchar *contents = NULL;
-- gchar **lines = NULL;
-+ char *contents = NULL;
-+ char **lines = NULL;
- gsize length = 0;
- GError *error = NULL;
- GList *compose_list = NULL;
-@@ -435,14 +435,14 @@ ibus_compose_list_parse_file (const gchar *compose_file,
- g_free (contents);
- for (i = 0; lines[i] != NULL; i++) {
- int compose_len = 0;
-- gchar *include = NULL;
-+ char *include = NULL;
- parse_compose_line (&compose_list, lines[i], &compose_len, &include);
- if (*max_compose_len < compose_len)
- *max_compose_len = compose_len;
- if (include && *include) {
- GStatBuf buf_include = { 0, };
- GStatBuf buf_parent = { 0, };
-- gchar *en_compose;
-+ char *en_compose;
- errno = 0;
- if (g_stat (include, &buf_include)) {
- g_warning ("Cannot access %s: %s",
-@@ -588,7 +588,7 @@ ibus_compose_list_check_duplicated (GList *compose_list,
- }
-
-
--static gint
-+static int
- ibus_compose_data_compare (gpointer a,
- gpointer b,
- gpointer data)
-@@ -625,7 +625,7 @@ ibus_compose_list_print (GList *compose_list,
- int i, j;
- IBusComposeData *compose_data;
- int total_size = 0;
-- const gchar *keyval;
-+ const char *keyval;
-
- for (list = compose_list; list != NULL; list = list->next) {
- compose_data = list->data;
-@@ -682,13 +682,13 @@ ibus_compose_table_data_hash (gconstpointer v,
- }
-
-
--static gchar *
-+static char *
- ibus_compose_hash_get_cache_path (guint32 hash)
- {
-- gchar *basename = NULL;
-- const gchar *cache_dir;
-- gchar *dir = NULL;
-- gchar *path = NULL;
-+ char *basename = NULL;
-+ const char *cache_dir;
-+ char *dir = NULL;
-+ char *path = NULL;
-
- basename = g_strdup_printf ("%08x.cache", hash);
-
-@@ -715,7 +715,7 @@ ibus_compose_hash_get_cache_path (guint32 hash)
- static GVariant *
- ibus_compose_table_serialize (IBusComposeTableEx *compose_table)
- {
-- const gchar *header = IBUS_COMPOSE_TABLE_MAGIC;
-+ const char *header = IBUS_COMPOSE_TABLE_MAGIC;
- const guint16 version = IBUS_COMPOSE_TABLE_VERSION;
- guint16 max_seq_len;
- guint16 index_stride;
-@@ -825,7 +825,7 @@ out_serialize:
- }
-
-
--static gint
-+static int
- ibus_compose_table_find (gconstpointer data1,
- gconstpointer data2)
- {
-@@ -837,8 +837,8 @@ ibus_compose_table_find (gconstpointer data1,
-
-
- static IBusComposeTableEx *
--ibus_compose_table_deserialize (const gchar *contents,
-- gsize length)
-+ibus_compose_table_deserialize (const char *contents,
-+ gsize length)
- {
- IBusComposeTableEx *retval = NULL;
- GVariantType *type;
-@@ -846,7 +846,7 @@ ibus_compose_table_deserialize (const gchar *contents,
- GVariant *variant_data_32bit_first = NULL;
- GVariant *variant_data_32bit_second = NULL;
- GVariant *variant_table = NULL;
-- const gchar *header = NULL;
-+ const char *header = NULL;
- guint16 version = 0;
- guint16 max_seq_len = 0;
- guint16 n_seqs = 0;
-@@ -1020,8 +1020,8 @@ ibus_compose_table_load_cache (const gchar *compose_file)
- {
- IBusComposeTableEx *retval = NULL;
- guint32 hash;
-- gchar *path = NULL;
-- gchar *contents = NULL;
-+ char *path = NULL;
-+ char *contents = NULL;
- GStatBuf original_buf;
- GStatBuf cache_buf;
- gsize length = 0;
-@@ -1063,9 +1063,9 @@ ibus_compose_table_load_cache (const gchar *compose_file)
- void
- ibus_compose_table_save_cache (IBusComposeTableEx *compose_table)
- {
-- gchar *path = NULL;
-+ char *path = NULL;
- GVariant *variant_table = NULL;
-- const gchar *contents = NULL;
-+ const char *contents = NULL;
- GError *error = NULL;
- gsize length = 0;
-
-@@ -1392,13 +1392,13 @@ compare_seq (const void *key, const void *value)
- gboolean
- ibus_compose_table_check (const IBusComposeTableEx *table,
- guint16 *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gboolean *compose_finish,
- gboolean *compose_match,
- GString *output,
- gboolean is_32bit)
- {
-- gint row_stride = table->max_seq_len + 2;
-+ int row_stride = table->max_seq_len + 2;
- guint16 *data_first;
- int n_seqs;
- guint16 *seq;
-@@ -1448,7 +1448,7 @@ ibus_compose_table_check (const IBusComposeTableEx *table,
- gunichar value = 0;
- int num = 0;
- int index = 0;
-- gchar *output_str = NULL;
-+ char *output_str = NULL;
- GError *error = NULL;
-
- if (is_32bit) {
-@@ -1526,15 +1526,15 @@ gboolean
- ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
- guint16
- *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gboolean
- *compose_finish,
- gunichar **output_chars)
- {
-- gint row_stride;
-+ int row_stride;
- guint16 *seq_index;
- guint16 *seq;
-- gint i;
-+ int i;
-
- if (compose_finish)
- *compose_finish = FALSE;
-@@ -1654,14 +1654,14 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
- * permutations of the diacritic marks, then attempt to normalize.
- */
- static gboolean
--check_normalize_nfc (gunichar* combination_buffer, gint n_compose)
-+check_normalize_nfc (gunichar* combination_buffer, int n_compose)
- {
- gunichar combination_buffer_temp[IBUS_MAX_COMPOSE_LEN];
-- gchar *combination_utf8_temp = NULL;
-- gchar *nfc_temp = NULL;
-- gint n_combinations;
-+ char *combination_utf8_temp = NULL;
-+ char *nfc_temp = NULL;
-+ int n_combinations;
- gunichar temp_swap;
-- gint i;
-+ int i;
-
- n_combinations = 1;
-
-@@ -1703,8 +1703,8 @@ check_normalize_nfc (gunichar* combination_buffer, gint n_compose)
- g_free (nfc_temp);
-
- if (n_compose > 2) {
-- gint j = i % (n_compose - 1) + 1;
-- gint k = (i+1) % (n_compose - 1) + 1;
-+ int j = i % (n_compose - 1) + 1;
-+ int k = (i+1) % (n_compose - 1) + 1;
- if (j >= IBUS_MAX_COMPOSE_LEN) {
- g_warning ("j >= IBUS_MAX_COMPOSE_LEN for " \
- "combination_buffer_temp");
-@@ -1729,13 +1729,13 @@ check_normalize_nfc (gunichar* combination_buffer, gint n_compose)
-
- gboolean
- ibus_check_algorithmically (const guint16 *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gunichar *output_char)
-
- {
-- gint i;
-+ int i;
- gunichar combination_buffer[IBUS_MAX_COMPOSE_LEN];
-- gchar *combination_utf8, *nfc;
-+ char *combination_utf8, *nfc;
-
- if (output_char)
- *output_char = 0;
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 57ca10c4..699cf0d4 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -79,8 +79,8 @@ typedef struct {
- struct _IBusEngineSimplePrivate {
- guint16 *compose_buffer;
- gunichar tentative_match;
-- gchar *tentative_emoji;
-- gint tentative_match_len;
-+ char *tentative_emoji;
-+ int tentative_match_len;
-
- guint hex_mode_enabled : 1;
- guint in_hex_sequence : 1;
-@@ -142,7 +142,7 @@ static void ibus_engine_simple_candidate_clicked
- static void ibus_engine_simple_commit_char (IBusEngineSimple *simple,
- gunichar ch);
- static void ibus_engine_simple_commit_str (IBusEngineSimple *simple,
-- const gchar *str);
-+ const char *str);
- static void ibus_engine_simple_update_preedit_text
- (IBusEngineSimple *simple);
-
-@@ -260,10 +260,10 @@ ibus_engine_simple_commit_char (IBusEngineSimple *simple,
-
- static void
- ibus_engine_simple_commit_str (IBusEngineSimple *simple,
-- const gchar *str)
-+ const char *str)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
-- gchar *backup_str;
-+ char *backup_str;
-
- g_return_if_fail (str && *str);
-
-@@ -368,15 +368,15 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
-
- static gboolean
- check_hex (IBusEngineSimple *simple,
-- gint n_compose)
-+ int n_compose)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
-
-- gint i;
-+ int i;
- GString *str;
- gulong n;
-- gchar *nptr = NULL;
-- gchar buf[7];
-+ char *nptr = NULL;
-+ char buf[7];
-
- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
-
-@@ -453,14 +453,14 @@ load_emoji_dict ()
-
- static gboolean
- check_emoji_table (IBusEngineSimple *simple,
-- gint n_compose,
-- gint index)
-+ int n_compose,
-+ int index)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
- IBusEngineDict *emoji_dict = priv->emoji_dict;
- GString *str = NULL;
-- gint i;
-- gchar buf[7];
-+ int i;
-+ char buf[7];
- GSList *words = NULL;
-
- g_assert (IBUS_IS_ENGINE_SIMPLE (simple));
-@@ -535,7 +535,7 @@ check_emoji_table (IBusEngineSimple *simple,
-
- static gboolean
- no_sequence_matches (IBusEngineSimple *simple,
-- gint n_compose,
-+ int n_compose,
- guint keyval,
- guint keycode,
- guint modifiers)
-@@ -550,7 +550,7 @@ no_sequence_matches (IBusEngineSimple *simple,
- * match pending.
- */
- if (priv->tentative_match) {
-- gint len = priv->tentative_match_len;
-+ int len = priv->tentative_match_len;
- int i;
-
- ibus_engine_simple_commit_char (simple, priv->tentative_match);
-@@ -615,7 +615,7 @@ ibus_engine_simple_update_lookup_and_aux_table (IBusEngineSimple *simple)
- {
- IBusEngineSimplePrivate *priv;
- guint index, candidates;
-- gchar *aux_label = NULL;
-+ char *aux_label = NULL;
- IBusText *text = NULL;
-
- g_return_if_fail (IBUS_IS_ENGINE_SIMPLE (simple));
-@@ -697,7 +697,7 @@ ibus_engine_simple_set_number_on_lookup_table (IBusEngineSimple *simple,
-
- static gboolean
- ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
-- gint n_compose)
-+ int n_compose)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
- gboolean compose_finish = FALSE;
-@@ -818,7 +818,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- {
- IBusEngineSimple *simple = (IBusEngineSimple *)engine;
- IBusEngineSimplePrivate *priv = simple->priv;
-- gint n_compose = 0;
-+ int n_compose = 0;
- gboolean have_hex_mods;
- gboolean is_hex_start = FALSE;
- gboolean is_emoji_start = FALSE;
-@@ -828,7 +828,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- gboolean is_escape;
- guint hex_keyval;
- guint printable_keyval;
-- gint i;
-+ int i;
-
- while (n_compose <= COMPOSE_BUFFER_SIZE && priv->compose_buffer[n_compose] != 0)
- n_compose++;
-@@ -1274,7 +1274,7 @@ ibus_engine_simple_candidate_clicked (IBusEngine *engine,
- IBusEngineSimple *simple = (IBusEngineSimple *)engine;
- IBusEngineSimplePrivate *priv = simple->priv;
- guint keyval;
-- gint n_compose = 0;
-+ int n_compose = 0;
-
- if (priv->lookup_table == NULL || !priv->lookup_table_visible)
- return;
-@@ -1308,18 +1308,18 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
- {
- /* Now ibus_engine_simple_add_compose_file() always returns TRUE. */
- gboolean retval = TRUE;
-- gchar *path = NULL;
-- const gchar *home;
-+ char *path = NULL;
-+ const char *home;
- #if GLIB_CHECK_VERSION (2, 58, 0)
-- const gchar * const *langs;
-- const gchar * const *lang = NULL;
-+ const char * const *langs;
-+ const char * const *lang = NULL;
- #else
-- const gchar *_locale;
-- gchar **langs = NULL;
-- gchar **lang = NULL;
-+ const char *_locale;
-+ char **langs = NULL;
-+ char **lang = NULL;
- #endif
-- gchar * const sys_langs[] = { "el_gr", "fi_fi", "pt_br", NULL };
-- gchar * const *sys_lang = NULL;
-+ char * const sys_langs[] = { "el_gr", "fi_fi", "pt_br", NULL };
-+ char * const *sys_lang = NULL;
-
- if (locale == NULL) {
- path = g_build_filename (g_get_user_config_dir (),
-diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index 47f2a3d4..5479e553 100644
---- a/src/ibusenginesimpleprivate.h
-+++ b/src/ibusenginesimpleprivate.h
-@@ -43,11 +43,11 @@ struct _IBusComposeTableCompactPrivate
- };
-
- gboolean ibus_check_algorithmically (const guint16 *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gunichar *output);
- gboolean ibus_compose_table_check (const IBusComposeTableEx *table,
- guint16 *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gboolean *compose_finish,
- gboolean *compose_match,
- GString *output,
-@@ -56,7 +56,7 @@ gboolean ibus_compose_table_compact_check
- (const IBusComposeTableCompactEx
- *table,
- guint16 *compose_buffer,
-- gint n_compose,
-+ int n_compose,
- gboolean *compose_finish,
- gunichar **output_chars);
- gunichar ibus_keysym_to_unicode (guint16 keysym,
---
-2.28.0
-
-From 4259f16324d578aa2505cf50f2f23923d8d87e76 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:53:19 +0900
-Subject: [PATCH 5/6] src/ibusenginesimple: Make Compose preedit less intrusive
-
-Tweak the preedit display for Compose sequences to
-be not so distracting. We only show the Compose key
-when it occurs in the middle of the sequence or is
-the only key so far.
-
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3669
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/3220
-BUG=https://blog.gtk.org/2021/03/24/input-revisited/
----
- src/ibuscomposetable.c | 175 +++++++++++---------
- src/ibusenginesimple.c | 301 +++++++++++++++++++++++++---------
- src/ibusenginesimpleprivate.h | 9 +-
- 3 files changed, 325 insertions(+), 160 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index aa58f136..2ad21551 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1523,23 +1523,22 @@ compare_seq_index (const void *key, const void *value)
- * IBusComposeData->values[] is the gunichar array.
- */
- gboolean
--ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
-- guint16
-- *compose_buffer,
-- int n_compose,
-- gboolean
-- *compose_finish,
-- gunichar **output_chars)
-+ibus_compose_table_compact_check (const IBusComposeTableCompactEx
-+ *table,
-+ guint16 *compose_buffer,
-+ int n_compose,
-+ gboolean *compose_finish,
-+ gunichar **output_chars)
- {
- int row_stride;
- guint16 *seq_index;
- guint16 *seq;
- int i;
-
-- if (compose_finish)
-- *compose_finish = FALSE;
-- if (output_chars)
-- *output_chars = NULL;
-+ /* compose_finish and output_chars should not be initialized because
-+ * ibus_compose_table_check() is called at first and
-+ * engine->priv->tentative_match will be preedit after this is called.
-+ */
-
- /* Will never match, if the sequence in the compose buffer is longer
- * than the sequences in the table. Further, compare_seq (key, val)
-@@ -1588,7 +1587,8 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
- if (compose_finish)
- *compose_finish = TRUE;
- if (output_chars) {
-- *output_chars = g_new (gunichar, length + 1);
-+ if (!(*output_chars))
-+ *output_chars = g_new (gunichar, length + 1);
- for (j = 0; j < length; j++) {
- (*output_chars)[j] = table->priv->data2[index + j];
- }
-@@ -1622,7 +1622,8 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
- if (compose_finish)
- *compose_finish = TRUE;
- if (output_chars) {
-- *output_chars = g_new (gunichar, 2);
-+ if (!(*output_chars))
-+ *output_chars = g_new (gunichar, 2);
- (*output_chars)[0] = seq[row_stride - 1];
- (*output_chars)[1] = 0;
- }
-@@ -1635,16 +1636,6 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx *table,
- }
-
-
--/* Checks if a keysym is a dead key. Dead key keysym values are defined in
-- * ../gdk/gdkkeysyms.h and the first is GDK_KEY_dead_grave. As X.Org is updated,
-- * more dead keys are added and we need to update the upper limit.
-- * Currently, the upper limit is GDK_KEY_dead_dasia+1. The +1 has to do with
-- * a temporary issue in the X.Org header files.
-- * In future versions it will be just the keysym (no +1).
-- */
--#define IS_DEAD_KEY(k) \
-- ((k) >= IBUS_KEY_dead_grave && (k) <= IBUS_KEY_dead_greek)
--
- /* This function receives a sequence of Unicode characters and tries to
- * normalize it (NFC). We check for the case the the resulting string
- * has length 1 (single character).
-@@ -1754,7 +1745,8 @@ ibus_check_algorithmically (const guint16 *compose_buffer,
- i--;
- while (i >= 0) {
- combination_buffer[i+1] = ibus_keysym_to_unicode (compose_buffer[i],
-- TRUE);
-+ TRUE,
-+ NULL);
- if (!combination_buffer[i+1]) {
- combination_buffer[i+1] =
- ibus_keyval_to_unicode (compose_buffer[i]);
-@@ -1786,66 +1778,91 @@ ibus_check_algorithmically (const guint16 *compose_buffer,
-
-
- gunichar
--ibus_keysym_to_unicode (guint16 keysym,
-- gboolean combining) {
--#define CASE(keysym_suffix, unicode) \
-- case IBUS_KEY_dead_##keysym_suffix: return unicode
--#define CASE_COMBINE(keysym_suffix, combined_unicode, isolated_unicode) \
-- case IBUS_KEY_dead_##keysym_suffix: \
-- if (combining) \
-- return combined_unicode; \
-- else \
-+ibus_keysym_to_unicode (guint16 keysym,
-+ gboolean combining,
-+ gboolean *need_space) {
-+#define CASE(keysym_suffix, unicode, sp) \
-+ case IBUS_KEY_dead_##keysym_suffix: \
-+ if (need_space) \
-+ *need_space = sp; \
-+ return unicode
-+#define CASE_COMBINE(keysym_suffix, combined_unicode, isolated_unicode, sp) \
-+ case IBUS_KEY_dead_##keysym_suffix: \
-+ if (need_space) \
-+ *need_space = sp; \
-+ if (combining) \
-+ return combined_unicode; \
-+ else \
- return isolated_unicode
- switch (keysym) {
-- CASE (a, 0x03041);
-- CASE (A, 0x03042);
-- CASE (i, 0x03043);
-- CASE (I, 0x03044);
-- CASE (u, 0x03045);
-- CASE (U, 0x03046);
-- CASE (e, 0x03047);
-- CASE (E, 0x03048);
-- CASE (o, 0x03049);
-- CASE (O, 0x0304A);
-- CASE (abovecomma, 0x0313);
-- CASE_COMBINE (abovedot, 0x0307, 0x02D9);
-- CASE (abovereversedcomma, 0x0314);
-- CASE_COMBINE (abovering, 0x030A, 0x02DA);
-- CASE_COMBINE (acute, 0x0301, 0x00B4);
-- CASE (belowbreve, 0x032E);
-- CASE_COMBINE (belowcircumflex, 0x032D, 0xA788);
-- CASE_COMBINE (belowcomma, 0x0326, 0x002C);
-- CASE (belowdiaeresis, 0x0324);
-- CASE_COMBINE (belowdot, 0x0323, 0x002E);
-- CASE_COMBINE (belowmacron, 0x0331, 0x02CD);
-- CASE_COMBINE (belowring, 0x030A, 0x02F3);
-- CASE_COMBINE (belowtilde, 0x0330, 0x02F7);
-- CASE_COMBINE (breve, 0x0306, 0x02D8);
-- CASE_COMBINE (capital_schwa, 0x018F, 0x04D8);
-- CASE_COMBINE (caron, 0x030C, 0x02C7);
-- CASE_COMBINE (cedilla, 0x0327, 0x00B8);
-- CASE_COMBINE (circumflex, 0x0302, 0x005E);
-- CASE (currency, 0x00A4);
-+#ifdef IBUS_ENGLISH_DEAD_KEY
-+ CASE (a, 0x0363, 1);
-+ CASE (A, 0x0363, 1);
-+ CASE (i, 0x0365, 1);
-+ CASE (I, 0x0365, 1);
-+ CASE (u, 0x0367, 1);
-+ CASE (U, 0x0367, 1);
-+ CASE (e, 0x0364, 1);
-+ CASE (E, 0x0364, 1);
-+ CASE (o, 0x0366, 1);
-+ CASE (O, 0x0366, 1);
-+#else
-+ CASE (a, 0x3041, 0);
-+ CASE (A, 0x3042, 0);
-+ CASE (i, 0x3043, 0);
-+ CASE (I, 0x3044, 0);
-+ CASE (u, 0x3045, 0);
-+ CASE (U, 0x3046, 0);
-+ CASE (e, 0x3047, 0);
-+ CASE (E, 0x3048, 0);
-+ CASE (o, 0x3049, 0);
-+ CASE (O, 0x304A, 0);
-+#endif
-+ CASE_COMBINE (abovecomma, 0x0313, 0x02BC, 0);
-+ CASE_COMBINE (abovedot, 0x0307, 0x02D9, 0);
-+ CASE_COMBINE (abovereversedcomma, 0x0314, 0x02BD, 0);
-+ CASE_COMBINE (abovering, 0x030A, 0x02DA, 0);
-+ CASE_COMBINE (aboveverticalline, 0x030D, 0x02C8, 0);
-+ CASE_COMBINE (acute, 0x0301, 0x00B4, 0);
-+ CASE (belowbreve, 0x032E, 1);
-+ CASE_COMBINE (belowcircumflex, 0x032D, 0xA788, 0);
-+ CASE_COMBINE (belowcomma, 0x0326, 0x002C, 0);
-+ CASE (belowdiaeresis, 0x0324, 1);
-+ CASE_COMBINE (belowdot, 0x0323, 0x002E, 0);
-+ CASE_COMBINE (belowmacron, 0x0331, 0x02CD, 0);
-+ CASE_COMBINE (belowring, 0x030A, 0x02F3, 0);
-+ CASE_COMBINE (belowtilde, 0x0330, 0x02F7, 0);
-+ CASE_COMBINE (belowverticalline, 0x0329, 0x02CC, 0);
-+ CASE_COMBINE (breve, 0x0306, 0x02D8, 0);
-+ CASE_COMBINE (capital_schwa, 0x1DEA, 0x1D4A, 0);
-+ CASE_COMBINE (caron, 0x030C, 0x02C7, 0);
-+ CASE_COMBINE (cedilla, 0x0327, 0x00B8, 0);
-+ CASE_COMBINE (circumflex, 0x0302, 0x005E, 0);
-+ CASE (currency, 0x00A4, 0);
- // IBUS_KEY_dead_dasia == IBUS_KEY_dead_abovereversedcomma
-- CASE_COMBINE (diaeresis, 0x0308, 0x00A8);
-- CASE_COMBINE (doubleacute, 0x030B, 0x02DD);
-- CASE_COMBINE (doublegrave, 0x030F, 0x02F5);
-- CASE_COMBINE (grave, 0x0300, 0x0060);
-- CASE (greek, 0x03BC);
-- CASE (hook, 0x0309);
-- CASE (horn, 0x031B);
-- CASE (invertedbreve, 0x032F);
-- CASE_COMBINE (iota, 0x0345, 0x037A);
-- CASE_COMBINE (macron, 0x0304, 0x00AF);
-- CASE_COMBINE (ogonek, 0x0328, 0x02DB);
-+ CASE_COMBINE (diaeresis, 0x0308, 0x00A8, 0);
-+ CASE_COMBINE (doubleacute, 0x030B, 0x02DD, 0);
-+ CASE_COMBINE (doublegrave, 0x030F, 0x02F5, 0);
-+ CASE_COMBINE (grave, 0x0300, 0x0060, 0);
-+ CASE (greek, 0x03BC, 0);
-+ CASE_COMBINE (hook, 0x0309, 0x02C0, 0);
-+ CASE (horn, 0x031B, 1);
-+ CASE (invertedbreve, 0x032F, 1);
-+ CASE_COMBINE (iota, 0x0345, 0x037A, 0);
-+ CASE (longsolidusoverlay, 0x0338, 1);
-+ CASE_COMBINE (lowline, 0x0332, 0x005F, 0);
-+ CASE_COMBINE (macron, 0x0304, 0x00AF, 0);
-+ CASE_COMBINE (ogonek, 0x0328, 0x02DB, 0);
- // IBUS_KEY_dead_perispomeni == IBUS_KEY_dead_tilde
- // IBUS_KEY_dead_psili == IBUS_KEY_dead_abovecomma
-- CASE_COMBINE (semivoiced_sound, 0x309A, 0x309C);
-- CASE_COMBINE (small_schwa, 0x1D4A, 0x04D9);
-- CASE (stroke, 0x002F);
-- CASE_COMBINE (tilde, 0x0303, 0x007E);
-- CASE_COMBINE (voiced_sound, 0x3099, 0x309B);
-+ CASE_COMBINE (semivoiced_sound, 0x309A, 0x309C, 0);
-+ CASE_COMBINE (small_schwa, 0x1DEA, 0x1D4A, 0);
-+ 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,
-@@ -1854,6 +1871,8 @@ ibus_keysym_to_unicode (guint16 keysym,
- */
- return 0x00B7;
- default:;
-+ if (need_space)
-+ *need_space = FALSE;
- }
- return 0x0;
- #undef CASE
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 699cf0d4..acfc0264 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -78,13 +78,14 @@ typedef struct {
-
- struct _IBusEngineSimplePrivate {
- guint16 *compose_buffer;
-- gunichar tentative_match;
-- char *tentative_emoji;
-+ GString *tentative_match;
- int tentative_match_len;
-+ char *tentative_emoji;
-
- guint hex_mode_enabled : 1;
- guint in_hex_sequence : 1;
- guint in_emoji_sequence : 1;
-+ guint in_compose_sequence : 1;
- guint modifiers_dropped : 1;
- IBusEngineDict *emoji_dict;
- IBusLookupTable *lookup_table;
-@@ -178,6 +179,8 @@ ibus_engine_simple_init (IBusEngineSimple *simple)
- simple->priv->hex_mode_enabled =
- g_getenv("IBUS_ENABLE_CTRL_SHIFT_U") != NULL ||
- g_getenv("IBUS_ENABLE_CONTROL_SHIFT_U") != NULL;
-+ simple->priv->tentative_match = g_string_new ("");
-+ simple->priv->tentative_match_len = 0;
- }
-
-
-@@ -196,6 +199,9 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple)
- g_clear_object (&priv->lookup_table);
- g_clear_pointer (&priv->compose_buffer, g_free);
- g_clear_pointer (&priv->tentative_emoji, g_free);
-+ g_string_free (priv->tentative_match, TRUE);
-+ priv->tentative_match = NULL;
-+ priv->tentative_match_len = 0;
-
- IBUS_OBJECT_CLASS(ibus_engine_simple_parent_class)->destroy (
- IBUS_OBJECT (simple));
-@@ -222,15 +228,15 @@ ibus_engine_simple_reset (IBusEngine *engine)
-
- priv->compose_buffer[0] = 0;
-
-- if (priv->tentative_match || priv->in_hex_sequence) {
-+ if (priv->tentative_match->len > 0 || priv->in_hex_sequence) {
- priv->in_hex_sequence = FALSE;
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- priv->tentative_match_len = 0;
- } else if (priv->tentative_emoji || priv->in_emoji_sequence) {
- priv->in_emoji_sequence = FALSE;
- g_clear_pointer (&priv->tentative_emoji, g_free);
- } else if (!priv->in_hex_sequence && !priv->in_emoji_sequence) {
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- priv->tentative_match_len = 0;
- }
- ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-@@ -244,10 +250,17 @@ ibus_engine_simple_commit_char (IBusEngineSimple *simple,
-
- IBusEngineSimplePrivate *priv = simple->priv;
-
-- if (priv->tentative_match || priv->in_hex_sequence) {
-- priv->in_hex_sequence = FALSE;
-- priv->tentative_match = 0;
-+ if (priv->in_hex_sequence ||
-+ priv->tentative_match_len > 0 ||
-+ priv->compose_buffer[0] != 0) {
-+ g_string_set_size (priv->tentative_match, 0);
- priv->tentative_match_len = 0;
-+ priv->in_hex_sequence = FALSE;
-+ priv->in_compose_sequence = FALSE;
-+ priv->compose_buffer[0] = 0;
-+ /* Don't call ibus_engine_simple_update_preedit_text() inside
-+ * not to call it as duplilcated.
-+ */
- }
- if (priv->tentative_emoji || priv->in_emoji_sequence) {
- priv->in_emoji_sequence = FALSE;
-@@ -269,10 +282,17 @@ ibus_engine_simple_commit_str (IBusEngineSimple *simple,
-
- backup_str = g_strdup (str);
-
-- if (priv->tentative_match || priv->in_hex_sequence) {
-- priv->in_hex_sequence = FALSE;
-- priv->tentative_match = 0;
-+ if (priv->in_hex_sequence ||
-+ priv->tentative_match_len > 0 ||
-+ priv->compose_buffer[0] != 0) {
-+ g_string_set_size (priv->tentative_match, 0);
- priv->tentative_match_len = 0;
-+ priv->in_hex_sequence = FALSE;
-+ priv->in_compose_sequence = FALSE;
-+ priv->compose_buffer[0] = 0;
-+ /* Don't call ibus_engine_simple_update_preedit_text() inside
-+ * not to call it as duplilcated.
-+ */
- }
- if (priv->tentative_emoji || priv->in_emoji_sequence) {
- priv->in_emoji_sequence = FALSE;
-@@ -288,8 +308,8 @@ static void
- ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
--
- GString *s = g_string_new ("");
-+ int i, j;
-
- if (priv->in_hex_sequence || priv->in_emoji_sequence) {
- int hexchars = 0;
-@@ -305,32 +325,59 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- ibus_keyval_to_unicode (priv->compose_buffer[hexchars++])
- );
- }
-- } else if (priv->tentative_match) {
-- g_string_append_unichar(s, priv->tentative_match);
- } else if (priv->tentative_emoji && *priv->tentative_emoji) {
- IBusText *text = ibus_text_new_from_string (priv->tentative_emoji);
- int len = strlen (priv->tentative_emoji);
- ibus_text_append_attribute (text,
- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
-+ g_string_free (s, TRUE);
- return;
-- } else {
-- int hexchars = 0;
-- while (priv->compose_buffer[hexchars] != 0) {
-- guint16 keysym = priv->compose_buffer[hexchars];
-- gunichar unichar = ibus_keysym_to_unicode (keysym, FALSE);
-- if (unichar > 0) {
-- g_string_append_unichar(s, unichar);
-- } else {
-- unichar = ibus_keyval_to_unicode (keysym);
-- g_string_append_unichar(s, unichar);
-- }
-- if (!unichar) {
-- g_warning (
-+ } else if (priv->in_compose_sequence) {
-+ if (priv->tentative_match->len > 0 && priv->compose_buffer[0] != 0) {
-+ g_string_append (s, priv->tentative_match->str);
-+ } else {
-+ for (i = 0; priv->compose_buffer[i]; ++i) {
-+ guint16 keysym = priv->compose_buffer[i];
-+ gboolean show_keysym = TRUE;
-+ gboolean need_space = FALSE;
-+ gunichar ch;
-+
-+ if (keysym == IBUS_KEY_Multi_key) {
-+ /* 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.
-+ */
-+ for (j = i + 1; priv->compose_buffer[j]; j++) {
-+ if (priv->compose_buffer[j] != IBUS_KEY_Multi_key) {
-+ show_keysym = FALSE;
-+ break;
-+ }
-+ }
-+ if (!show_keysym)
-+ continue;
-+ ch = ibus_keysym_to_unicode (keysym, FALSE, NULL);
-+ g_string_append_unichar (s, ch);
-+ } else if (IS_DEAD_KEY (keysym)) {
-+ ch = ibus_keysym_to_unicode (keysym, FALSE, &need_space);
-+ if (ch) {
-+ if (need_space)
-+ g_string_append_c (s, ' ');
-+ g_string_append_unichar (s, ch);
-+ }
-+ } else {
-+ ch = ibus_keyval_to_unicode (keysym);
-+ if (ch)
-+ g_string_append_unichar(s, ch);
-+ }
-+ if (!ch) {
-+ g_warning (
- "Not found alternative character of compose key 0x%X",
-- priv->compose_buffer[hexchars]);
-+ priv->compose_buffer[i]);
-+ }
- }
-- ++hexchars;
- }
- }
-
-@@ -380,7 +427,7 @@ check_hex (IBusEngineSimple *simple,
-
- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
-
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- priv->tentative_match_len = 0;
-
- str = g_string_new (NULL);
-@@ -421,7 +468,8 @@ check_hex (IBusEngineSimple *simple,
- }
-
- if (g_unichar_validate (n)) {
-- priv->tentative_match = n;
-+ g_string_set_size (priv->tentative_match, 0);
-+ g_string_append_unichar (priv->tentative_match, n);
- priv->tentative_match_len = n_compose;
- }
-
-@@ -546,21 +594,31 @@ no_sequence_matches (IBusEngineSimple *simple,
-
- CHECK_COMPOSE_BUFFER_LENGTH (n_compose);
-
-+ priv->in_compose_sequence = FALSE;
-+
- /* No compose sequences found, check first if we have a partial
- * match pending.
- */
-- if (priv->tentative_match) {
-+ if (priv->tentative_match_len > 0) {
-+ guint16 *compose_buffer;
- int len = priv->tentative_match_len;
- int i;
-+ char *str;
-
-- ibus_engine_simple_commit_char (simple, priv->tentative_match);
-- priv->compose_buffer[0] = 0;
-+ compose_buffer = alloca (sizeof (guint16) * COMPOSE_BUFFER_SIZE);
-+ memcpy (compose_buffer,
-+ priv->compose_buffer,
-+ sizeof (guint16) * COMPOSE_BUFFER_SIZE);
-+
-+ str = g_strdup (priv->tentative_match->str);
-+ ibus_engine_simple_commit_str (simple, str);
-+ g_free (str);
- ibus_engine_simple_update_preedit_text (simple);
-
- for (i=0; i < n_compose - len - 1; i++) {
- ibus_engine_simple_process_key_event (
- (IBusEngine *)simple,
-- priv->compose_buffer[len + i],
-+ compose_buffer[len + i],
- 0, 0);
- }
-
-@@ -571,6 +629,26 @@ no_sequence_matches (IBusEngineSimple *simple,
- priv->compose_buffer[0] = 0;
- ibus_engine_simple_update_preedit_text (simple);
- } else {
-+ if (n_compose == 2 && IS_DEAD_KEY (priv->compose_buffer[0])) {
-+ gboolean need_space = FALSE;
-+ GString *s = g_string_new ("");
-+ /* dead keys are never *really* dead */
-+ ch = ibus_keysym_to_unicode (priv->compose_buffer[0],
-+ FALSE, &need_space);
-+ if (ch) {
-+ if (need_space)
-+ g_string_append_c (s, ' ');
-+ g_string_append_unichar (s, ch);
-+ }
-+ ch = ibus_keyval_to_unicode (priv->compose_buffer[1]);
-+ if (ch != 0 && !g_unichar_iscntrl (ch))
-+ g_string_append_unichar (s, ch);
-+ ibus_engine_simple_commit_str (simple, s->str);
-+ g_string_free (s, TRUE);
-+ ibus_engine_simple_update_preedit_text (simple);
-+ return TRUE;
-+ }
-+
- priv->compose_buffer[0] = 0;
- if (n_compose > 1) {
- /* Invalid sequence */
-@@ -695,19 +773,46 @@ 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,
- int n_compose)
- {
- IBusEngineSimplePrivate *priv = simple->priv;
-+ GSList *tmp_list;
- gboolean compose_finish = FALSE;
- gboolean compose_match = FALSE;
- GString *output = g_string_new ("");
-- gboolean does_hit = FALSE;
-+ gboolean success = FALSE;
- gboolean is_32bit = FALSE;
-- GSList *tmp_list;
- gunichar *output_chars = NULL;
-- gunichar output_char;
-+ gunichar output_char = '\0';
-+
-+ if (n_compose == 2) {
-+ /* Special-case deadkey-deadkey sequences.
-+ * We are not doing chained deadkeys, so we
-+ * want to commit the first key, and contine
-+ * preediting with second.
-+ */
-+ if (IS_DEAD_KEY (priv->compose_buffer[0]) &&
-+ IS_DEAD_KEY (priv->compose_buffer[1])) {
-+ gboolean need_space = FALSE;
-+ gunichar ch = ibus_keysym_to_unicode (priv->compose_buffer[0],
-+ FALSE, &need_space);
-+ guint16 next = priv->compose_buffer[1];
-+ if (ch) {
-+ if (need_space)
-+ g_string_append_c (output, ' ');
-+ g_string_append_unichar (output, ch);
-+ ibus_engine_simple_commit_str (simple, output->str);
-+ g_string_set_size (output, 0);
-+
-+ priv->compose_buffer[0] = next;
-+ priv->compose_buffer[1] = 0;
-+ n_compose = 1;
-+ }
-+ }
-+ }
-
- G_LOCK (global_tables);
- tmp_list = global_tables;
-@@ -721,7 +826,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- &compose_match,
- output,
- is_32bit)) {
-- does_hit = TRUE;
-+ success = TRUE;
- break;
- }
- is_32bit = TRUE;
-@@ -733,14 +838,15 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- &compose_match,
- output,
- is_32bit)) {
-- does_hit = TRUE;
-+ success = TRUE;
- break;
- }
- tmp_list = tmp_list->next;
- }
- G_UNLOCK (global_tables);
-
-- if (does_hit) {
-+ if (success) {
-+ priv->in_compose_sequence = TRUE;
- if (compose_finish) {
- if (compose_match) {
- if (is_32bit) {
-@@ -750,59 +856,89 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- g_utf8_get_char (output->str));
- }
- }
-+ ibus_engine_simple_update_preedit_text (simple);
-+ g_string_free (output, TRUE);
-+ return TRUE;
- } else if (compose_match) {
-- priv->tentative_match = g_utf8_get_char (output->str);
-+ g_string_assign (priv->tentative_match, output->str);
- priv->tentative_match_len = n_compose;
-+ ibus_engine_simple_update_preedit_text (simple);
-+ g_string_free (output, TRUE);
-+ return TRUE;
- }
-- ibus_engine_simple_update_preedit_text (simple);
-- g_string_free (output, TRUE);
-- return TRUE;
- }
- g_string_free (output, TRUE);
-+ output = NULL;
-
- if (ibus_compose_table_compact_check (&ibus_compose_table_compact,
- priv->compose_buffer,
- n_compose,
- &compose_finish,
- &output_chars)) {
-+ priv->in_compose_sequence = TRUE;
- if (compose_finish) {
-- ibus_engine_simple_commit_char (simple, *output_chars);
-+ if (success) {
-+ g_string_append_unichar (priv->tentative_match, *output_chars);
-+ priv->tentative_match_len = n_compose;
-+ } else {
-+ ibus_engine_simple_commit_char (simple, *output_chars);
-+ priv->compose_buffer[0] = 0;
-+ }
- g_free (output_chars);
-- priv->compose_buffer[0] = 0;
-+ ibus_engine_simple_update_preedit_text (simple);
-+ return TRUE;
- }
-- ibus_engine_simple_update_preedit_text (simple);
-- return TRUE;
-+ success = TRUE;
- }
-+ g_free (output_chars);
-+ output_chars = NULL;
- if (ibus_compose_table_compact_check (&ibus_compose_table_compact_32bit,
- priv->compose_buffer,
- n_compose,
- &compose_finish,
- &output_chars)) {
-+ priv->in_compose_sequence = TRUE;
- if (compose_finish) {
- GError *error = NULL;
- char *str = g_ucs4_to_utf8 (output_chars, -1, NULL, NULL, &error);
-- if (str) {
-- ibus_engine_simple_commit_str (simple, str);
-- g_free (str);
-- } else {
-+ if (!str) {
- g_warning ("Failed to output multiple characters: %s",
- error->message);
- g_error_free (error);
-+ } else if (success) {
-+ g_string_append (priv->tentative_match, str);
-+ priv->tentative_match_len = n_compose;
-+ } else {
-+ ibus_engine_simple_commit_str (simple, str);
-+ priv->compose_buffer[0] = 0;
- }
-- priv->compose_buffer[0] = 0;
-+ g_free (str);
-+ g_free (output_chars);
-+ ibus_engine_simple_update_preedit_text (simple);
-+ return TRUE;
- }
-- g_free (output_chars);
-- ibus_engine_simple_update_preedit_text (simple);
-- return TRUE;
-+ success = TRUE;
- }
-- g_assert (!output_chars);
-+ g_free (output_chars);
-+ output_chars = NULL;
- if (ibus_check_algorithmically (priv->compose_buffer,
- n_compose,
- &output_char)) {
-+ priv->in_compose_sequence = TRUE;
- if (output_char) {
-- ibus_engine_simple_commit_char (simple, output_char);
-- priv->compose_buffer[0] = 0;
-+ if (success) {
-+ g_string_append_unichar (priv->tentative_match, output_char);
-+ priv->tentative_match_len = n_compose;
-+ } else {
-+ ibus_engine_simple_commit_char (simple, output_char);
-+ priv->compose_buffer[0] = 0;
-+ }
-+ ibus_engine_simple_update_preedit_text (simple);
-+ return TRUE;
- }
-+ success = TRUE;
-+ }
-+ if (success) {
- ibus_engine_simple_update_preedit_text (simple);
- return TRUE;
- }
-@@ -810,6 +946,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- return FALSE;
- }
-
-+
- static gboolean
- ibus_engine_simple_process_key_event (IBusEngine *engine,
- guint keyval,
-@@ -841,16 +978,17 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- if (priv->in_hex_sequence &&
- (keyval == IBUS_KEY_Control_L || keyval == IBUS_KEY_Control_R ||
- keyval == IBUS_KEY_Shift_L || keyval == IBUS_KEY_Shift_R)) {
-- if (priv->tentative_match &&
-- g_unichar_validate (priv->tentative_match)) {
-- ibus_engine_simple_commit_char (simple, priv->tentative_match);
-+ if (priv->tentative_match->len > 0) {
-+ char *str = g_strdup (priv->tentative_match->str);
-+ ibus_engine_simple_commit_str (simple, str);
-+ g_free (str);
- ibus_engine_simple_update_preedit_text (simple);
- } else if (n_compose == 0) {
- priv->modifiers_dropped = TRUE;
- } else {
- /* invalid hex sequence */
- /* FIXME beep_window (event->window); */
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
- priv->in_emoji_sequence = FALSE;
-@@ -873,7 +1011,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- } else {
- /* invalid hex sequence */
- /* FIXME beep_window (event->window); */
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
- priv->in_emoji_sequence = FALSE;
-@@ -921,7 +1059,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- else if (is_hex_end) {
- /* invalid hex sequence */
- // beep_window (event->window);
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
- priv->in_emoji_sequence = FALSE;
-@@ -999,7 +1137,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- if (n_compose > 0) {
- n_compose--;
- priv->compose_buffer[n_compose] = 0;
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
-+ priv->tentative_match_len = 0;
- ibus_engine_simple_check_all_compose_table (simple, n_compose);
- return TRUE;
- }
-@@ -1007,16 +1146,17 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-
- /* Check for hex sequence restart */
- if (priv->in_hex_sequence && have_hex_mods && is_hex_start) {
-- if (priv->tentative_match &&
-- g_unichar_validate (priv->tentative_match)) {
-- ibus_engine_simple_commit_char (simple, priv->tentative_match);
-+ if (priv->tentative_match->len > 0 ) {
-+ char *str = g_strdup (priv->tentative_match->str);
-+ ibus_engine_simple_commit_str (simple, str);
-+ g_free (str);
- ibus_engine_simple_update_preedit_text (simple);
- }
- else {
- /* invalid hex sequence */
- if (n_compose > 0) {
- // FIXME beep_window (event->window);
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
- }
-@@ -1044,7 +1184,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- priv->in_hex_sequence = TRUE;
- priv->in_emoji_sequence = FALSE;
- priv->modifiers_dropped = FALSE;
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
-
- // g_debug ("Start HEX MODE");
-@@ -1058,7 +1198,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- priv->in_hex_sequence = FALSE;
- priv->in_emoji_sequence = TRUE;
- priv->modifiers_dropped = FALSE;
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
-
- // g_debug ("Start HEX MODE");
-@@ -1068,7 +1208,6 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- return TRUE;
- }
-
-- /* Then, check for compose sequences */
- if (priv->in_hex_sequence) {
- if (hex_keyval) {
- SET_COMPOSE_BUFFER_ELEMENT_NEXT (priv->compose_buffer,
-@@ -1133,17 +1272,17 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- if (have_hex_mods) {
- /* space or return ends the sequence, and we eat the key */
- if (n_compose > 0 && is_hex_end) {
-- if (priv->tentative_match &&
-- g_unichar_validate (priv->tentative_match)) {
-- ibus_engine_simple_commit_char (simple,
-- priv->tentative_match);
-- priv->compose_buffer[0] = 0;
-+ if (priv->tentative_match->len > 0) {
-+ char *str = g_strdup (priv->tentative_match->str);
-+ ibus_engine_simple_commit_str (simple, str);
-+ g_free (str);
- ibus_engine_simple_update_preedit_text (simple);
-+ return TRUE;
- } else {
- // FIXME
- /* invalid hex sequence */
- // beep_window (event->window);
-- priv->tentative_match = 0;
-+ g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
- }
-@@ -1234,7 +1373,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-
- return TRUE;
- }
-- } else {
-+ } else { /* Then, check for compose sequences */
- if (ibus_engine_simple_check_all_compose_table (simple, n_compose))
- return TRUE;
- }
-diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index 5479e553..ad93d2d2 100644
---- a/src/ibusenginesimpleprivate.h
-+++ b/src/ibusenginesimpleprivate.h
-@@ -26,6 +26,12 @@
-
- G_BEGIN_DECLS
-
-+/* Checks if a keysym is a dead key. Dead key keysym values are defined in
-+ * ibuskeysyms.h and the first is GDK_KEY_dead_grave.
-+ */
-+#define IS_DEAD_KEY(k) \
-+ ((k) >= IBUS_KEY_dead_grave && (k) <= IBUS_KEY_dead_greek)
-+
- extern const IBusComposeTableCompactEx ibus_compose_table_compact;
- extern const IBusComposeTableCompactEx ibus_compose_table_compact_32bit;
-
-@@ -60,7 +66,8 @@ gboolean ibus_compose_table_compact_check
- gboolean *compose_finish,
- gunichar **output_chars);
- gunichar ibus_keysym_to_unicode (guint16 keysym,
-- gboolean combining);
-+ gboolean combining,
-+ gboolean *need_space);
-
- G_END_DECLS
-
---
-2.28.0
-
-From 17ae266cade41e795534532acefc85716bb309ef Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 26 Jul 2021 22:53:34 +0900
-Subject: [PATCH 6/6] Code reviews
-
-- Use fstat() and fchmod() but not stat() and chmod() to
- fix race conditions
-- Avoid to use after free
-- Fix dereference of IBusComposeTable->priv
-- Fix to divide by zero
----
- src/ibusbus.c | 23 ++++++++++++++++++-----
- src/ibuscomposetable.c | 8 ++++++--
- src/tests/ibus-desktop-testing-runner.in | 6 +++---
- 3 files changed, 27 insertions(+), 10 deletions(-)
-
-diff --git a/src/ibusbus.c b/src/ibusbus.c
-index e9b0bcbb..47400cb8 100644
---- a/src/ibusbus.c
-+++ b/src/ibusbus.c
-@@ -21,13 +21,14 @@
- * USA
- */
-
--#include "ibusbus.h"
- #include <errno.h>
-+#include <fcntl.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <unistd.h>
- #include <glib/gstdio.h>
- #include <gio/gio.h>
-+#include "ibusbus.h"
- #include "ibusmarshalers.h"
- #include "ibusinternal.h"
- #include "ibusshare.h"
-@@ -537,7 +538,8 @@ static void
- ibus_bus_init (IBusBus *bus)
- {
- struct stat buf;
-- gchar *path;
-+ char *path;
-+ int fd;
-
- bus->priv = IBUS_BUS_GET_PRIVATE (bus);
-
-@@ -562,20 +564,31 @@ ibus_bus_init (IBusBus *bus)
- return;
- }
-
-- if (stat (path, &buf) == 0) {
-+ errno = 0;
-+ if ((fd = open (path, O_RDONLY | O_DIRECTORY, S_IRWXU)) == -1) {
-+ g_warning ("open %s failed: %s", path, g_strerror (errno));
-+ g_free (path);
-+ return;
-+ }
-+ /* TOCTOU: Use fstat() and fchmod() but not stat() and chmod().
-+ * because it can cause a time-of-check, time-of-use race condition.
-+ */
-+ if (fstat (fd, &buf) == 0) {
- if (buf.st_uid != getuid ()) {
- g_warning ("The owner of %s is not %s!",
- path, ibus_get_user_name ());
-+ close (fd);
- g_free (path);
- return;
- }
- if (buf.st_mode != (S_IFDIR | S_IRWXU)) {
- errno = 0;
-- if (g_chmod (path, 0700))
-- g_warning ("chmod failed: %s", errno ? g_strerror (errno) : "");
-+ if (fchmod (fd, S_IRWXU))
-+ g_warning ("chmod failed: %s", g_strerror (errno));
- }
- }
-
-+ close (fd);
- g_free (path);
- }
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 2ad21551..a0b0befc 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -406,7 +406,7 @@ get_en_compose_file (void)
- path = g_build_filename (X11_DATADIR, *sys_lang, "Compose", NULL);
- if (g_file_test (path, G_FILE_TEST_EXISTS))
- break;
-- g_free (path);
-+ g_clear_pointer (&path, g_free);
- }
- return path;
- }
-@@ -975,7 +975,10 @@ ibus_compose_table_deserialize (const char *contents,
- goto out_load_cache;
- }
- if (data_length) {
-- retval->priv = g_new0 (IBusComposeTablePrivate, 1);
-+ if (!(retval->priv = g_new0 (IBusComposeTablePrivate, 1))) {
-+ g_warning ("Failed g_new");
-+ goto out_load_cache;
-+ }
- retval->priv->data_first = g_new (guint16, data_length);
- memcpy (retval->priv->data_first,
- data_32bit_first, data_length * sizeof (guint16));
-@@ -1565,6 +1568,7 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx
- row_stride = i + 2;
-
- if (seq_index[i + 1] - seq_index[i] > 0) {
-+ g_assert (row_stride);
- seq = bsearch (compose_buffer + 1,
- table->data + seq_index[i],
- (seq_index[i + 1] - seq_index[i]) / row_stride,
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 0ef72c03..c1016703 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -220,7 +220,7 @@ init_gnome()
- # G_MESSAGES_DEBUG=all or G_MESSAGES_DEBUG=GLib-GIO-DEBUG would append
- # debug messages to gsettings output and could not get the result correctly.
- backup_G_MESSAGES_DEBUG="$G_MESSAGES_DEBUG"
-- export -n G_MESSAGES_DEBUG=''
-+ unset G_MESSAGES_DEBUG
- # Disable Tour dialog to get focus
- V=`gsettings get org.gnome.shell welcome-dialog-last-shown-version`
- if [ x"$V" = x"''" ] ; then
-@@ -231,8 +231,8 @@ init_gnome()
- NO_SYS_DIR=/usr/share/gnome-shell/extensions/no-overview@fthx
- NO_USER_DIR=$HOME/.local/share/gnome-shell/extensions/no-overview@fthx
- if [ ! -d $NO_SYS_DIR ] && [ ! -d $NO_USER_DIR ] ; then
-- mkdir -p `dirname $NO_USER_DIR`
-- cp -R no-overview@fthx `dirname $NO_USER_DIR`
-+ mkdir -p "`dirname $NO_USER_DIR`"
-+ cp -R "no-overview@fthx" "`dirname $NO_USER_DIR`"
- fi
- V=`gsettings get org.gnome.shell disable-user-extensions`
- if [ x"$V" = x"true" ] ; then
---
-2.28.0
-
-From a823161768c8f6916dbdebe73842a9fc04521369 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 9 Aug 2021 12:36:40 +0900
-Subject: [PATCH] client/gtk2/ibusimcontext: Enable sync process in GTK4
-
-gtk_im_context_filter_key() does not forward control keys likes
-BackSpace, Return and change the process mode to the synchronization.
-
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3465
----
- client/gtk2/ibusimcontext.c | 65 +++++++++++++++++++++++--------------
- 1 file changed, 41 insertions(+), 24 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index e7ce5363..da9a402f 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -110,13 +110,15 @@ static guint _signal_preedit_end_id = 0;
- static guint _signal_delete_surrounding_id = 0;
- static guint _signal_retrieve_surrounding_id = 0;
-
--#if !GTK_CHECK_VERSION (3, 98, 4)
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+static gboolean _use_sync_mode = TRUE;
-+#else
- static const gchar *_no_snooper_apps = NO_SNOOPER_APPS;
- static gboolean _use_key_snooper = ENABLE_SNOOPER;
- static guint _key_snooper_id = 0;
--#endif
-
- static gboolean _use_sync_mode = FALSE;
-+#endif
-
- static const gchar *_discard_password_apps = "";
- static gboolean _use_discard_password = FALSE;
-@@ -767,11 +769,13 @@ ibus_im_context_class_init (IBusIMContextClass *class)
- g_signal_lookup ("retrieve-surrounding", G_TYPE_FROM_CLASS (class));
- g_assert (_signal_retrieve_surrounding_id != 0);
-
--#if !GTK_CHECK_VERSION (3, 98, 4)
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+ _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", TRUE);
-+#else
- _use_key_snooper = !_get_boolean_env ("IBUS_DISABLE_SNOOPER",
- !(ENABLE_SNOOPER));
--#endif
- _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", FALSE);
-+#endif
- _use_discard_password = _get_boolean_env ("IBUS_DISCARD_PASSWORD", FALSE);
-
- #define CHECK_APP_IN_CSV_ENV_VARIABLES(retval, \
-@@ -1434,6 +1438,9 @@ static gboolean
- _set_cursor_location_internal (IBusIMContext *ibusimcontext)
- {
- GdkRectangle area;
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+ GtkWidget *root;
-+#endif
-
- if(ibusimcontext->client_window == NULL ||
- ibusimcontext->ibuscontext == NULL) {
-@@ -1442,8 +1449,27 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
-
- area = ibusimcontext->cursor_area;
-
--#if !GTK_CHECK_VERSION (3, 98, 4)
- #ifdef GDK_WINDOWING_WAYLAND
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+ root = GTK_WIDGET (gtk_widget_get_root (ibusimcontext->client_window));
-+ /* FIXME: GTK_STYLE_CLASS_TITLEBAR is available in GTK3 but not GTK4.
-+ * gtk_css_boxes_get_content_rect() is available in GTK4 but it's an
-+ * internal API and calculate the window edge 32 in GTK3.
-+ */
-+ area.y += 32;
-+ area.width = 50; /* FIXME: Why 50 meets the cursor position? */
-+ area.height = gtk_widget_get_height (root);
-+ area.height += 32;
-+ if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) {
-+ ibus_input_context_set_cursor_location_relative (
-+ ibusimcontext->ibuscontext,
-+ area.x,
-+ area.y,
-+ area.width,
-+ area.height);
-+ return FALSE;
-+ }
-+#else
- if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) {
- gdouble px, py;
- GdkWindow *parent;
-@@ -1469,23 +1495,20 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
- #endif
- #endif
-
-- if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
- #if GTK_CHECK_VERSION (3, 98, 4)
-- area.x = 0;
-- area.y += gtk_widget_get_height (ibusimcontext->client_window);
- #elif GTK_CHECK_VERSION (2, 91, 0)
-- area.x = 0;
-- area.y += gdk_window_get_height (ibusimcontext->client_window);
-+ area.y += gdk_window_get_height (ibusimcontext->client_window);
- #else
-+ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
- gint w, h;
- gdk_drawable_get_size (ibusimcontext->client_window, &w, &h);
- area.y += h;
- area.x = 0;
--#endif
- }
-+#endif
-
- #if GTK_CHECK_VERSION (3, 98, 4)
--#ifdef GDK_WINDOWING_X11
-+#if defined(GDK_WINDOWING_X11)
- GdkDisplay *display = gtk_widget_get_display (ibusimcontext->client_window);
- if (GDK_IS_X11_DISPLAY (display)) {
- Display *xdisplay = gdk_x11_display_get_xdisplay (display);
-@@ -1505,21 +1528,10 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
- XGetWindowAttributes (xdisplay, window, &xwa);
- area.x = x - xwa.x + area.x;
- area.y = y - xwa.y + area.y;
-- area.width = xwa.width;
-+ area.width = 50; /* FIXME: Why 50 meets the cursor position? */
- area.height = xwa.height;
- }
- #endif
--#elif GTK_CHECK_VERSION (3, 93, 0)
-- {
-- GtkNative *native = gtk_widget_get_native (
-- ibusimcontext->client_window);
-- GdkSurface *surface = gtk_native_get_surface (native);
-- int root_x = 0;
-- int root_y = 0;
-- gdk_surface_get_position (surface, &root_x, &root_y);
-- area.x += root_x;
-- area.y += root_y;
-- }
- #else
- gdk_window_get_root_coords (ibusimcontext->client_window,
- area.x, area.y,
-@@ -1541,12 +1553,17 @@ ibus_im_context_set_cursor_location (GtkIMContext *context, GdkRectangle *area)
-
- IBusIMContext *ibusimcontext = IBUS_IM_CONTEXT (context);
-
-+#if !GTK_CHECK_VERSION (3, 93, 0)
-+ /* The area is the relative coordinates and this has to get the absolute
-+ * ones in _set_cursor_location_internal() since GTK 4.0.
-+ */
- if (ibusimcontext->cursor_area.x == area->x &&
- ibusimcontext->cursor_area.y == area->y &&
- ibusimcontext->cursor_area.width == area->width &&
- ibusimcontext->cursor_area.height == area->height) {
- return;
- }
-+#endif
- ibusimcontext->cursor_area = *area;
- _set_cursor_location_internal (ibusimcontext);
- gtk_im_context_set_cursor_location (ibusimcontext->slave, area);
---
-2.28.0
-
From 943d37444d9cc0881cb5fff87bdd4b9efd5abdb4 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 9 Aug 2021 12:49:15 +0900
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:09 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:09 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 7514a68d26de2e5a6481bcb407aff7966c509159
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2026-03-16T02:10:32+09:00
Stats : +0/-1228 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/7514a68d26de2e5a6481bcb407aff7966c509159?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 984b8e9..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,1228 +0,0 @@
-From 36d2193efe55c09994423575df9a47fe2a49352f Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 5 Feb 2026 20:41:25 +0900
-Subject: [PATCH 1/3] client/wayland: Add
- text-input-unstable-v3-client-protocol.h
-
----
- .../text-input-unstable-v3-client-protocol.h | 837 ++++++++++++++++++
- 1 file changed, 837 insertions(+)
- create mode 100644 client/wayland/text-input-unstable-v3-client-protocol.h
-
-diff --git a/client/wayland/text-input-unstable-v3-client-protocol.h b/client/wayland/text-input-unstable-v3-client-protocol.h
-new file mode 100644
-index 00000000..dea96b89
---- /dev/null
-+++ b/client/wayland/text-input-unstable-v3-client-protocol.h
-@@ -0,0 +1,837 @@
-+/* Generated by wayland-scanner 1.24.0 */
-+
-+#ifndef TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
-+#define TEXT_INPUT_UNSTABLE_V3_CLIENT_PROTOCOL_H
-+
-+#include <stdint.h>
-+#include <stddef.h>
-+#include "wayland-client.h"
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+/**
-+ * @page page_text_input_unstable_v3 The text_input_unstable_v3 protocol
-+ * Protocol for composing text
-+ *
-+ * @section page_desc_text_input_unstable_v3 Description
-+ *
-+ * This protocol allows compositors to act as input methods and to send text
-+ * to applications. A text input object is used to manage state of what are
-+ * typically text entry fields in the application.
-+ *
-+ * This document adheres to the RFC 2119 when using words like "must",
-+ * "should", "may", etc.
-+ *
-+ * Warning! The protocol described in this file is experimental and
-+ * backward incompatible changes may be made. Backward compatible changes
-+ * may be added together with the corresponding interface version bump.
-+ * Backward incompatible changes are done by bumping the version number in
-+ * the protocol and interface names and resetting the interface version.
-+ * Once the protocol is to be declared stable, the 'z' prefix and the
-+ * version number in the protocol and interface names are removed and the
-+ * interface version number is reset.
-+ *
-+ * @section page_ifaces_text_input_unstable_v3 Interfaces
-+ * - @subpage page_iface_zwp_text_input_v3 - text input
-+ * - @subpage page_iface_zwp_text_input_manager_v3 - text input manager
-+ * @section page_copyright_text_input_unstable_v3 Copyright
-+ * <pre>
-+ *
-+ * Copyright © 2012, 2013 Intel Corporation
-+ * Copyright © 2015, 2016 Jan Arne Petersen
-+ * Copyright © 2017, 2018 Red Hat, Inc.
-+ * Copyright © 2018 Purism SPC
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this
-+ * software and its documentation for any purpose is hereby granted
-+ * without fee, provided that the above copyright notice appear in
-+ * all copies and that both that copyright notice and this permission
-+ * notice appear in supporting documentation, and that the name of
-+ * the copyright holders not be used in advertising or publicity
-+ * pertaining to distribution of the software without specific,
-+ * written prior permission. The copyright holders make no
-+ * representations about the suitability of this software for any
-+ * purpose. It is provided "as is" without express or implied
-+ * warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-+ * THIS SOFTWARE.
-+ * </pre>
-+ */
-+struct wl_seat;
-+struct wl_surface;
-+struct zwp_text_input_manager_v3;
-+struct zwp_text_input_v3;
-+
-+#ifndef ZWP_TEXT_INPUT_V3_INTERFACE
-+#define ZWP_TEXT_INPUT_V3_INTERFACE
-+/**
-+ * @page page_iface_zwp_text_input_v3 zwp_text_input_v3
-+ * @section page_iface_zwp_text_input_v3_desc Description
-+ *
-+ * The zwp_text_input_v3 interface represents text input and input methods
-+ * associated with a seat. It provides enter/leave events to follow the
-+ * text input focus for a seat.
-+ *
-+ * Requests are used to enable/disable the text-input object and set
-+ * state information like surrounding and selected text or the content type.
-+ * The information about the entered text is sent to the text-input object
-+ * via the preedit_string and commit_string events.
-+ *
-+ * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
-+ * must not point to middle bytes inside a code point: they must either
-+ * point to the first byte of a code point or to the end of the buffer.
-+ * Lengths must be measured between two valid indices.
-+ *
-+ * Focus moving throughout surfaces will result in the emission of
-+ * zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
-+ * surface must commit zwp_text_input_v3.enable and
-+ * zwp_text_input_v3.disable requests as the keyboard focus moves across
-+ * editable and non-editable elements of the UI. Those two requests are not
-+ * expected to be paired with each other, the compositor must be able to
-+ * handle consecutive series of the same request.
-+ *
-+ * State is sent by the state requests (set_surrounding_text,
-+ * set_content_type and set_cursor_rectangle) and a commit request. After an
-+ * enter event or disable request all state information is invalidated and
-+ * needs to be resent by the client.
-+ * @section page_iface_zwp_text_input_v3_api API
-+ * See @ref iface_zwp_text_input_v3.
-+ */
-+/**
-+ * @defgroup iface_zwp_text_input_v3 The zwp_text_input_v3 interface
-+ *
-+ * The zwp_text_input_v3 interface represents text input and input methods
-+ * associated with a seat. It provides enter/leave events to follow the
-+ * text input focus for a seat.
-+ *
-+ * Requests are used to enable/disable the text-input object and set
-+ * state information like surrounding and selected text or the content type.
-+ * The information about the entered text is sent to the text-input object
-+ * via the preedit_string and commit_string events.
-+ *
-+ * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
-+ * must not point to middle bytes inside a code point: they must either
-+ * point to the first byte of a code point or to the end of the buffer.
-+ * Lengths must be measured between two valid indices.
-+ *
-+ * Focus moving throughout surfaces will result in the emission of
-+ * zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
-+ * surface must commit zwp_text_input_v3.enable and
-+ * zwp_text_input_v3.disable requests as the keyboard focus moves across
-+ * editable and non-editable elements of the UI. Those two requests are not
-+ * expected to be paired with each other, the compositor must be able to
-+ * handle consecutive series of the same request.
-+ *
-+ * State is sent by the state requests (set_surrounding_text,
-+ * set_content_type and set_cursor_rectangle) and a commit request. After an
-+ * enter event or disable request all state information is invalidated and
-+ * needs to be resent by the client.
-+ */
-+extern const struct wl_interface zwp_text_input_v3_interface;
-+#endif
-+#ifndef ZWP_TEXT_INPUT_MANAGER_V3_INTERFACE
-+#define ZWP_TEXT_INPUT_MANAGER_V3_INTERFACE
-+/**
-+ * @page page_iface_zwp_text_input_manager_v3 zwp_text_input_manager_v3
-+ * @section page_iface_zwp_text_input_manager_v3_desc Description
-+ *
-+ * A factory for text-input objects. This object is a global singleton.
-+ * @section page_iface_zwp_text_input_manager_v3_api API
-+ * See @ref iface_zwp_text_input_manager_v3.
-+ */
-+/**
-+ * @defgroup iface_zwp_text_input_manager_v3 The zwp_text_input_manager_v3 interface
-+ *
-+ * A factory for text-input objects. This object is a global singleton.
-+ */
-+extern const struct wl_interface zwp_text_input_manager_v3_interface;
-+#endif
-+
-+#ifndef ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM
-+#define ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ * text change reason
-+ *
-+ * Reason for the change of surrounding text or cursor posision.
-+ */
-+enum zwp_text_input_v3_change_cause {
-+ /**
-+ * input method caused the change
-+ */
-+ ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD = 0,
-+ /**
-+ * something else than the input method caused the change
-+ */
-+ ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_OTHER = 1,
-+};
-+#endif /* ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_ENUM */
-+
-+#ifndef ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM
-+#define ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ * content hint
-+ *
-+ * Content hint is a bitmask to allow to modify the behavior of the text
-+ * input.
-+ */
-+enum zwp_text_input_v3_content_hint {
-+ /**
-+ * no special behavior
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_NONE = 0x0,
-+ /**
-+ * suggest word completions
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_COMPLETION = 0x1,
-+ /**
-+ * suggest word corrections
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK = 0x2,
-+ /**
-+ * switch to uppercase letters at the start of a sentence
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
-+ /**
-+ * prefer lowercase letters
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_LOWERCASE = 0x8,
-+ /**
-+ * prefer uppercase letters
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_UPPERCASE = 0x10,
-+ /**
-+ * prefer casing for titles and headings (can be language dependent)
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_TITLECASE = 0x20,
-+ /**
-+ * characters should be hidden
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_HIDDEN_TEXT = 0x40,
-+ /**
-+ * typed text should not be stored
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_SENSITIVE_DATA = 0x80,
-+ /**
-+ * just Latin characters should be entered
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_LATIN = 0x100,
-+ /**
-+ * the text input is multiline
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_HINT_MULTILINE = 0x200,
-+};
-+#endif /* ZWP_TEXT_INPUT_V3_CONTENT_HINT_ENUM */
-+
-+#ifndef ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM
-+#define ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ * content purpose
-+ *
-+ * The content purpose allows to specify the primary purpose of a text
-+ * input.
-+ *
-+ * This allows an input method to show special purpose input panels with
-+ * extra characters or to disallow some characters.
-+ */
-+enum zwp_text_input_v3_content_purpose {
-+ /**
-+ * default input, allowing all characters
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL = 0,
-+ /**
-+ * allow only alphabetic characters
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ALPHA = 1,
-+ /**
-+ * allow only digits
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DIGITS = 2,
-+ /**
-+ * input a number (including decimal separator and sign)
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NUMBER = 3,
-+ /**
-+ * input a phone number
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PHONE = 4,
-+ /**
-+ * input an URL
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_URL = 5,
-+ /**
-+ * input an email address
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_EMAIL = 6,
-+ /**
-+ * input a name of a person
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NAME = 7,
-+ /**
-+ * input a password (combine with sensitive_data hint)
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PASSWORD = 8,
-+ /**
-+ * input is a numeric password (combine with sensitive_data hint)
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PIN = 9,
-+ /**
-+ * input a date
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE = 10,
-+ /**
-+ * input a time
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TIME = 11,
-+ /**
-+ * input a date and time
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME = 12,
-+ /**
-+ * input for a terminal
-+ */
-+ ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL = 13,
-+};
-+#endif /* ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ENUM */
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ * @struct zwp_text_input_v3_listener
-+ */
-+struct zwp_text_input_v3_listener {
-+ /**
-+ * enter event
-+ *
-+ * Notification that this seat's text-input focus is on a certain
-+ * surface.
-+ *
-+ * If client has created multiple text input objects, compositor
-+ * must send this event to all of them.
-+ *
-+ * When the seat has the keyboard capability the text-input focus
-+ * follows the keyboard focus. This event sets the current surface
-+ * for the text-input object.
-+ */
-+ void (*enter)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ struct wl_surface *surface);
-+ /**
-+ * leave event
-+ *
-+ * Notification that this seat's text-input focus is no longer on
-+ * a certain surface. The client should reset any preedit string
-+ * previously set.
-+ *
-+ * The leave notification clears the current surface. It is sent
-+ * before the enter notification for the new focus. After leave
-+ * event, compositor must ignore requests from any text input
-+ * instances until next enter event.
-+ *
-+ * When the seat has the keyboard capability the text-input focus
-+ * follows the keyboard focus.
-+ */
-+ void (*leave)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ struct wl_surface *surface);
-+ /**
-+ * pre-edit
-+ *
-+ * Notify when a new composing text (pre-edit) should be set at
-+ * the current cursor position. Any previously set composing text
-+ * must be removed. Any previously existing selected text must be
-+ * removed.
-+ *
-+ * The argument text contains the pre-edit string buffer.
-+ *
-+ * The parameters cursor_begin and cursor_end are counted in bytes
-+ * relative to the beginning of the submitted text buffer. Cursor
-+ * should be hidden when both are equal to -1.
-+ *
-+ * They could be represented by the client as a line if both values
-+ * are the same, or as a text highlight otherwise.
-+ *
-+ * Values set with this event are double-buffered. They must be
-+ * applied and reset to initial on the next zwp_text_input_v3.done
-+ * event.
-+ *
-+ * The initial value of text is an empty string, and cursor_begin,
-+ * cursor_end and cursor_hidden are all 0.
-+ */
-+ void (*preedit_string)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ const char *text,
-+ int32_t cursor_begin,
-+ int32_t cursor_end);
-+ /**
-+ * text commit
-+ *
-+ * Notify when text should be inserted into the editor widget.
-+ * The text to commit could be either just a single character after
-+ * a key press or the result of some composing (pre-edit).
-+ *
-+ * Values set with this event are double-buffered. They must be
-+ * applied and reset to initial on the next zwp_text_input_v3.done
-+ * event.
-+ *
-+ * The initial value of text is an empty string.
-+ */
-+ void (*commit_string)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ const char *text);
-+ /**
-+ * delete surrounding text
-+ *
-+ * Notify when the text around the current cursor position should
-+ * be deleted.
-+ *
-+ * Before_length and after_length are the number of bytes before
-+ * and after the current cursor index (excluding the selection) to
-+ * delete.
-+ *
-+ * If a preedit text is present, in effect before_length is counted
-+ * from the beginning of it, and after_length from its end (see
-+ * done event sequence).
-+ *
-+ * Values set with this event are double-buffered. They must be
-+ * applied and reset to initial on the next zwp_text_input_v3.done
-+ * event.
-+ *
-+ * The initial values of both before_length and after_length are 0.
-+ * @param before_length length of text before current cursor position
-+ * @param after_length length of text after current cursor position
-+ */
-+ void (*delete_surrounding_text)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ uint32_t before_length,
-+ uint32_t after_length);
-+ /**
-+ * apply changes
-+ *
-+ * Instruct the application to apply changes to state requested
-+ * by the preedit_string, commit_string and delete_surrounding_text
-+ * events. The state relating to these events is double-buffered,
-+ * and each one modifies the pending state. This event replaces the
-+ * current state with the pending state.
-+ *
-+ * The application must proceed by evaluating the changes in the
-+ * following order:
-+ *
-+ * 1. Replace existing preedit string with the cursor. 2. Delete
-+ * requested surrounding text. 3. Insert commit string with the
-+ * cursor at its end. 4. Calculate surrounding text to send. 5.
-+ * Insert new preedit text in cursor position. 6. Place cursor
-+ * inside preedit text.
-+ *
-+ * The serial number reflects the last state of the
-+ * zwp_text_input_v3 object known to the compositor. The value of
-+ * the serial argument must be equal to the number of commit
-+ * requests already issued on that object.
-+ *
-+ * When the client receives a done event with a serial different
-+ * than the number of past commit requests, it must proceed with
-+ * evaluating and applying the changes as normal, except it should
-+ * not change the current state of the zwp_text_input_v3 object.
-+ * All pending state requests (set_surrounding_text,
-+ * set_content_type and set_cursor_rectangle) on the
-+ * zwp_text_input_v3 object should be sent and committed after
-+ * receiving a zwp_text_input_v3.done event with a matching serial.
-+ */
-+ void (*done)(void *data,
-+ struct zwp_text_input_v3 *zwp_text_input_v3,
-+ uint32_t serial);
-+};
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+static inline int
-+zwp_text_input_v3_add_listener(struct zwp_text_input_v3 *zwp_text_input_v3,
-+ const struct zwp_text_input_v3_listener *listener, void *data)
-+{
-+ return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v3,
-+ (void (**)(void)) listener, data);
-+}
-+
-+#define ZWP_TEXT_INPUT_V3_DESTROY 0
-+#define ZWP_TEXT_INPUT_V3_ENABLE 1
-+#define ZWP_TEXT_INPUT_V3_DISABLE 2
-+#define ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT 3
-+#define ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE 4
-+#define ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE 5
-+#define ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE 6
-+#define ZWP_TEXT_INPUT_V3_COMMIT 7
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_ENTER_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_LEAVE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_PREEDIT_STRING_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_COMMIT_STRING_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_DONE_SINCE_VERSION 1
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_DESTROY_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_ENABLE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_DISABLE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ */
-+#define ZWP_TEXT_INPUT_V3_COMMIT_SINCE_VERSION 1
-+
-+/** @ingroup iface_zwp_text_input_v3 */
-+static inline void
-+zwp_text_input_v3_set_user_data(struct zwp_text_input_v3 *zwp_text_input_v3, void *user_data)
-+{
-+ wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v3, user_data);
-+}
-+
-+/** @ingroup iface_zwp_text_input_v3 */
-+static inline void *
-+zwp_text_input_v3_get_user_data(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v3);
-+}
-+
-+static inline uint32_t
-+zwp_text_input_v3_get_version(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Destroy the wp_text_input object. Also disables all surfaces enabled
-+ * through this wp_text_input object.
-+ */
-+static inline void
-+zwp_text_input_v3_destroy(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), WL_MARSHAL_FLAG_DESTROY);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Requests text input on the surface previously obtained from the enter
-+ * event.
-+ *
-+ * This request must be issued every time the focused text input changes
-+ * to a new one, including within the current surface. Use
-+ * zwp_text_input_v3.disable when there is no longer any input focus on
-+ * the current surface.
-+ *
-+ * Clients must not enable more than one text input on the single seat
-+ * and should disable the current text input before enabling the new one.
-+ * Requests to enable a text input when another text input is enabled
-+ * on the same seat must be ignored by compositor.
-+ *
-+ * This request resets all state associated with previous enable, disable,
-+ * set_surrounding_text, set_text_change_cause, set_content_type, and
-+ * set_cursor_rectangle requests, as well as the state associated with
-+ * preedit_string, commit_string, and delete_surrounding_text events.
-+ *
-+ * The set_surrounding_text, set_content_type and set_cursor_rectangle
-+ * requests must follow if the text input supports the necessary
-+ * functionality.
-+ *
-+ * State set with this request is double-buffered. It will get applied on
-+ * the next zwp_text_input_v3.commit request, and stay valid until the
-+ * next committed enable or disable request.
-+ *
-+ * The changes must be applied by the compositor after issuing a
-+ * zwp_text_input_v3.commit request.
-+ */
-+static inline void
-+zwp_text_input_v3_enable(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_ENABLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Explicitly disable text input on the current surface (typically when
-+ * there is no focus on any text entry inside the surface).
-+ *
-+ * State set with this request is double-buffered. It will get applied on
-+ * the next zwp_text_input_v3.commit request.
-+ */
-+static inline void
-+zwp_text_input_v3_disable(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_DISABLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Sets the surrounding plain text around the input, excluding the preedit
-+ * text.
-+ *
-+ * The client should notify the compositor of any changes in any of the
-+ * values carried with this request, including changes caused by handling
-+ * incoming text-input events as well as changes caused by other
-+ * mechanisms like keyboard typing.
-+ *
-+ * If the client is unaware of the text around the cursor, it should not
-+ * issue this request, to signify lack of support to the compositor.
-+ *
-+ * Text is UTF-8 encoded, and should include the cursor position, the
-+ * complete selection and additional characters before and after them.
-+ * There is a maximum length of wayland messages, so text can not be
-+ * longer than 4000 bytes.
-+ *
-+ * Cursor is the byte offset of the cursor within text buffer.
-+ *
-+ * Anchor is the byte offset of the selection anchor within text buffer.
-+ * If there is no selected text, anchor is the same as cursor.
-+ *
-+ * If any preedit text is present, it is replaced with a cursor for the
-+ * purpose of this event.
-+ *
-+ * Values set with this request are double-buffered. They will get applied
-+ * on the next zwp_text_input_v3.commit request, and stay valid until the
-+ * next committed enable or disable request.
-+ *
-+ * The initial state for affected fields is empty, meaning that the text
-+ * input does not support sending surrounding text. If the empty values
-+ * get applied, subsequent attempts to change them may have no effect.
-+ */
-+static inline void
-+zwp_text_input_v3_set_surrounding_text(struct zwp_text_input_v3 *zwp_text_input_v3, const char *text, int32_t cursor, int32_t anchor)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_SET_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, text, cursor, anchor);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Tells the compositor why the text surrounding the cursor changed.
-+ *
-+ * Whenever the client detects an external change in text, cursor, or
-+ * anchor posision, it must issue this request to the compositor. This
-+ * request is intended to give the input method a chance to update the
-+ * preedit text in an appropriate way, e.g. by removing it when the user
-+ * starts typing with a keyboard.
-+ *
-+ * cause describes the source of the change.
-+ *
-+ * The value set with this request is double-buffered. It must be applied
-+ * and reset to initial at the next zwp_text_input_v3.commit request.
-+ *
-+ * The initial value of cause is input_method.
-+ */
-+static inline void
-+zwp_text_input_v3_set_text_change_cause(struct zwp_text_input_v3 *zwp_text_input_v3, uint32_t cause)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_SET_TEXT_CHANGE_CAUSE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, cause);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Sets the content purpose and content hint. While the purpose is the
-+ * basic purpose of an input field, the hint flags allow to modify some of
-+ * the behavior.
-+ *
-+ * Values set with this request are double-buffered. They will get applied
-+ * on the next zwp_text_input_v3.commit request.
-+ * Subsequent attempts to update them may have no effect. The values
-+ * remain valid until the next committed enable or disable request.
-+ *
-+ * The initial value for hint is none, and the initial value for purpose
-+ * is normal.
-+ */
-+static inline void
-+zwp_text_input_v3_set_content_type(struct zwp_text_input_v3 *zwp_text_input_v3, uint32_t hint, uint32_t purpose)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_SET_CONTENT_TYPE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, hint, purpose);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Marks an area around the cursor as a x, y, width, height rectangle in
-+ * surface local coordinates.
-+ *
-+ * Allows the compositor to put a window with word suggestions near the
-+ * cursor, without obstructing the text being input.
-+ *
-+ * If the client is unaware of the position of edited text, it should not
-+ * issue this request, to signify lack of support to the compositor.
-+ *
-+ * Values set with this request are double-buffered. They will get applied
-+ * on the next zwp_text_input_v3.commit request, and stay valid until the
-+ * next committed enable or disable request.
-+ *
-+ * The initial values describing a cursor rectangle are empty. That means
-+ * the text input does not support describing the cursor area. If the
-+ * empty values get applied, subsequent attempts to change them may have
-+ * no effect.
-+ */
-+static inline void
-+zwp_text_input_v3_set_cursor_rectangle(struct zwp_text_input_v3 *zwp_text_input_v3, int32_t x, int32_t y, int32_t width, int32_t height)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_SET_CURSOR_RECTANGLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0, x, y, width, height);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v3
-+ *
-+ * Atomically applies state changes recently sent to the compositor.
-+ *
-+ * The commit request establishes and updates the state of the client, and
-+ * must be issued after any changes to apply them.
-+ *
-+ * Text input state (enabled status, content purpose, content hint,
-+ * surrounding text and change cause, cursor rectangle) is conceptually
-+ * double-buffered within the context of a text input, i.e. between a
-+ * committed enable request and the following committed enable or disable
-+ * request.
-+ *
-+ * Protocol requests modify the pending state, as opposed to the current
-+ * state in use by the input method. A commit request atomically applies
-+ * all pending state, replacing the current state. After commit, the new
-+ * pending state is as documented for each related request.
-+ *
-+ * Requests are applied in the order of arrival.
-+ *
-+ * Neither current nor pending state are modified unless noted otherwise.
-+ *
-+ * The compositor must count the number of commit requests coming from
-+ * each zwp_text_input_v3 object and use the count as the serial in done
-+ * events.
-+ */
-+static inline void
-+zwp_text_input_v3_commit(struct zwp_text_input_v3 *zwp_text_input_v3)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v3,
-+ ZWP_TEXT_INPUT_V3_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v3), 0);
-+}
-+
-+#define ZWP_TEXT_INPUT_MANAGER_V3_DESTROY 0
-+#define ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT 1
-+
-+
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v3
-+ */
-+#define ZWP_TEXT_INPUT_MANAGER_V3_DESTROY_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v3
-+ */
-+#define ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT_SINCE_VERSION 1
-+
-+/** @ingroup iface_zwp_text_input_manager_v3 */
-+static inline void
-+zwp_text_input_manager_v3_set_user_data(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3, void *user_data)
-+{
-+ wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v3, user_data);
-+}
-+
-+/** @ingroup iface_zwp_text_input_manager_v3 */
-+static inline void *
-+zwp_text_input_manager_v3_get_user_data(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
-+{
-+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v3);
-+}
-+
-+static inline uint32_t
-+zwp_text_input_manager_v3_get_version(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
-+{
-+ return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v3
-+ *
-+ * Destroy the wp_text_input_manager object.
-+ */
-+static inline void
-+zwp_text_input_manager_v3_destroy(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v3,
-+ ZWP_TEXT_INPUT_MANAGER_V3_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3), WL_MARSHAL_FLAG_DESTROY);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v3
-+ *
-+ * Creates a new text-input object for a given seat.
-+ */
-+static inline struct zwp_text_input_v3 *
-+zwp_text_input_manager_v3_get_text_input(struct zwp_text_input_manager_v3 *zwp_text_input_manager_v3, struct wl_seat *seat)
-+{
-+ struct wl_proxy *id;
-+
-+ id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v3,
-+ ZWP_TEXT_INPUT_MANAGER_V3_GET_TEXT_INPUT, &zwp_text_input_v3_interface, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v3), 0, NULL, seat);
-+
-+ return (struct zwp_text_input_v3 *) id;
-+}
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
---
-2.52.0
-
-From b0cec0974488d9e98e16b9c40861062a31fe0571 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 5 Feb 2026 20:57:06 +0900
-Subject: [PATCH 2/3] src/ibustypes: Update IBusInputPurpose and IBusInputHints
-
-Add IBUS_INPUT_PURPOSE_DATE, IBUS_INPUT_PURPOSE_TIME,
-IBUS_INPUT_PURPOSE_DATETIME to IBusInputPurpose and
-add IBUS_INPUT_HINT_LATIN, IBUS_INPUT_HINT_MULTILINE to IBusInputHints
-to support the Wayland text-input protocol V1, V3.
-
-BUG=https://github.com/ibus/ibus/pull/2853
----
- src/ibustypes.h | 21 ++++++++++++++++++---
- 1 file changed, 18 insertions(+), 3 deletions(-)
-
-diff --git a/src/ibustypes.h b/src/ibustypes.h
-index 1836096b..16a5bc05 100644
---- a/src/ibustypes.h
-+++ b/src/ibustypes.h
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2010-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2010-2026 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2025 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -274,6 +274,12 @@ typedef void (* IBusFreeFunc) (gpointer object);
- * characters are hidden
- * @IBUS_INPUT_PURPOSE_TERMINAL: Allow any character, in addition to control
- * codes. Since 1.5.24
-+ * @IBUS_INPUT_PURPOSE_DATE: Input a date for the Wayland text-input protocol
-+ * V1/V3. Since 1.5.34
-+ * @IBUS_INPUT_PURPOSE_TIME: Input a time for the Wayland text-input protocol
-+ * V1/V3. Since 1.5.34
-+ * @IBUS_INPUT_PURPOSE_DATETIME: Input a date and time for the Wayland
-+ * text-input protocol V1/V3. Since 1.5.34
- *
- * Describes primary purpose of the input context. This information
- * is particularly useful to implement intelligent behavior in
-@@ -308,7 +314,10 @@ typedef enum
- IBUS_INPUT_PURPOSE_NAME,
- IBUS_INPUT_PURPOSE_PASSWORD,
- IBUS_INPUT_PURPOSE_PIN,
-- IBUS_INPUT_PURPOSE_TERMINAL
-+ IBUS_INPUT_PURPOSE_TERMINAL,
-+ IBUS_INPUT_PURPOSE_DATE,
-+ IBUS_INPUT_PURPOSE_TIME,
-+ IBUS_INPUT_PURPOSE_DATETIME
- } IBusInputPurpose;
-
- /**
-@@ -332,6 +341,10 @@ typedef enum
- * update personalized data (like typing history). Since 1.5.26
- * @IBUS_INPUT_HINT_HIDDEN_TEXT: The text is hidden (e.g. password fields).
- * Since 1.5.34
-+ * @IBUS_INPUT_HINT_LATIN: Just latin characters should be entered for the
-+ * text-input protocol V1/V3. Since 1.5.34
-+ * @IBUS_INPUT_HINT_MULTILINE: Suggest the text input is multiline for the
-+ * text-input protocol V1/V3. Since 1.5.34
- *
- * Describes hints that might be taken into account by engines. Note
- * that engines may already tailor their behaviour according to the
-@@ -360,7 +373,9 @@ typedef enum
- IBUS_INPUT_HINT_EMOJI = 1 << 9,
- IBUS_INPUT_HINT_NO_EMOJI = 1 << 10,
- IBUS_INPUT_HINT_PRIVATE = 1 << 11,
-- IBUS_INPUT_HINT_HIDDEN_TEXT = 1 << 12
-+ IBUS_INPUT_HINT_HIDDEN_TEXT = 1 << 12,
-+ IBUS_INPUT_HINT_LATIN = 1 << 13,
-+ IBUS_INPUT_HINT_MULTILINE = 1 << 14
- } IBusInputHints;
-
- /**
---
-2.52.0
-
-From 7b014b587259531c2793778c73111e0e61b6c157 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 5 Feb 2026 21:12:37 +0900
-Subject: [PATCH 3/3] client/wayland: Support input purpose and hints
-
-BUG=https://github.com/ibus/ibus/pull/2853
----
- client/wayland/Makefile.am | 6 +-
- client/wayland/ibuswaylandim.c | 191 ++++++++++++++++++++++++++++++++-
- 2 files changed, 193 insertions(+), 4 deletions(-)
-
-diff --git a/client/wayland/Makefile.am b/client/wayland/Makefile.am
-index 52914803..25269557 100644
---- a/client/wayland/Makefile.am
-+++ b/client/wayland/Makefile.am
-@@ -3,7 +3,7 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2019-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2019-2026 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2007-2019 Red Hat, Inc.
- #
- # This library is free software; you can redistribute it and/or modify
-@@ -34,6 +34,7 @@ protocol_sources = \
- input-method-unstable-v2-client-protocol.h \
- input-method-unstable-v2-protocol.c \
- text-input-unstable-v1-client-protocol.h \
-+ text-input-unstable-v3-client-protocol.h \
- virtual-keyboard-unstable-v1-client-protocol.h \
- virtual-keyboard-unstable-v1-protocol.c \
- $(NULL)
-@@ -95,6 +96,9 @@ input-method-unstable-v2-protocol.c: $(srcdir)/input-method-unstable-v2.xml
- text-input-unstable-v1-client-protocol.h: $(wayland_text_protocoldir)/text-input-unstable-v1.xml
- $(AM_V_GEN)$(wayland_scanner) client-header $< $@
-
-+text-input-unstable-v3-client-protocol.h: $(wayland_text_protocoldir)/text-input-unstable-v3.xml
-+ $(AM_V_GEN)$(wayland_scanner) client-header $< $@
-+
- virtual-keyboard-unstable-v1-client-protocol.h: $(srcdir)/virtual-keyboard-unstable-v1.xml
- $(AM_V_GEN)$(wayland_scanner) client-header $< $@
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index a2c91321..495918e2 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2019-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2019-2026 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2013 Intel Corporation
- * Copyright (C) 2013-2025 Red Hat, Inc.
- *
-@@ -35,6 +35,7 @@
- #include "input-method-unstable-v1-client-protocol.h"
- #include "input-method-unstable-v2-client-protocol.h"
- #include "text-input-unstable-v1-client-protocol.h"
-+#include "text-input-unstable-v3-client-protocol.h"
- #include "virtual-keyboard-unstable-v1-client-protocol.h"
- #include "ibuswaylandim.h"
-
-@@ -124,6 +125,8 @@ struct _IBusWaylandIMPrivate
- guint preedit_mode;
- IBusModifierType modifiers;
- gboolean hiding_preedit_text;
-+ IBusInputHints ibus_hints;
-+ IBusInputPurpose ibus_purpose;
-
- #if ENABLE_SURROUNDING
- IBusText *surrounding_text;
-@@ -834,9 +837,98 @@ context_reset_v1 (void *data,
- static void
- context_content_type_v1 (void *data,
- struct zwp_input_method_context_v1 *context_v1,
-- uint32_t hint,
-+ uint32_t hints,
- uint32_t purpose)
- {
-+ IBusWaylandIM *wlim = data;
-+ IBusWaylandIMPrivate *priv;
-+ IBusInputHints ibus_hints = IBUS_INPUT_HINT_NONE;
-+ IBusInputPurpose ibus_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+
-+ g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
-+ priv = ibus_wayland_im_get_instance_private (wlim);
-+
-+ /* ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD == HIDDEN_TEXT & SENSITIVE_DATA
-+ * ZWP_TEXT_INPUT_V1_CONTENT_HINT_DEFAULT == AUTO_COMPLETION &
-+ * AUTO_CORRECTION &
-+ * AUTO_CAPITALIZATION
-+ */
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION)
-+ ibus_hints |= IBUS_INPUT_HINT_WORD_COMPLETION;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CORRECTION)
-+ ibus_hints |= IBUS_INPUT_HINT_SPELLCHECK;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_SENTENCES;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE)
-+ ibus_hints |= IBUS_INPUT_HINT_LOWERCASE;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_CHARS;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_TITLECASE)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_WORDS;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_HIDDEN_TEXT)
-+ ibus_hints |= IBUS_INPUT_HINT_HIDDEN_TEXT;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA)
-+ ibus_hints |= IBUS_INPUT_HINT_PRIVATE;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN)
-+ ibus_hints |= IBUS_INPUT_HINT_LATIN;
-+ if (hints & ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE)
-+ ibus_hints |= IBUS_INPUT_HINT_MULTILINE;
-+
-+ switch (purpose) {
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ALPHA:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_ALPHA;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DIGITS;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_NUMBER;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PHONE:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_PHONE;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_URL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_URL;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_EMAIL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_EMAIL;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NAME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_NAME;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PASSWORD:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_PASSWORD;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATE:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DATE;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TIME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_TIME;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATETIME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DATETIME;
-+ break;
-+ case ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TERMINAL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_TERMINAL;
-+ break;
-+ default:
-+ g_warning ("Wrong purpose in the input-method context: %d", purpose);
-+ }
-+
-+ priv->ibus_hints = ibus_hints;
-+ priv->ibus_purpose = ibus_purpose;
-+
-+ /* Update priv->ibus_[hints|purpose] after _create_input_context_done()
-+ * is called.
-+ */
-+ if (G_UNLIKELY (priv->ibuscontext)) {
-+ ibus_input_context_set_content_type (priv->ibuscontext,
-+ ibus_purpose,
-+ ibus_hints);
-+ }
- }
-
-
-@@ -1863,6 +1955,9 @@ _create_input_context_done (GObject *object,
- 0,
- g_dbus_proxy_get_object_path (
- G_DBUS_PROXY (priv->ibuscontext)));
-+ ibus_input_context_set_content_type (priv->ibuscontext,
-+ priv->ibus_purpose,
-+ priv->ibus_hints);
- }
- }
-
-@@ -1909,6 +2004,9 @@ input_method_activate (void *data,
- g_assert_not_reached ();
- }
-
-+ priv->ibus_hints = IBUS_INPUT_HINT_NONE;
-+ priv->ibus_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+
- g_assert (!priv->ibuscontext);
-
- priv->cancellable = g_cancellable_new ();
-@@ -2079,9 +2177,96 @@ input_method_text_change_cause_v2 (void *data,
- static void
- input_method_content_type_v2 (void *data,
- struct zwp_input_method_v2 *input_method_v2,
-- uint32_t hint,
-+ uint32_t hints,
- uint32_t purpose)
- {
-+ IBusWaylandIM *wlim = data;
-+ IBusWaylandIMPrivate *priv;
-+ IBusInputHints ibus_hints = IBUS_INPUT_HINT_NONE;
-+ IBusInputPurpose ibus_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+
-+ g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
-+ priv = ibus_wayland_im_get_instance_private (wlim);
-+
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_COMPLETION)
-+ ibus_hints |= IBUS_INPUT_HINT_WORD_COMPLETION;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_SPELLCHECK)
-+ ibus_hints |= IBUS_INPUT_HINT_SPELLCHECK;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_AUTO_CAPITALIZATION)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_SENTENCES;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_LOWERCASE)
-+ ibus_hints |= IBUS_INPUT_HINT_LOWERCASE;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_UPPERCASE)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_CHARS;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_TITLECASE)
-+ ibus_hints |= IBUS_INPUT_HINT_UPPERCASE_WORDS;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_HIDDEN_TEXT)
-+ ibus_hints |= IBUS_INPUT_HINT_HIDDEN_TEXT;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_SENSITIVE_DATA)
-+ ibus_hints |= IBUS_INPUT_HINT_PRIVATE;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_LATIN)
-+ ibus_hints |= IBUS_INPUT_HINT_LATIN;
-+ if (hints & ZWP_TEXT_INPUT_V3_CONTENT_HINT_MULTILINE)
-+ ibus_hints |= IBUS_INPUT_HINT_MULTILINE;
-+
-+ switch (purpose) {
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NORMAL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_ALPHA:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_ALPHA;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DIGITS:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DIGITS;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NUMBER:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_NUMBER;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PHONE:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_PHONE;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_URL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_URL;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_EMAIL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_EMAIL;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_NAME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_NAME;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PASSWORD:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_PASSWORD;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_PIN:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_PIN;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATE:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DATE;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TIME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_TIME;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_DATETIME:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_DATETIME;
-+ break;
-+ case ZWP_TEXT_INPUT_V3_CONTENT_PURPOSE_TERMINAL:
-+ ibus_purpose = IBUS_INPUT_PURPOSE_TERMINAL;
-+ break;
-+ default:
-+ g_warning ("Wrong purpose in the input-method context: %d", purpose);
-+ }
-+
-+ priv->ibus_hints = ibus_hints;
-+ priv->ibus_purpose = ibus_purpose;
-+
-+ /* Update priv->ibus_[hints|purpose] after _create_input_context_done()
-+ * is called.
-+ */
-+ if (G_UNLIKELY (priv->ibuscontext)) {
-+ ibus_input_context_set_content_type (priv->ibuscontext,
-+ ibus_purpose,
-+ ibus_hints);
-+ }
- }
-
-
---
-2.52.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:09 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:09 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 53ccbbc4add58d3d92c495f5cd1f6e93501e3e75
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2026-02-04T00:36:20+09:00
Stats : +0/-3370 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/53ccbbc4add58d3d92c495f5cd1f6e93501e3e75?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 4b2af15..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,3370 +0,0 @@
-From 563b433d721201e76b4e8ac6ea593e873fd72a13 Mon Sep 17 00:00:00 2001
-From: Arnout Engelen <arnout@bzzt.net>
-Date: Mon, 3 Nov 2025 09:49:46 +0100
-Subject: [PATCH] ui/gtk3: don't build in parallel
-
-As that led to nondeterministic generated method names. This
-only seems to have a small effect on performance (~10s on a
-whole fresh build).
-
-While I appreciate the ibus project doesn't consider such
-nondeterminisms as particularly problematic (#2272), having
-bitwise reproducible builds is increasingly desirable in Linux
-distributions, so hopefully you could consider applying this
-change nonetheless.
-
-BUG=https://github.com/ibus/ibus/pull/2821
----
- ui/gtk3/Makefile.am | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index d99d8e82..4df6c5eb 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -317,6 +317,8 @@ panelbinding.o: $(srcdir)/panelbinding.c
- $(AM_V_CC_no)$(COMPILE) -c -o $@ $<
- $(NULL)
-
-+.NOTPARALLEL:
-+
- MAINTAINERCLEANFILES += extension.c panelbinding.c
-
- man_seven_DATA = ibus-emoji.7
---
-2.51.0
-
-From 02032bc5f0fc89c7d18774758ae052dd3606408b Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 6 Oct 2025 20:40:17 +0900
-Subject: [PATCH 1/4] src: Fix GCC `-Wunused-but-set-variable` flag
-
-Add `G_GNUC_UNUSED` flag for the GCC warnings.
-
-BUG=https://github.com/ibus/ibus/pull/2805
----
- src/ibuscomponent.c | 4 ++--
- src/ibusmessage.c | 2 +-
- src/ibusserializable.c | 4 ++--
- 3 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/src/ibuscomponent.c b/src/ibuscomponent.c
-index 80ace332..c453a2f5 100644
---- a/src/ibuscomponent.c
-+++ b/src/ibuscomponent.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2020-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2020 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -729,7 +729,7 @@ ibus_component_new_varargs (const gchar *first_property_name, ...)
- {
- va_list var_args;
- IBusComponent *component;
-- IBusComponentPrivate *priv;
-+ G_GNUC_UNUSED IBusComponentPrivate *priv;
-
- g_assert (first_property_name);
-
-diff --git a/src/ibusmessage.c b/src/ibusmessage.c
-index 89e31771..12fbb48e 100644
---- a/src/ibusmessage.c
-+++ b/src/ibusmessage.c
-@@ -459,7 +459,7 @@ ibus_message_new (guint domain,
- GValue *values, *values_tmp;
- guint n_properties = 4, i;
- IBusMessage *msg;
-- IBusMessagePrivate *priv;
-+ G_GNUC_UNUSED IBusMessagePrivate *priv;
-
- g_return_val_if_fail (domain > 0 && domain <= G_MAXUINT8, NULL);
- g_return_val_if_fail (code <= G_MAXUINT8, NULL);
-diff --git a/src/ibusserializable.c b/src/ibusserializable.c
-index 231020b7..501841b3 100644
---- a/src/ibusserializable.c
-+++ b/src/ibusserializable.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -269,7 +269,7 @@ GVariant *
- ibus_serializable_serialize_object (IBusSerializable *object)
- {
- g_return_val_if_fail (IBUS_IS_SERIALIZABLE (object), FALSE);
-- gboolean retval;
-+ G_GNUC_UNUSED gboolean retval;
-
- GVariantBuilder builder;
- g_variant_builder_init (&builder, G_VARIANT_TYPE_TUPLE);
---
-2.51.1
-
-From c9d5d0f521de9f02a876c319c02978235a7453cc Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 6 Oct 2025 20:40:25 +0900
-Subject: [PATCH 2/4] ui/gtk3/application: --enable-wayland-im option without daemon
-
-Wish to run ibus-daemon after run ibus-ui-gtk3 for the debug purpose.
-
-BUG=https://github.com/ibus/ibus/pull/2805
----
- ui/gtk3/application.vala | 33 ++++++++++++++++++++++++---------
- 1 file changed, 24 insertions(+), 9 deletions(-)
-
-diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala
-index 82cc5397..65ab43cf 100644
---- a/ui/gtk3/application.vala
-+++ b/ui/gtk3/application.vala
-@@ -37,6 +37,7 @@ class Application {
- private static bool m_verbose;
- private static bool m_enable_wayland_im;
- #if USE_GDK_WAYLAND
-+ private static ulong m_bus_connected_id;
- private static ulong m_realize_surface_id;
- private static ulong m_ibus_focus_in_id;
- private static ulong m_ibus_focus_out_id;
-@@ -285,7 +286,7 @@ class Application {
- bus = new IBus.Bus();
- GLib.MainLoop? loop = null;
- if (!bus.is_connected() && m_exec_daemon) {
-- ulong handler_id = bus.connected.connect((bus) => {
-+ m_bus_connected_id = bus.connected.connect((bus) => {
- if (loop != null)
- loop.quit();
- });
-@@ -295,17 +296,31 @@ class Application {
- loop.run();
- }
- }
-- bus.disconnect(handler_id);
-+ bus.disconnect(m_bus_connected_id);
-+ m_bus_connected_id = 0;
- }
- if (!bus.is_connected()) {
-- m_log.printf("Failed to connect to ibus-daemon\n");
-- m_log.flush();
-- assert_not_reached();
-+ if (m_exec_daemon) {
-+ m_log.printf("Failed to connect to ibus-daemon\n");
-+ m_log.flush();
-+ assert_not_reached();
-+ } else {
-+ m_bus_connected_id = bus.connected.connect((bus) => {
-+ m_wayland_im = new IBus.WaylandIM("bus", bus,
-+ "wl_display", wl_display,
-+ "log", m_log,
-+ "verbose", m_verbose);
-+ bus.disconnect(m_bus_connected_id);
-+ m_bus_connected_id = 0;
-+ });
-+ }
-+ }
-+ if (bus.is_connected()) {
-+ m_wayland_im = new IBus.WaylandIM("bus", bus,
-+ "wl_display", wl_display,
-+ "log", m_log,
-+ "verbose", m_verbose);
- }
-- m_wayland_im = new IBus.WaylandIM("bus", bus,
-- "wl_display", wl_display,
-- "log", m_log,
-- "verbose", m_verbose);
- }
-
- private void set_wayland_surface(void *surface) {
---
-2.51.1
-
-From 1a9ea16b12d4e90e4caf74c4569a596660da6e9c Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 26 Nov 2025 14:55:28 +0900
-Subject: [PATCH 3/4] util/IMdkit: Fix memory leaks with fail safe
-
-- When malloc() is failed, the pointer should not be deallocated
- and also other allocated memory pointers should be freed in FrameMgr.c.
-- The `XIM_STRFUNC` macro implemented in XimProto.h.
-- GCC `-Wanalyzer-malloc-leak` flag does not have to warn the reallocation
- since the `address` pointer is not changed and `address->imvalue_mask`
- should work in i18nMethod.c
-- Seems GCC does not understand `if (!p->value)` and replace it with a
- wrapper variable in i18nMethod.c
-- Fix exit() from within signal handler by CWE-479 and
- `-Wanalyzer-unsafe-call-within-signal-handler` in client/x11/main.c
-
-BUG=https://github.com/ibus/ibus/pull/2805
----
- client/x11/main.c | 7 +-
- util/IMdkit/FrameMgr.c | 316 ++++++++++++++++++++++++++++++++++-----
- util/IMdkit/XimProto.h | 7 +-
- util/IMdkit/i18nMethod.c | 104 +++++++------
- 4 files changed, 352 insertions(+), 82 deletions(-)
-
-diff --git a/client/x11/main.c b/client/x11/main.c
-index ab9679dd..5fadd43d 100644
---- a/client/x11/main.c
-+++ b/client/x11/main.c
-@@ -1309,7 +1309,12 @@ _atexit_cb ()
- static void
- _sighandler (int sig)
- {
-- exit(EXIT_FAILURE);
-+ /* rhbz#1767691 _sighandler() is called with SIGTERM
-+ * and exit() causes SEGV during calling atexit functions.
-+ * _atexit_cb() might be broken. _exit() does not call
-+ * atexit functions.
-+ */
-+ _exit (EXIT_FAILURE);
- }
-
- static void
-diff --git a/util/IMdkit/FrameMgr.c b/util/IMdkit/FrameMgr.c
-index 80d019a0..976db94e 100644
---- a/util/IMdkit/FrameMgr.c
-+++ b/util/IMdkit/FrameMgr.c
-@@ -23,6 +23,7 @@ SOFTWARE.
- miyamoto@jrd.dec.com
-
- This version tidied and debugged by Steve Underwood May 1999
-+ This version tidied and debugged by Takao Fujiwara Nov 2025
-
- ******************************************************************/
-
-@@ -30,6 +31,7 @@ SOFTWARE.
- #include <assert.h>
- #include <stdlib.h>
- #include "FrameMgr.h"
-+#include "XimProto.h"
-
- /* Convenient macro */
-
-@@ -218,7 +220,11 @@ FrameMgr FrameMgrInit (XimFrame frame, char* area, Bool byte_swap)
- {
- FrameMgr fm;
-
-- fm = (FrameMgr) Xmalloc (sizeof (FrameMgrRec));
-+ if ((fm = (FrameMgr) Xmalloc (sizeof (FrameMgrRec))) == NULL) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return NULL;
-+ }
-
- fm->frame = frame;
- fm->fi = FrameInstInit (frame);
-@@ -259,7 +265,8 @@ void FrameMgrFree (FrameMgr fm)
- }
- /*endwhile*/
-
-- FrameInstFree (fm->fi);
-+ if (fm->fi)
-+ FrameInstFree (fm->fi);
- Xfree (fm);
- }
-
-@@ -868,7 +875,11 @@ static FrameInst FrameInstInit (XimFrame frame)
- {
- FrameInst fi;
-
-- fi = (FrameInst) Xmalloc (sizeof (FrameInstRec));
-+ if ((fi = (FrameInst) Xmalloc (sizeof (FrameInstRec))) == NULL) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return NULL;
-+ }
-
- fi->template = frame;
- fi->cur_no = 0;
-@@ -884,7 +895,7 @@ static void FrameInstFree (FrameInst fi)
-
- ChainIterInit (&ci, &fi->cm);
-
-- while (ChainIterGetNext (&ci, &frame_no, &d))
-+ while (ChainIterGetNext (&ci, &frame_no, &d) && fi->template)
- {
- register XimFrameType type;
- type = fi->template[frame_no].type;
-@@ -912,6 +923,11 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- {
- XimFrameType ret_type;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return -1;
-+ }
- ret_type = fi->template[fi->cur_no].type;
-
- switch (ret_type)
-@@ -944,7 +960,13 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, iter_idx)) == NULL)
- {
- dr.iter = IterInit (&fi->template[iter_idx + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, iter_idx, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return -1;
-+ }
- }
- /*endif*/
- info->counter.iter = d->iter;
-@@ -980,6 +1002,7 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- register int unit;
- register int number;
- register int size;
-+ register int s;
- register int i;
-
- unit = _UNIT ((long) fi->template[fi->cur_no].data);
-@@ -991,11 +1014,21 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- {
- i = _FrameInstDecrement (fi->template, i);
- assert (i >= 0);
-- size += _FrameInstGetItemSize (fi, i);
-+ s = _FrameInstGetItemSize (fi, i);
-+ if (s == NO_VALUE) {
-+ size = NO_VALUE;
-+ number = 0;
-+ break;
-+ } else {
-+ size += s;
-+ }
- number--;
- }
- /*endwhile*/
-- info->num = (unit - (size%unit))%unit;
-+ if (size == NO_VALUE)
-+ info->num = NO_VALUE;
-+ else
-+ info->num = (unit - (size%unit))%unit;
- }
- /*endif*/
- fi->cur_no = _FrameInstIncrement (fi->template, fi->cur_no);
-@@ -1011,7 +1044,13 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, fi->cur_no)) == NULL)
- {
- dr.iter = IterInit (&fi->template[fi->cur_no + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, fi->cur_no, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return -1;
-+ }
- }
- /*endif*/
- sub_type = IterGetNextType (d->iter, info);
-@@ -1037,7 +1076,13 @@ static XimFrameType FrameInstGetNextType(FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, fi->cur_no)) == NULL)
- {
- dr.fi = FrameInstInit (fi->template[fi->cur_no + 1].data);
-+ if (!dr.fi)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, fi->cur_no, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return -1;
-+ }
- }
- /*endif*/
- sub_type = FrameInstGetNextType (d->fi, info);
-@@ -1064,6 +1109,11 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- {
- XimFrameType ret_type;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return -1;
-+ }
- ret_type = fi->template[fi->cur_no].type;
-
- switch (ret_type)
-@@ -1096,7 +1146,13 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, iter_idx)) == NULL)
- {
- dr.iter = IterInit (&fi->template[iter_idx + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, iter_idx, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return -1;
-+ }
- }
- /*endif*/
- info->counter.iter = d->iter;
-@@ -1130,6 +1186,7 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- register int unit;
- register int number;
- register int size;
-+ register int s;
- register int i;
-
- unit = _UNIT ((long) fi->template[fi->cur_no].data);
-@@ -1141,11 +1198,21 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- {
- i = _FrameInstDecrement (fi->template, i);
- assert (i >= 0);
-- size += _FrameInstGetItemSize (fi, i);
-+ s = _FrameInstGetItemSize (fi, i);
-+ if (s == NO_VALUE) {
-+ size = NO_VALUE;
-+ number = 0;
-+ break;
-+ } else {
-+ size += s;
-+ }
- number--;
- }
- /*endwhile*/
-- info->num = (unit - (size%unit))%unit;
-+ if (size == NO_VALUE)
-+ info->num = NO_VALUE;
-+ else
-+ info->num = (unit - (size%unit))%unit;
- }
- /*endif*/
- break;
-@@ -1159,7 +1226,13 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, fi->cur_no)) == NULL)
- {
- dr.iter = IterInit (&fi->template[fi->cur_no + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, fi->cur_no, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return -1;
-+ }
- }
- /*endif*/
- sub_type = IterPeekNextType (d->iter, info);
-@@ -1180,7 +1253,13 @@ static XimFrameType FrameInstPeekNextType (FrameInst fi, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&fi->cm, fi->cur_no)) == NULL)
- {
- dr.fi = FrameInstInit (fi->template[fi->cur_no + 1].data);
-+ if (!dr.fi)
-+ return -1;
- d = ChainMgrSetData (&fi->cm, fi->cur_no, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return -1;
-+ }
- }
- /*endif*/
- sub_type = FrameInstPeekNextType (d->fi, info);
-@@ -1202,6 +1281,11 @@ static Bool FrameInstIsIterLoopEnd (FrameInst fi)
- {
- Bool ret = False;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return True;
-+ }
- if (fi->template[fi->cur_no].type == ITER)
- {
- ExtraData d = ChainMgrGetExtraData (&fi->cm, fi->cur_no);
-@@ -1313,6 +1397,11 @@ static FmStatus FrameInstSetSize (FrameInst fi, int num)
- XimFrameType type;
- register int i;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return FmNoMoreData;
-+ }
- i = 0;
- while ((type = fi->template[i].type) != EOL)
- {
-@@ -1323,6 +1412,8 @@ static FmStatus FrameInstSetSize (FrameInst fi, int num)
- {
- dr.num = -1;
- d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d)
-+ return FmNoMoreData;
- }
- /*endif*/
- if (d->num == NO_VALUE)
-@@ -1336,7 +1427,13 @@ static FmStatus FrameInstSetSize (FrameInst fi, int num)
- if ((d = ChainMgrGetExtraData (&fi->cm, i)) == NULL)
- {
- dr.iter = IterInit (&fi->template[i + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return FmNoMoreData;
- d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (IterSetSize (d->iter, num) == FmSuccess)
-@@ -1348,7 +1445,13 @@ static FmStatus FrameInstSetSize (FrameInst fi, int num)
- if ((d = ChainMgrGetExtraData(&fi->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit(fi->template[i + 1].data);
-- d = ChainMgrSetData(&fi->cm, i, dr);
-+ if (!dr.fi)
-+ return FmNoMoreData;
-+ d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (FrameInstSetSize(d->fi, num) == FmSuccess)
-@@ -1374,6 +1477,11 @@ static int FrameInstGetSize (FrameInst fi)
- ExtraDataRec dr;
- int ret_size;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return NO_VALID_FIELD;
-+ }
- i = fi->cur_no;
- while ((type = fi->template[i].type) != EOL)
- {
-@@ -1389,7 +1497,13 @@ static int FrameInstGetSize (FrameInst fi)
- if ((d = ChainMgrGetExtraData (&fi->cm, i)) == NULL)
- {
- dr.iter = IterInit (&fi->template[i + 1], NO_VALUE);
-+ if (!dr.iter)
-+ return NO_VALID_FIELD;
- d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return NO_VALID_FIELD;
-+ }
- }
- /*endif*/
- ret_size = IterGetSize(d->iter);
-@@ -1402,7 +1516,13 @@ static int FrameInstGetSize (FrameInst fi)
- if ((d = ChainMgrGetExtraData (&fi->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (fi->template[i + 1].data);
-+ if (!dr.fi)
-+ return NO_VALID_FIELD;
- d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return NO_VALID_FIELD;
-+ }
- }
- /*endif*/
- ret_size = FrameInstGetSize (d->fi);
-@@ -1428,6 +1548,11 @@ static FmStatus FrameInstSetIterCount (FrameInst fi, int num)
- register int i;
- XimFrameType type;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return FmNoMoreData;
-+ }
- i = 0;
- while ((type = fi->template[i].type) != EOL)
- {
-@@ -1437,7 +1562,12 @@ static FmStatus FrameInstSetIterCount (FrameInst fi, int num)
- if ((d = ChainMgrGetExtraData (&fi->cm, i)) == NULL)
- {
- dr.iter = IterInit (&fi->template[i + 1], num);
-- (void)ChainMgrSetData (&fi->cm, i, dr);
-+ if (!dr.iter)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData (&fi->cm, i, dr)) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- return FmSuccess;
- }
- /*endif*/
-@@ -1450,7 +1580,13 @@ static FmStatus FrameInstSetIterCount (FrameInst fi, int num)
- if ((d = ChainMgrGetExtraData (&fi->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (fi->template[i + 1].data);
-+ if (!dr.fi)
-+ return FmNoMoreData;
- d = ChainMgrSetData (&fi->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (FrameInstSetIterCount (d->fi, num) == FmSuccess)
-@@ -1472,14 +1608,26 @@ static FmStatus FrameInstSetIterCount (FrameInst fi, int num)
- static int FrameInstGetTotalSize (FrameInst fi)
- {
- register int size;
-+ register int s;
- register int i;
-
- size = 0;
- i = 0;
-
-+ if (!fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: fi != NULL in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return 0;
-+ }
- while (fi->template[i].type != EOL)
- {
-- size += _FrameInstGetItemSize (fi, i);
-+ s = _FrameInstGetItemSize (fi, i);
-+ if (s == NO_VALUE) {
-+ size = NO_VALUE;
-+ break;
-+ } else {
-+ size += s;
-+ }
- assert (i >= 0);
- i = _FrameInstIncrement (fi->template, i);
- }
-@@ -1526,8 +1674,8 @@ static Iter IterInit (XimFrame frame, int count)
-
- it = (Iter) Xmalloc (sizeof (IterRec));
- if (!it) {
-- fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-- __FILE__, __LINE__);
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
- return NULL;
- }
- it->template = frame;
-@@ -1600,7 +1748,7 @@ static void IterFree (Iter it)
- ExtraDataRec dr;
-
- ChainIterInit (&ci, &it->cm);
-- while (ChainIterGetNext (&ci, &count, &dr))
-+ while (ChainIterGetNext (&ci, &count, &dr) && dr.fi)
- FrameInstFree (dr.fi);
- /*endwhile*/
- ChainIterFree (&ci);
-@@ -1638,8 +1786,12 @@ static Bool IterIsLoopEnd (Iter it, Bool *myself)
- }
- else
- {
-- if (FrameInstIsEnd (d->fi))
-- {
-+ if (!d->fi) {
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: d->fi != NULL " \
-+ "in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ ret = True;
-+ } else if (FrameInstIsEnd (d->fi)) {
- it->cur_no++;
- if (!it->allow_expansion && it->cur_no == it->max_count)
- {
-@@ -1677,9 +1829,9 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
- XimFrameType type;
-
- if (!it || !it->template) {
-- fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-- __FILE__, __LINE__);
-- return (XimFrameType) NULL;
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return (XimFrameType)NULL;
- }
-
- type = it->template->type;
-@@ -1732,7 +1884,13 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&it->cm, it->cur_no)) == NULL)
- {
- dr.iter = IterInit (it->template + 1, NO_VALUE);
-+ if (!dr.iter)
-+ return (XimFrameType)NULL;
- d = ChainMgrSetData (&it->cm, it->cur_no, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return (XimFrameType)NULL;
-+ }
- }
- /*endif*/
-
-@@ -1755,7 +1913,13 @@ static XimFrameType IterGetNextType (Iter it, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&it->cm, it->cur_no)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return (XimFrameType)NULL;
- d = ChainMgrSetData (&it->cm, it->cur_no, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return (XimFrameType)NULL;
-+ }
- }
- /*endif*/
-
-@@ -1781,9 +1945,9 @@ static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info)
- XimFrameType type;
-
- if (!it->template) {
-- fprintf (stderr, "(XIM-IMdkit) WARNING: dereference pointer %s:%d.\n",
-- __FILE__, __LINE__);
-- return (XimFrameType) NULL;
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: dereference pointer %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
-+ return (XimFrameType)NULL;
- }
-
- type = it->template->type;
-@@ -1823,7 +1987,13 @@ static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&it->cm, it->cur_no)) == NULL)
- {
- dr.iter = IterInit (it->template + 1, NO_VALUE);
-+ if (!dr.iter)
-+ return (XimFrameType)NULL;
- d = ChainMgrSetData (&it->cm, it->cur_no, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return (XimFrameType)NULL;
-+ }
- }
- /*endif*/
-
-@@ -1843,7 +2013,13 @@ static XimFrameType IterPeekNextType (Iter it, XimFrameTypeInfo info)
- if ((d = ChainMgrGetExtraData (&it->cm, it->cur_no)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return (XimFrameType)NULL;
- d = ChainMgrSetData (&it->cm, it->cur_no, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return (XimFrameType)NULL;
-+ }
- }
- /*endif*/
-
-@@ -1885,9 +2061,8 @@ static FmStatus IterSetSize (Iter it, int num)
- {
- dr.num = NO_VALUE;
- d = ChainMgrSetData (&it->cm, i, dr);
-- }
-- if (!d) {
-- return FmNoMoreData;
-+ if (!d)
-+ return FmNoMoreData;
- }
- /*endif*/
- if (d->num == NO_VALUE)
-@@ -1903,7 +2078,8 @@ static FmStatus IterSetSize (Iter it, int num)
- ExtraDataRec dr;
-
- dr.num = num;
-- ChainMgrSetData (&it->cm, it->max_count, dr);
-+ if (!ChainMgrSetData (&it->cm, it->max_count, dr))
-+ return FmNoMoreData;
- it->max_count++;
-
- return FmSuccess;
-@@ -1922,7 +2098,13 @@ static FmStatus IterSetSize (Iter it, int num)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.iter = IterInit (it->template + 1, NO_VALUE);
-+ if (!dr.iter)
-+ return FmNoMoreData;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (IterSetSize (d->iter, num) == FmSuccess)
-@@ -1935,7 +2117,12 @@ static FmStatus IterSetSize (Iter it, int num)
- ExtraDataRec dr;
-
- dr.iter = IterInit (it->template + 1, NO_VALUE);
-- ChainMgrSetData (&it->cm, it->max_count, dr);
-+ if (!dr.iter)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData (&it->cm, it->max_count, dr)) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- it->max_count++;
-
- if (IterSetSize(dr.iter, num) == FmSuccess)
-@@ -1956,7 +2143,13 @@ static FmStatus IterSetSize (Iter it, int num)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return FmNoMoreData;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (FrameInstSetSize (d->fi, num) == FmSuccess)
-@@ -1969,7 +2162,12 @@ static FmStatus IterSetSize (Iter it, int num)
- ExtraDataRec dr;
-
- dr.fi = FrameInstInit (it->template[1].data);
-- ChainMgrSetData (&it->cm, it->max_count, dr);
-+ if (!dr.fi)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData (&it->cm, it->max_count, dr)) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- it->max_count++;
-
- if (FrameInstSetSize (dr.fi, num) == FmSuccess)
-@@ -2013,7 +2211,13 @@ static int IterGetSize (Iter it)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.iter = IterInit (it->template + 1, NO_VALUE);
-+ if (!dr.iter)
-+ return NO_VALID_FIELD;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ IterFree (dr.iter);
-+ return NO_VALID_FIELD;
-+ }
- }
- /*endif*/
- ret_size = IterGetSize (d->iter);
-@@ -2032,7 +2236,13 @@ static int IterGetSize (Iter it)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return NO_VALID_FIELD;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return NO_VALID_FIELD;
-+ }
- }
- /*endif*/
- ret_size = FrameInstGetSize (d->fi);
-@@ -2077,7 +2287,12 @@ static FmStatus IterSetIterCount (Iter it, int num)
- if ((d = ChainMgrGetExtraData(&it->cm, i)) == NULL)
- {
- dr.iter = IterInit(it->template + 1, num);
-- (void)ChainMgrSetData(&it->cm, i, dr);
-+ if (!dr.iter)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData(&it->cm, i, dr)) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- return FmSuccess;
- }
- /*endif*/
-@@ -2091,7 +2306,12 @@ static FmStatus IterSetIterCount (Iter it, int num)
- ExtraDataRec dr;
-
- dr.iter = IterInit (it->template + 1, num);
-- ChainMgrSetData (&it->cm, it->max_count, dr);
-+ if (!dr.iter)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData (&it->cm, it->max_count, dr)) {
-+ IterFree (dr.iter);
-+ return FmNoMoreData;
-+ }
- it->max_count++;
-
- return FmSuccess;
-@@ -2108,7 +2328,13 @@ static FmStatus IterSetIterCount (Iter it, int num)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return FmNoMoreData;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- }
- /*endif*/
- if (FrameInstSetIterCount (d->fi, num) == FmSuccess)
-@@ -2121,7 +2347,12 @@ static FmStatus IterSetIterCount (Iter it, int num)
- ExtraDataRec dr;
-
- dr.fi = FrameInstInit (it->template[1].data);
-- ChainMgrSetData (&it->cm, it->max_count, dr);
-+ if (!dr.fi)
-+ return FmNoMoreData;
-+ if (!ChainMgrSetData (&it->cm, it->max_count, dr)) {
-+ FrameInstFree (dr.fi);
-+ return FmNoMoreData;
-+ }
- it->max_count++;
-
- if (FrameInstSetIterCount (dr.fi, num) == FmSuccess)
-@@ -2215,7 +2446,13 @@ static int IterGetTotalSize (Iter it)
- if ((d = ChainMgrGetExtraData (&it->cm, i)) == NULL)
- {
- dr.fi = FrameInstInit (it->template[1].data);
-+ if (!dr.fi)
-+ return NO_VALUE;
- d = ChainMgrSetData (&it->cm, i, dr);
-+ if (!d) {
-+ FrameInstFree (dr.fi);
-+ return NO_VALUE;
-+ }
- }
- /*endif*/
- if ((num = FrameInstGetTotalSize (d->fi)) == NO_VALUE)
-@@ -2278,8 +2515,8 @@ static ExtraData ChainMgrSetData (ChainMgr cm,
- {
- Chain cur = (Chain) Xmalloc (sizeof (ChainRec));
- if (!cur) {
-- fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
-- __FILE__, __LINE__);
-+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%s.\n",
-+ __FILE__, XIM_STRFUNC);
- return NULL;
- }
-
-@@ -2445,6 +2682,7 @@ static int _FrameInstGetItemSize (FrameInst fi, int cur_no)
- register int unit;
- register int number;
- register int size;
-+ register int s;
- register int i;
-
- unit = _UNIT ((long) fi->template[cur_no].data);
-@@ -2456,11 +2694,19 @@ static int _FrameInstGetItemSize (FrameInst fi, int cur_no)
- {
- assert (i >= 0);
- i = _FrameInstDecrement (fi->template, i);
-- size += _FrameInstGetItemSize (fi, i);
-+ s = _FrameInstGetItemSize (fi, i);
-+ if (s == NO_VALUE) {
-+ size = NO_VALUE;
-+ number = 0;
-+ break;
-+ } else {
-+ size += s;
-+ }
- number--;
- }
- /*endwhile*/
-- size = (unit - (size%unit))%unit;
-+ if (size != NO_VALUE)
-+ size = (unit - (size%unit))%unit;
- return size;
- }
-
-diff --git a/util/IMdkit/XimProto.h b/util/IMdkit/XimProto.h
-index e3ed168c..a25213f5 100644
---- a/util/IMdkit/XimProto.h
-+++ b/util/IMdkit/XimProto.h
-@@ -1,4 +1,4 @@
--/* $XConsortium: XimProto.h,v 1.2 94/01/20 18:02:24 rws Exp $ */
-+/* $XConsortium: XimProto.h,v 1.3 25/09/24 00:00:00 rws Exp $ */
- /******************************************************************
-
- Copyright 1992, 1993, 1994 by FUJITSU LIMITED
-@@ -226,5 +226,10 @@ typedef CARD16 XICID; /* Input Context ID */
- } \
- }
-
-+#if (defined(_MSC_VER) && (_MSC_VER > 1300))
-+#define XIM_STRFUNC ((const char*) (__FUNCTION__))
-+#else
-+#define XIM_STRFUNC ((const char*) (__func__))
- #endif
-
-+#endif
-diff --git a/util/IMdkit/i18nMethod.c b/util/IMdkit/i18nMethod.c
-index 7f343d87..f7a53f40 100644
---- a/util/IMdkit/i18nMethod.c
-+++ b/util/IMdkit/i18nMethod.c
-@@ -2,7 +2,8 @@
-
- Copyright 1994, 1995 by Sun Microsystems, Inc.
- Copyright 1993, 1994 by Hewlett-Packard Company
-- Copyright (C) 2014-2025 Red Hat, Inc.
-+ Copyright (C) 2008-2025 Red Hat, Inc.
-+ Copyright (C) 2018-2025 Takao Fujiwara
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
-@@ -37,6 +38,8 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- #endif
- #include <X11/Xproto.h>
- #undef NEED_EVENTS
-+#include <assert.h>
-+
- #include "FrameMgr.h"
- #include "IMdkit.h"
- #include "Xi18n.h"
-@@ -194,17 +197,18 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_LOCALE)
- return IMLocale;
- /*endif*/
-- /* address->im_locale will be released later and don't need
-- * -Wanalyzer-malloc-leak flag in gcc 11.0.1.
-+ /* xi18n_setup() initialize the `address` structure with 0 and
-+ * the pointer of the `address` is not changed and
-+ * `address->imvalue_mask` should avoid the reallocation so
-+ * the `-Wanalyzer-malloc-leak` flag in GCC 11.0.1 should not
-+ * warn about leaks of CWE-401.
- */
--#pragma GCC diagnostic push
--#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
-- address->im_locale = (char *) malloc (strlen (p->value) + 1);
-+ assert (!address->im_locale);
-+ address->im_locale = (char *)malloc (strlen (p->value) + 1);
- if (!address->im_locale)
- return IMLocale;
- /*endif*/
- strcpy (address->im_locale, p->value);
--#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_LOCALE;
- }
- else if (strcmp (p->name, IMServerTransport) == 0)
-@@ -212,14 +216,12 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_ADDRESS)
- return IMServerTransport;
- /*endif*/
--#pragma GCC diagnostic push
--#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
-- address->im_addr = (char *) malloc (strlen (p->value) + 1);
-+ assert (!address->im_addr);
-+ address->im_addr = (char *)malloc (strlen (p->value) + 1);
- if (!address->im_addr)
- return IMServerTransport;
- /*endif*/
- strcpy(address->im_addr, p->value);
--#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_ADDRESS;
- }
- else if (strcmp (p->name, IMServerName) == 0)
-@@ -227,14 +229,12 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IM_NAME)
- return IMServerName;
- /*endif*/
--#pragma GCC diagnostic push
--#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
-- address->im_name = (char *) malloc (strlen (p->value) + 1);
-+ assert (!address->im_name);
-+ address->im_name = (char *)malloc (strlen (p->value) + 1);
- if (!address->im_name)
- return IMServerName;
- /*endif*/
- strcpy (address->im_name, p->value);
--#pragma GCC diagnostic pop
- address->imvalue_mask |= I18N_IM_NAME;
- }
- else if (strcmp (p->name, IMServerWindow) == 0)
-@@ -242,7 +242,7 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- if (address->imvalue_mask & I18N_IMSERVER_WIN)
- return IMServerWindow;
- /*endif*/
-- address->im_window = (Window) p->value;
-+ address->im_window = (Window)p->value;
- address->imvalue_mask |= I18N_IMSERVER_WIN;
- }
- else if (strcmp (p->name, IMInputStyles) == 0)
-@@ -252,19 +252,21 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- /*endif*/
- address->input_styles.count_styles =
- ((XIMStyles*)p->value)->count_styles;
-- address->input_styles.supported_styles =
-- (XIMStyle *) malloc (sizeof (XIMStyle)*address->input_styles.count_styles);
-- if (address->input_styles.supported_styles == (XIMStyle *) NULL)
-+ assert (!address->input_styles.supported_styles);
-+ address->input_styles.supported_styles = (XIMStyle *)malloc (
-+ sizeof (XIMStyle) * address->input_styles.count_styles);
-+ if (address->input_styles.supported_styles == (XIMStyle *)NULL)
- return IMInputStyles;
- /*endif*/
- memmove (address->input_styles.supported_styles,
-- ((XIMStyles *) p->value)->supported_styles,
-- sizeof (XIMStyle)*address->input_styles.count_styles);
-+ ((XIMStyles *)p->value)->supported_styles,
-+ sizeof (XIMStyle) *
-+ address->input_styles.count_styles);
- address->imvalue_mask |= I18N_INPUT_STYLES;
- }
- else if (strcmp (p->name, IMProtocolHandler) == 0)
- {
-- address->improto = (IMProtoHandler) p->value;
-+ address->improto = (IMProtoHandler)p->value;
- address->imvalue_mask |= I18N_IM_HANDLER;
- }
- else if (strcmp (p->name, IMOnKeysList) == 0)
-@@ -273,15 +275,16 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- return IMOnKeysList;
- /*endif*/
- address->on_keys.count_keys =
-- ((XIMTriggerKeys *) p->value)->count_keys;
-- address->on_keys.keylist =
-- (XIMTriggerKey *) malloc (sizeof (XIMTriggerKey)*address->on_keys.count_keys);
-- if (address->on_keys.keylist == (XIMTriggerKey *) NULL)
-+ ((XIMTriggerKeys *)p->value)->count_keys;
-+ assert (!address->on_keys.keylist);
-+ address->on_keys.keylist = (XIMTriggerKey *)malloc (
-+ sizeof (XIMTriggerKey) * address->on_keys.count_keys);
-+ if (address->on_keys.keylist == (XIMTriggerKey *)NULL)
- return IMOnKeysList;
- /*endif*/
- memmove (address->on_keys.keylist,
-- ((XIMTriggerKeys *) p->value)->keylist,
-- sizeof (XIMTriggerKey)*address->on_keys.count_keys);
-+ ((XIMTriggerKeys *)p->value)->keylist,
-+ sizeof (XIMTriggerKey) * address->on_keys.count_keys);
- address->imvalue_mask |= I18N_ON_KEYS;
- }
- else if (strcmp (p->name, IMOffKeysList) == 0)
-@@ -290,15 +293,16 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- return IMOffKeysList;
- /*endif*/
- address->off_keys.count_keys =
-- ((XIMTriggerKeys *) p->value)->count_keys;
-- address->off_keys.keylist =
-- (XIMTriggerKey *) malloc (sizeof (XIMTriggerKey)*address->off_keys.count_keys);
-- if (address->off_keys.keylist == (XIMTriggerKey *) NULL)
-+ ((XIMTriggerKeys *)p->value)->count_keys;
-+ assert (!address->off_keys.keylist);
-+ address->off_keys.keylist = (XIMTriggerKey *)malloc (
-+ sizeof (XIMTriggerKey) * address->off_keys.count_keys);
-+ if (address->off_keys.keylist == (XIMTriggerKey *)NULL)
- return IMOffKeysList;
- /*endif*/
- memmove (address->off_keys.keylist,
-- ((XIMTriggerKeys *) p->value)->keylist,
-- sizeof (XIMTriggerKey)*address->off_keys.count_keys);
-+ ((XIMTriggerKeys *)p->value)->keylist,
-+ sizeof (XIMTriggerKey) * address->off_keys.count_keys);
- address->imvalue_mask |= I18N_OFF_KEYS;
- }
- else if (strcmp (p->name, IMEncodingList) == 0)
-@@ -308,17 +312,19 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- /*endif*/
- address->encoding_list.count_encodings =
- ((XIMEncodings *) p->value)->count_encodings;
-+ assert (!address->encoding_list.supported_encodings);
- address->encoding_list.supported_encodings =
-- (XIMEncoding *) malloc (sizeof (XIMEncoding)*address->encoding_list.count_encodings);
-+ (XIMEncoding *)malloc (sizeof (XIMEncoding) *
-+ address->encoding_list.count_encodings);
- if (address->encoding_list.supported_encodings
-- == (XIMEncoding *) NULL)
-- {
-+ == (XIMEncoding *)NULL) {
- return IMEncodingList;
- }
- /*endif*/
- memmove (address->encoding_list.supported_encodings,
-- ((XIMEncodings *) p->value)->supported_encodings,
-- sizeof (XIMEncoding)*address->encoding_list.count_encodings);
-+ ((XIMEncodings *)p->value)->supported_encodings,
-+ sizeof (XIMEncoding) *
-+ address->encoding_list.count_encodings);
- address->imvalue_mask |= I18N_ENCODINGS;
- }
- else if (strcmp (p->name, IMFilterEventMask) == 0)
-@@ -354,30 +360,38 @@ static char *ParseArgs (Xi18n i18n_core, int mode, XIMArg *args)
- {
- for (p = args; p->name != NULL; p++)
- {
-+ register char *_p = NULL;
- if (strcmp (p->name, IMLocale) == 0)
- {
-- p->value = (char *) malloc (strlen (address->im_locale) + 1);
-- if (!p->value)
-+ _p = (char *)malloc (strlen (address->im_locale) + 1);
-+ /* Workaround to avoid the warning of the leak of '*p.value'
-+ * CWE-401 and -Wanalyzer-malloc-leak. Seems GCC does not
-+ * understand the `if (!p->value)` sentence.
-+ */
-+ if (!_p)
- return IMLocale;
- /*endif*/
-+ p->value = _p;
- strcpy (p->value, address->im_locale);
- }
- else if (strcmp (p->name, IMServerTransport) == 0)
- {
-- p->value = (char *) malloc (strlen (address->im_addr) + 1);
-- if (!p->value)
-+ _p = (char *)malloc (strlen (address->im_addr) + 1);
-+ if (!_p)
- return IMServerTransport;
- /*endif*/
-+ p->value = _p;
- strcpy (p->value, address->im_addr);
- }
- else if (strcmp (p->name, IMServerName) == 0)
- {
- if (address->imvalue_mask & I18N_IM_NAME)
- {
-- p->value = (char *) malloc (strlen (address->im_name) + 1);
-- if (!p->value)
-+ _p = (char *)malloc (strlen (address->im_name) + 1);
-+ if (!_p)
- return IMServerName;
- /*endif*/
-+ p->value = _p;
- strcpy (p->value, address->im_name);
- }
- else
---
-2.51.1
-
-From 59bdaf6169f34a3353d6bf597fef0e84e2ca73c8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 14 Oct 2025 09:00:24 +0900
-Subject: [PATCH 4/4] Fix memory leaks #2
-
-- Fix leaks of GOptionContext in bus/main.c
-- Fix leaks of IBusEngineDesc when IME is switched in
- client/wayland/ibuswaylandim.c
-- Fix leaks of IBusTextClass:copy(), which is used in
- Emojier:get_one_dimension_lookup_table(), in src/ibustext.c
-- Fix leak of IBusExtensionEvent with commit-text signal and clicking close
- button since it's not floating in ui/gtk3/panelbinding.vala
-
-Fixes: https://github.com/ibus/ibus/commit/a800957
-BUG=https://github.com/ibus/ibus/pull/2805
----
- bus/main.c | 35 +++++++++++++++++++++-------------
- client/wayland/ibuswaylandim.c | 1 +
- src/ibustext.c | 11 ++++++++---
- ui/gtk3/panelbinding.vala | 6 ++++++
- 4 files changed, 37 insertions(+), 16 deletions(-)
-
-diff --git a/bus/main.c b/bus/main.c
-index e0db15b3..ff9941ec 100644
---- a/bus/main.c
-+++ b/bus/main.c
-@@ -182,6 +182,14 @@ _on_sigusr1 (void)
- }
- #endif
-
-+static inline void
-+exit_and_free_context (int status,
-+ GOptionContext *context)
-+{
-+ g_option_context_free (context);
-+ exit (status);
-+}
-+
- gint
- main (gint argc, gchar **argv)
- {
-@@ -203,11 +211,11 @@ main (gint argc, gchar **argv)
- if (!g_option_context_parse (context, &argc, &argv, &error)) {
- g_printerr ("Option parsing failed: %s\n", error->message);
- g_error_free (error);
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- if (g_gdbus_timeout < -1) {
- g_printerr ("Bad timeout (must be >= -1): %d\n", g_gdbus_timeout);
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
-
- if (g_mempro) {
-@@ -220,7 +228,7 @@ main (gint argc, gchar **argv)
-
- if (pwd == NULL || g_strcmp0 (pwd->pw_name, username) != 0) {
- g_printerr ("Please run ibus-daemon with login user! Do not run ibus-daemon with sudo or su.\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- }
-
-@@ -245,7 +253,7 @@ main (gint argc, gchar **argv)
- if (daemonize) {
- if (daemon (1, 0) != 0) {
- g_printerr ("Cannot daemonize ibus.\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- }
-
-@@ -267,7 +275,7 @@ main (gint argc, gchar **argv)
- if (ibus_bus_is_connected (bus)) {
- if (!replace) {
- g_printerr ("current session already has an ibus-daemon.\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- ibus_bus_exit (bus, FALSE);
- while (ibus_bus_is_connected (bus)) {
-@@ -301,11 +309,11 @@ main (gint argc, gchar **argv)
- }
- if (component == NULL || !bus_component_start (component, g_verbose)) {
- g_printerr ("Can not execute default config program\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- } else if (g_strcmp0 (config, "disable") != 0 && g_strcmp0 (config, "") != 0) {
- if (!execute_cmdline (config))
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
-
- /* execute panel component */
-@@ -318,11 +326,11 @@ main (gint argc, gchar **argv)
- }
- if (component == NULL || !bus_component_start (component, g_verbose)) {
- g_printerr ("Can not execute default panel program\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- } else if (g_strcmp0 (panel, "disable") != 0 && g_strcmp0 (panel, "") != 0) {
- if (!execute_cmdline (panel))
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- }
-
-@@ -337,25 +345,25 @@ main (gint argc, gchar **argv)
- if (component != NULL &&
- !bus_component_start (component, g_verbose)) {
- g_printerr ("Can not execute default panel program\n");
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- } else if (g_strcmp0 (emoji_extension, "disable") != 0 &&
- g_strcmp0 (emoji_extension, "") != 0) {
- if (!execute_cmdline (emoji_extension))
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
- #endif
-
- /* execute ibus xim server */
- if (xim) {
- if (!execute_cmdline (LIBEXECDIR "/ibus-x11 --kill-daemon"))
-- exit (-1);
-+ exit_and_free_context (EXIT_FAILURE, context);
- }
-
- if (!daemonize) {
- if (getppid () == 1) {
- g_warning ("The parent process died.");
-- exit (0);
-+ exit_and_free_context (EXIT_SUCCESS, context);
- }
- #ifdef HAVE_SYS_PRCTL_H
- #ifdef G_OS_UNIX
-@@ -396,5 +404,6 @@ main (gint argc, gchar **argv)
- #endif
- }
- bus_server_run ();
-+ g_option_context_free (context);
- return 0;
- }
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index e058044f..60257779 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -924,6 +924,7 @@ _bus_global_engine_changed_cb (IBusBus *bus,
- keymap = create_user_xkb_keymap (priv->xkb_context, desc);
- if (keymap && !ibus_wayland_im_update_xkb_state (wlim, keymap))
- xkb_keymap_unref (keymap);
-+ g_object_unref (desc);
- }
-
-
-diff --git a/src/ibustext.c b/src/ibustext.c
-index 73d3d10c..0576f6c8 100644
---- a/src/ibustext.c
-+++ b/src/ibustext.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2011-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2021 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -109,7 +109,7 @@ ibus_text_deserialize (IBusText *text,
- retval = IBUS_SERIALIZABLE_CLASS (ibus_text_parent_class)->deserialize (
- (IBusSerializable *)text, variant);
-
-- if (text->is_static == FALSE)
-+ if (!text->is_static)
- g_free (text->text);
- g_variant_get_child (variant, retval++, "s", &text->text);
- text->is_static = FALSE;
-@@ -139,10 +139,15 @@ ibus_text_copy (IBusText *dest,
- g_return_val_if_fail (IBUS_IS_TEXT (dest), FALSE);
- g_return_val_if_fail (IBUS_IS_TEXT (src), FALSE);
-
-+ if (!dest->is_static)
-+ g_free (dest->text);
- dest->text = g_strdup (src->text);
- dest->is_static = FALSE;
-+ if (dest->attrs)
-+ g_clear_object (&dest->attrs);
- if (src->attrs) {
-- dest->attrs = (IBusAttrList *)ibus_serializable_copy ((IBusSerializable *)src->attrs);
-+ dest->attrs = (IBusAttrList *)ibus_serializable_copy (
-+ (IBusSerializable *)src->attrs);
- g_object_ref_sink (dest->attrs);
- }
-
-diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
-index 49c91575..507b3dac 100644
---- a/ui/gtk3/panelbinding.vala
-+++ b/ui/gtk3/panelbinding.vala
-@@ -910,6 +910,9 @@ class PanelBinding : IBus.PanelService {
- "is-enabled", false,
- "is-extension", true);
- panel_extension(close_event);
-+ // Vala calls event.ref_sink() and panel_extension() does not
-+ // unref the event and need to call event.unref() here.
-+ close_event.unref();
- });
- m_emojier.send_message.connect((m) => {
- send_message(m);
-@@ -1175,6 +1178,9 @@ class PanelBinding : IBus.PanelService {
- "is-enabled", false,
- "is-extension", true);
- panel_extension(event);
-+ // Vala calls event.ref_sink() and panel_extension() does not unref
-+ // the event and need to call event.unref() here.
-+ event.unref();
- return;
- }
- if (m_emojier == null)
---
-2.51.1
-
-From 296192bd69448e5d782a33162de25534db0a79e7 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 17 Oct 2025 13:14:32 +0900
-Subject: [PATCH 1/5] ui/gtk3: Fix mouse position in Emojier category list
-
-BUG=rhbz#2237664
----
- ui/gtk3/emojier.vala | 17 +++++++++++------
- 1 file changed, 11 insertions(+), 6 deletions(-)
-
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index ffa8cdaa..71422266 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -29,6 +29,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- valign : Gtk.Align.FILL
- );
- this.motion_notify_event.connect((e) => {
-+ if (!m_enter_notify_enable)
-+ return false;
- Gdk.EventMotion pe = e;
- if (m_mouse_x == pe.x_root && m_mouse_y == pe.y_root)
- return false;
-@@ -37,6 +39,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- var row = this.get_row_at_y((int)e.y);
- if (row != null)
- this.select_row(row);
-+ m_category_active_index = row.get_index();
- return false;
- });
- this.enter_notify_event.connect((e) => {
-@@ -279,6 +282,12 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- private const unichar[] EMOJI_VARIANT_LIST = {
- 0x1f3fb, 0x1f3fc, 0x1f3fd, 0x1f3fe, 0x1f3ff, 0x200d };
-
-+ // Access both class methods and instances.
-+ protected static int m_category_active_index = -1;
-+ protected static bool m_enter_notify_enable = true;
-+ protected static double m_mouse_x;
-+ protected static double m_mouse_y;
-+
- // Set the actual default values in the constructor
- // because these fields are used for class_init() and static functions,
- // e.g. set_emoji_font(), can be called before class_init() is called.
-@@ -348,14 +357,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- * Unicode category list.
- */
- private bool m_candidate_panel_mode;
-- private int m_category_active_index = -1;
- private IBus.LookupTable m_lookup_table;
- private Gtk.Label[] m_candidates;
-- private bool m_enter_notify_enable = true;
- private uint m_entry_notify_show_id;
- private uint m_entry_notify_disable_id;
-- protected static double m_mouse_x;
-- protected static double m_mouse_y;
- private Gtk.ProgressBar m_unicode_progress_bar;
- private uint m_unicode_progress_id;
- private Gtk.Label m_unicode_percent_label;
-@@ -988,7 +993,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- EPaddedLabelBox widget =
- new EPaddedLabelBox(_(category), Gtk.Align.CENTER);
- row.add(widget);
-- m_list_box.add(row);
-+ m_list_box.insert(row, -1);
- if (i == m_category_active_index)
- m_list_box.select_row(row);
- }
-@@ -1113,7 +1118,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- TravelDirection.NONE,
- caption);
- row.add(widget);
-- m_list_box.add(row);
-+ m_list_box.insert(row, -1);
- if (n++ == m_category_active_index) {
- m_list_box.select_row(row);
- }
---
-2.51.1
-
-From b00d9464e1a54630098fe7b5bbdf372a5f9b832b Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 17 Oct 2025 13:14:34 +0900
-Subject: [PATCH 2/5] ui/gtk3: Set MessageDialog at input cursor
-
----
- ui/gtk3/candidatepanel.vala | 4 ++++
- ui/gtk3/message.vala | 6 ++++++
- ui/gtk3/panel.vala | 4 ++++
- 3 files changed, 14 insertions(+)
-
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index 3cc2c086..74de6f74 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -161,6 +161,10 @@ public class CandidatePanel : Gtk.Box{
- }
- }
-
-+ public Gdk.Rectangle? get_cursor_rect() {
-+ return m_cursor_location;
-+ }
-+
- public void set_cursor_location(int x, int y, int width, int height) {
- Gdk.Rectangle location = Gdk.Rectangle(){
- x = x, y = y, width = width, height = height };
-diff --git a/ui/gtk3/message.vala b/ui/gtk3/message.vala
-index 0c7dd478..b6366557 100644
---- a/ui/gtk3/message.vala
-+++ b/ui/gtk3/message.vala
-@@ -91,6 +91,12 @@ public class MessageDialog : Gtk.Box{
- create_ui(message);
- }
-
-+ public void set_cursor_rect(Gdk.Rectangle location) {
-+ if (m_cursor_location == location)
-+ return;
-+ m_cursor_location = location;
-+ }
-+
- public void set_cursor_location(int x, int y, int width, int height) {
- Gdk.Rectangle location = Gdk.Rectangle(){
- x = x, y = y, width = width, height = height };
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index fcb30220..90194529 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -930,6 +930,10 @@ class Panel : IBus.PanelService {
- (w, s) => this.realize_surface(s));
- #endif
- m_popup_dialogs.insert(serial, popup);
-+ if (m_candidate_panel_active != null) {
-+ popup.set_cursor_rect(
-+ m_candidate_panel_active.get_cursor_rect());
-+ }
- popup.show();
- }
- }
---
-2.51.1
-
-From 0314cf5bf5bb3a46ff96cfb4f93ac937c129b7fb Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 17 Oct 2025 23:38:00 +0900
-Subject: [PATCH 3/5] client/wayland: Free IBusInputContext in input_method_activate()
-
-Call input_method_deactivate() when input_method_activate() is
-called twice and zwp_input_method_context_v1 is null but
-IBusInputContext is not null.
-This enhances not to cause a SEGV in _context_hide_preedit_text_cb()
-
-BUG=rhbz#2326455
----
- client/wayland/ibuswaylandim.c | 10 +++-------
- 1 file changed, 3 insertions(+), 7 deletions(-)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index e058044f..631bea93 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -1796,7 +1796,7 @@ input_method_activate (void *data,
-
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
-- if (priv->context)
-+ if (priv->context || priv->ibuscontext)
- input_method_deactivate (data, input_method, context);
-
- priv->context = context;
-@@ -1828,10 +1828,7 @@ input_method_activate (void *data,
- g_assert_not_reached ();
- }
-
-- if (priv->ibuscontext) {
-- g_object_unref (priv->ibuscontext);
-- priv->ibuscontext = NULL;
-- }
-+ g_assert (!priv->ibuscontext);
-
- priv->cancellable = g_cancellable_new ();
- ibus_bus_create_input_context_async (priv->ibusbus,
-@@ -1884,8 +1881,7 @@ input_method_deactivate (void *data,
- priv->ibuscontext,
- G_CALLBACK (_context_hide_preedit_text_cb),
- wlim);
-- g_object_unref (priv->ibuscontext);
-- priv->ibuscontext = NULL;
-+ g_clear_object (&priv->ibuscontext);
- g_signal_emit (wlim,
- wayland_im_signals[IBUS_FOCUS_OUT],
- 0,
---
-2.51.1
-
-From f6c52ce0baf0ad11705a0f9af160076a97104bf2 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 26 Nov 2025 15:16:03 +0900
-Subject: [PATCH 4/5] util/IMdkit: Fix SEGV with allocation fail in _Xi18nChangeIC()
-
-When malloc() is failed, it should break the for loop to set
-attrib_num value correctly to free attrib_list array.
-
-BUG=rhbz#2346033
----
- util/IMdkit/i18nIc.c | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/util/IMdkit/i18nIc.c b/util/IMdkit/i18nIc.c
-index 14a3dc51..e82ffbcf 100644
---- a/util/IMdkit/i18nIc.c
-+++ b/util/IMdkit/i18nIc.c
-@@ -2,6 +2,8 @@
-
- Copyright 1994, 1995 by Sun Microsystems, Inc.
- Copyright 1993, 1994 by Hewlett-Packard Company
-+ Copyright (C) 2008-2025 Red Hat, Inc.
-+ Copyright (C) 2017-2025 Takao Fujiwara
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
-@@ -714,10 +716,11 @@ void _Xi18nChangeIC (XIMS ims,
- FrameMgrSetSize (fm, value_length);
- attrib_list[attrib_num].value_length = value_length;
- FrameMgrGetToken (fm, value);
-- attrib_list[attrib_num].value = (void *) malloc (value_length + 1);
-+ attrib_list[attrib_num].value = (void *)malloc (value_length + 1);
- if (!attrib_list[attrib_num].value) {
- fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
- __FILE__, __LINE__);
-+ break;
- } else {
- memmove (attrib_list[attrib_num].value, value, value_length);
- ((char *)attrib_list[attrib_num].value)[value_length] = '\0';
---
-2.51.1
-
-From ca0193f5b1c17f5c8a456e09421d2a8688c5d667 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 23 Oct 2025 22:45:11 +0900
-Subject: [PATCH 5/5] ui/gtk3: Refer QT_IM_MODULES to check Wayland configuration
-
-QT_IM_MODULES and QT_IM_MODULE is available. The warning message
-is not changed at the moment.
-ibus-setup also runs `ibus start` instead ibus-daemon.
-
-BUG=rhbz#2392358
----
- setup/main.py | 19 ++++++++++++++-----
- ui/gtk3/panel.vala | 6 +++++-
- 2 files changed, 19 insertions(+), 6 deletions(-)
-
-diff --git a/setup/main.py b/setup/main.py
-index d0e05666..31b44037 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -4,8 +4,8 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2010-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
--# Copyright (c) 2007-2020 Red Hat, Inc.
-+# Copyright (c) 2010-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2007-2025 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
-@@ -602,13 +602,22 @@ class Setup(object):
- GLib.timeout_add_seconds(timeout, lambda *args: main_loop.quit())
- self.__bus.connect("connected", lambda *args: main_loop.quit())
-
-- os.spawnlp(os.P_NOWAIT, "ibus-daemon", "ibus-daemon", "--xim", "--daemonize")
-+ os.spawnlp(os.P_NOWAIT, "ibus", "ibus", "start", "--xim", "--daemonize")
-
- main_loop.run()
-
- if self.__bus.is_connected():
-- message = _("IBus has been started! "
-- "If you cannot use IBus, add the following lines to your $HOME/.bashrc; then relog into your desktop.\n"
-+ message = _("IBus has been started. "
-+ "If you cannot use IBus, add the following lines to your "
-+ "$HOME/.bashrc; then relog into your desktop.\n"
-+ "\n"
-+ " # For Wayland sessions ($XDG_SESSION_TYPE is \"wayland\")\n"
-+ " export GTK_IM_MODULE=wayland\n"
-+ " export XMODIFIERS=@im=ibus\n"
-+ " export QT_IM_MODULES=wayland;ibus\n"
-+ " export QT_IM_MODULE=ibus\n"
-+ "\n"
-+ " # For X11 sessions ($XDG_SESSION_TYPE is \"x11\")\n"
- " export GTK_IM_MODULE=ibus\n"
- " export XMODIFIERS=@im=ibus\n"
- " export QT_IM_MODULE=ibus"
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 90194529..cfa6e50d 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -1027,7 +1027,11 @@ class Panel : IBus.PanelService {
- "Wayland",
- "ibus start");
- } else if (m_is_wayland && m_is_wayland_im && !is_gnome()) {
-- if (Environment.get_variable("QT_IM_MODULE") == "ibus") {
-+ var qt_im_module = Environment.get_variable("QT_IM_MODULE");
-+ var qt_im_modules = Environment.get_variable("QT_IM_MODULES");
-+ if ((qt_im_module != null && qt_im_module != "wayland") &&
-+ (qt_im_modules == null ||
-+ !qt_im_modules.has_prefix("wayland"))) {
- var format =
- _("Please unset QT_IM_MODULE and GTK_IM_MODULE " +
- "environment variables and 'ibus-daemon --panel " +
---
-2.51.1
-
-From 69eb4c6de1dc7f6137780139510b5a1598dc7183 Mon Sep 17 00:00:00 2001
-From: Joan Torres Lopez <joantolo@redhat.com>
-Date: Wed, 26 Nov 2025 16:02:18 +0900
-Subject: [PATCH] src: Move group name detection to ibus_get_group_name()
-
-Resolves: https://github.com/ibus/ibus/commit/c158800
-BUG=https://github.com/ibus/ibus/pull/2806
----
- bus/main.c | 47 ++++++++++++++++-------------------------------
- src/ibusshare.c | 34 +++++++++++++++++++++++++++++++++-
- src/ibusshare.h | 18 +++++++++++++++---
- 3 files changed, 64 insertions(+), 35 deletions(-)
-
-diff --git a/bus/main.c b/bus/main.c
-index e0db15b3..8695b065 100644
---- a/bus/main.c
-+++ b/bus/main.c
-@@ -39,7 +39,6 @@
-
- #ifdef G_OS_UNIX
- #include <glib-unix.h>
--#include <grp.h>
- #endif
-
- #include "global.h"
-@@ -195,11 +194,7 @@ main (gint argc, gchar **argv)
- {
- int i;
- const gchar *username = ibus_get_user_name ();
-- const gchar *groupname = NULL;
--#ifdef HAVE_GETGRGID_R
-- char buffer[4096];
-- struct group gbuf;
--#endif
-+ const gchar *groupname = ibus_get_group_name ();
-
- setlocale (LC_ALL, "");
-
-@@ -227,28 +222,12 @@ main (gint argc, gchar **argv)
- struct passwd *pwd = getpwuid (getuid ());
-
- if (pwd == NULL || g_strcmp0 (pwd->pw_name, username) != 0) {
-- g_printerr ("Please run ibus-daemon with login user! Do not run ibus-daemon with sudo or su.\n");
-+ g_printerr ("Please run ibus-daemon with login user! Do not run "
-+ "ibus-daemon with sudo or su.\n");
- exit_and_free_context (EXIT_FAILURE, context);
- }
- }
-
-- /* get group name */
-- {
-- struct group *grp = NULL;
--#ifdef HAVE_GETGRGID_R
-- /* MT-Safe locale */
-- getgrgid_r (getgid (), &gbuf, buffer, sizeof(buffer), &grp);
--#else
-- /* MT-Unsafe race:grgid locale */
-- grp = getgrgid (getgid ());
--#endif
--
-- if (grp && grp->gr_name && grp->gr_name[0])
-- groupname = grp->gr_name;
-- else
-- g_warning ("Couldn't get group name");
-- }
--
- /* daemonize process */
- if (daemonize) {
- if (daemon (1, 0) != 0) {
-@@ -257,7 +236,9 @@ main (gint argc, gchar **argv)
- }
- }
-
-- /* create a new process group. this is important to kill all of its children by SIGTERM at a time in bus_ibus_impl_destroy. */
-+ /* create a new process group. this is important to kill all of its
-+ * children by SIGTERM at a time in bus_ibus_impl_destroy.
-+ */
- setpgid (0, 0);
-
- ibus_init ();
-@@ -286,13 +267,13 @@ main (gint argc, gchar **argv)
- }
-
- bus_server_init ();
-- for (i = 0; i < G_N_ELEMENTS(panel_extension_disable_users); i++) {
-+ for (i = 0; i < G_N_ELEMENTS (panel_extension_disable_users); i++) {
- if (!g_strcmp0 (username, panel_extension_disable_users[i]) != 0) {
- emoji_extension = "disable";
- break;
- }
- }
-- for (i = 0; i < G_N_ELEMENTS(panel_extension_disable_groups); i++) {
-+ for (i = 0; i < G_N_ELEMENTS (panel_extension_disable_groups); i++) {
- if (g_strcmp0 (groupname, panel_extension_disable_groups[i]) == 0) {
- emoji_extension = "disable";
- break;
-@@ -307,11 +288,13 @@ main (gint argc, gchar **argv)
- if (component) {
- bus_component_set_restart (component, restart);
- }
-- if (component == NULL || !bus_component_start (component, g_verbose)) {
-+ if (component == NULL ||
-+ !bus_component_start (component, g_verbose)) {
- g_printerr ("Can not execute default config program\n");
- exit_and_free_context (EXIT_FAILURE, context);
- }
-- } else if (g_strcmp0 (config, "disable") != 0 && g_strcmp0 (config, "") != 0) {
-+ } else if (g_strcmp0 (config, "disable") != 0 &&
-+ g_strcmp0 (config, "") != 0) {
- if (!execute_cmdline (config))
- exit_and_free_context (EXIT_FAILURE, context);
- }
-@@ -324,11 +307,13 @@ main (gint argc, gchar **argv)
- if (component) {
- bus_component_set_restart (component, restart);
- }
-- if (component == NULL || !bus_component_start (component, g_verbose)) {
-+ if (component == NULL ||
-+ !bus_component_start (component, g_verbose)) {
- g_printerr ("Can not execute default panel program\n");
- exit_and_free_context (EXIT_FAILURE, context);
- }
-- } else if (g_strcmp0 (panel, "disable") != 0 && g_strcmp0 (panel, "") != 0) {
-+ } else if (g_strcmp0 (panel, "disable") != 0 &&
-+ g_strcmp0 (panel, "") != 0) {
- if (!execute_cmdline (panel))
- exit_and_free_context (EXIT_FAILURE, context);
- }
-diff --git a/src/ibusshare.c b/src/ibusshare.c
-index 57e3ef14..9d66a60c 100644
---- a/src/ibusshare.c
-+++ b/src/ibusshare.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 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) 2008-2018 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -37,6 +37,10 @@
- #include <string.h>
- #include <ibus.h>
-
-+#ifdef G_OS_UNIX
-+#include <grp.h>
-+#endif
-+
- static gchar *_display = NULL;
-
- const gchar *
-@@ -82,6 +86,34 @@ ibus_get_user_name (void)
- return g_get_user_name ();
- }
-
-+const gchar *
-+ibus_get_group_name (void)
-+{
-+ static gchar *groupname = NULL;
-+ struct group *grp = NULL;
-+#ifdef HAVE_GETGRGID_R
-+ char buffer[4096];
-+ struct group gbuf;
-+#endif
-+
-+ if (groupname)
-+ return groupname;
-+
-+#ifdef HAVE_GETGRGID_R
-+ /* MT-Safe locale */
-+ getgrgid_r (getgid (), &gbuf, buffer, sizeof(buffer), &grp);
-+#else
-+ /* MT-Unsafe race:grgid locale */
-+ grp = getgrgid (getgid ());
-+#endif
-+
-+ g_return_val_if_fail (grp && grp->gr_name && grp->gr_name[0], NULL);
-+
-+ /* buffer will be erased out of this function. */
-+ groupname = g_strdup (grp->gr_name);
-+ return groupname;
-+}
-+
- glong
- ibus_get_daemon_uid (void)
- {
-diff --git a/src/ibusshare.h b/src/ibusshare.h
-index 6379c51d..7e9274e4 100644
---- a/src/ibusshare.h
-+++ b/src/ibusshare.h
-@@ -205,7 +205,7 @@ G_BEGIN_DECLS
- *
- * Obtains the machine UUID of the machine this process is running on.
- *
-- * Returns: A newly allocated string that shows the UUID of the machine.
-+ * Returns: A const string that shows the UUID of the machine.
- */
- const gchar *ibus_get_local_machine_id
- (void);
-@@ -259,10 +259,22 @@ void ibus_write_address (const gchar *address);
- * <listitem><para>Environment variable LNAME</para></listitem>
- * </orderedlist>
- *
-- * Returns: A newly allocated string that stores current user name.
-+ * Returns: A const string that stores current user name.
- */
- const gchar *ibus_get_user_name (void);
-
-+/**
-+ * ibus_get_group_name:
-+ *
-+ * Get the current user group name.
-+ *
-+ * Returns: A const string that stores current user group name.
-+ *
-+ * Since: 1.5.34
-+ * Stability: Unstable
-+ */
-+const gchar *ibus_get_group_name (void);
-+
- /**
- * ibus_get_daemon_uid:
- *
-@@ -280,7 +292,7 @@ glong ibus_get_daemon_uid (void) G_GNUC_DEPRECATED;
- *
- * Get the path of socket file.
- *
-- * Returns: A newly allocated string that stores the path of socket file.
-+ * Returns: A const string that stores the path of socket file.
- */
- const gchar *ibus_get_socket_path (void);
-
---
-2.51.1
-
-From 2f7a74ebef5aac2ed529304beacff25591d29044 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 4 Dec 2025 19:41:59 +0900
-Subject: [PATCH] src/tests/ibus-keypress: Fix GTK3 build
-
-BUG=https://github.com/ibus/ibus/issues/2829
----
- src/tests/ibus-keypress.c | 16 ++++++++++++----
- 1 file changed, 12 insertions(+), 4 deletions(-)
-
-diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c
-index cd8afe83..17029512 100644
---- a/src/tests/ibus-keypress.c
-+++ b/src/tests/ibus-keypress.c
-@@ -431,8 +431,11 @@ destroy_window (gpointer user_data)
- data->source = 0;
-
- g_info ("Destroying window after timeout");
-+#if GTK_CHECK_VERSION (4, 0, 0)
- gtk_window_destroy (GTK_WINDOW (data->window));
--
-+#else
-+ gtk_widget_destroy (data->window);
-+#endif
- data->window = NULL;
-
- return G_SOURCE_REMOVE;
-@@ -470,8 +473,9 @@ create_keypress (void)
- #endif
-
- if (!m_replay) {
-- g_test_fail_printf ("Failed to create uinput device: %s",
-- error->message);
-+ g_test_fail_printf ("Failed to create uinput device: %s: %s",
-+ error->message,
-+ "Probably you should run `chmod a+rw /dev/uinput`");
- g_error_free (error);
- return FALSE;
- }
-@@ -741,7 +745,7 @@ test_keypress (gconstpointer user_data)
- #if GTK_CHECK_VERSION (4, 0, 0)
- gtk_init ();
- #else
-- gtk_init (data->argc, data->argv);
-+ gtk_init (&data->argc, &data->argv);
- #endif
-
- g_assert ((channel = g_io_channel_unix_new (m_pipe_engine[0])));
-@@ -770,7 +774,11 @@ test_keypress (gconstpointer user_data)
- if (destroy_data.source)
- g_source_remove (destroy_data.source);
- if (destroy_data.window)
-+#if GTK_CHECK_VERSION (4, 0, 0)
- gtk_window_destroy (GTK_WINDOW (destroy_data.window));
-+#else
-+ gtk_widget_destroy (destroy_data.window);
-+#endif
- close (m_pipe_engine[0]);
- close (m_pipe_engine[1]);
- }
---
-2.52.0
-
-From 7f5b5c59c9631292d41bb272b7716f5cdb356db5 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 10 Dec 2025 10:18:49 +0900
-Subject: [PATCH] ui/gtk3/propertypanel: Disable X11 display in Wayland
-
-Add a workaround until IBus panel is migrated to GTK4.
-GTK3 causes a SEGV when the session is switched to the console
-in Wayland with Ctrl-Alt-F3 because it calls
-gdk_display_get_default() by
-gdk_x11_get_xatom_by_name("Wacom Serial IDs") and the display
-is not X11.
-
-BUG=rhbz#2418670
----
- ui/gtk3/propertypanel.vala | 13 ++++++++++++-
- 1 file changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/ui/gtk3/propertypanel.vala b/ui/gtk3/propertypanel.vala
-index f1ecd7f7..1ba1681f 100644
---- a/ui/gtk3/propertypanel.vala
-+++ b/ui/gtk3/propertypanel.vala
-@@ -54,7 +54,18 @@ public class PropertyPanel : Gtk.Box {
- set_visible(true);
-
- #if ENABLE_XIM
-- var display = BindingCommon.get_xdisplay();
-+ Gdk.X11.Display? display = null;
-+ // Disable X11 display in Wayland as a workaround.
-+ // GTK3 causes a SEGV when the session is switched to the console
-+ // in Wayland with Ctrl-Alt-F3 because it calls
-+ // gdk_display_get_default() by
-+ // gdk_x11_get_xatom_by_name("Wacom Serial IDs") and the display
-+ // is not X11.
-+ // Need to backport the fix to GTK3:
-+ // https://gitlab.gnome.org/GNOME/gtk/-/commit/920259c2
-+ // or need to migrate IBus panel to GTK4.
-+ if (BindingCommon.default_is_xdisplay())
-+ display = BindingCommon.get_xdisplay();
- if (display != null) {
- m_xdisplay = display.get_xdisplay();
- var screen = display.get_default_screen();
---
-2.52.0
-
-From b67624c79ad6c26a50194b626b329894b32367f9 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 19 Dec 2025 20:56:27 +0900
-Subject: [PATCH] configure: Add warning to run `make -C tools maintainer-clean-generic`
-
-When users specify --disable-wayland option for configure,
-the behavior effects VALA files in tools 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 tools maintainer-clean-generic` of the users.
-
-Fixes: https://github.com/ibus/ibus/commit/2bc23ed
-BUG=https://github.com/ibus/ibus/issues/2836
----
- configure.ac | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/configure.ac b/configure.ac
-index 401fcd27..401e5f27 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -931,6 +931,17 @@ AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
-
- OUTPUT_TAIL=''
- HAS_OUTPUT_TAIL=0
-+AS_IF([test x"$enable_wayland" = x"no"],
-+ [OUTPUT_TAIL="$OUTPUT_TAIL
-+You invoked the \`configure\` script with disabled wayland option
-+so you have to run
-+\`make -C tools maintainer-clean-generic\` to regenerate C files with VALA
-+before run \`make\`.
-+"
-+ HAS_OUTPUT_TAIL=1
-+ ],
-+ []
-+)
- AS_IF([test x"$enable_ui" != x"no" &&
- test -f "$ac_confdir/ui/gtk3/application.c"
- ],
---
-2.52.0
-
-From 9c5ae2194e5db84c74cfc894a046f26c318dab4d Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 4 Dec 2025 09:03:37 +0900
-Subject: [PATCH] src/ibuscomposetable: Order locale compose and user compose
-
-Also make CI of US compose with locale compose
-
-BUG=https://github.com/ibus/ibus/pull/2832
----
- src/ibuscomposetable.c | 30 +++++-
- src/tests/Makefile.am | 6 ++
- src/tests/ibus-compose.basic2 | 5 +
- src/tests/ibus-compose.c | 176 +++++++++++++++++++++-------------
- src/tests/ibus-compose.env | 7 +-
- src/tests/ibus-compose.usmin | 8 ++
- src/tests/ibus-compose.usmin2 | 6 ++
- 7 files changed, 167 insertions(+), 71 deletions(-)
- create mode 100644 src/tests/ibus-compose.basic2
- create mode 100644 src/tests/ibus-compose.usmin
- create mode 100644 src/tests/ibus-compose.usmin2
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 3c5bc51f..116d0131 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1741,6 +1741,27 @@ out:
- }
-
-
-+gint
-+find_system_comopse_table (gconstpointer a,
-+ gconstpointer b)
-+{
-+ IBusComposeTableEx *table_a = (IBusComposeTableEx *)a;
-+ IBusComposeTableEx *table_b = (IBusComposeTableEx *)b;
-+
-+ if (a == b)
-+ return 0;
-+ else if (!a)
-+ return -1;
-+ g_assert (b);
-+ if (table_a->is_system == table_b->is_system)
-+ return 0;
-+ if (table_a->is_system)
-+ return 1;
-+ else
-+ return -1;
-+}
-+
-+
- /* if ibus_compose_seqs[N - 1] is an outputed compose character,
- * ibus_compose_seqs[N * 2 - 1] is also an outputed compose character.
- * and ibus_compose_seqs[0] to ibus_compose_seqs[0 + N - 3] are the
-@@ -1784,7 +1805,8 @@ ibus_compose_table_list_add_array (GSList *compose_tables,
- compose_table->n_seqs = n_seqs;
- compose_table->id = hash;
-
-- return g_slist_prepend (compose_tables, compose_table);
-+ return g_slist_insert_sorted (compose_tables, compose_table,
-+ find_system_comopse_table);
- }
-
-
-@@ -1812,7 +1834,8 @@ ibus_compose_table_list_add_file (GSList *compose_tables,
- &saved_version);
- if (compose_table != NULL) {
- compose_table->is_system = _datafile_is_system (compose_file);
-- return g_slist_prepend (compose_tables, compose_table);
-+ return g_slist_insert_sorted (compose_tables, compose_table,
-+ find_system_comopse_table);
- }
-
- parse:
-@@ -1867,7 +1890,8 @@ parse:
- }
-
- ibus_compose_table_save_cache (compose_table);
-- return g_slist_prepend (compose_tables, compose_table);
-+ return g_slist_insert_sorted (compose_tables, compose_table,
-+ find_system_comopse_table);
- }
-
-
-diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
-index 19c1f14c..1a63917f 100644
---- a/src/tests/Makefile.am
-+++ b/src/tests/Makefile.am
-@@ -107,8 +107,11 @@ test_metas = $(addsuffix .test, $(_test_execs))
- test_sources_DATA = \
- $(test_metas) \
- ibus-compose.basic \
-+ ibus-compose.basic2 \
- ibus-compose.emoji \
- ibus-compose.env \
-+ ibus-compose.usmin \
-+ ibus-compose.usmin2 \
- libinput-test.yml \
- $(NULL)
- test_sourcesdir = $(datadir)/installed-tests/ibus
-@@ -193,8 +196,11 @@ EXTRA_DIST = \
- $(TESTS_SCRIPT) \
- runtest \
- ibus-compose.basic \
-+ ibus-compose.basic2 \
- ibus-compose.emoji \
- ibus-compose.env \
-+ ibus-compose.usmin \
-+ ibus-compose.usmin2 \
- ibus-compose-locales.in \
- ibus-desktop-testing.desktop.in \
- ibus-desktop-testing-autostart.in \
-diff --git a/src/tests/ibus-compose.basic2 b/src/tests/ibus-compose.basic2
-new file mode 100644
-index 00000000..27db9889
---- /dev/null
-+++ b/src/tests/ibus-compose.basic2
-@@ -0,0 +1,5 @@
-+include "%L"
-+# Symbol tests of Multi_key, quotedbl Cyrillic_zhe
-+# This case swaps U04DC and U04DD in en-US
-+<Multi_key> <quotedbl> <Cyrillic_zhe> : "Ӝ" U04DC
-+<Multi_key> <quotedbl> <Cyrillic_ZHE> : "ӝ" U04DD
-diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c
-index ed0876df..69f844b2 100644
---- a/src/tests/ibus-compose.c
-+++ b/src/tests/ibus-compose.c
-@@ -7,12 +7,15 @@
- #define RED "\033[0;31m"
- #define NC "\033[0m"
-
-+static gchar *m_test_locale;
- static gchar *m_test_name;
- static gchar *m_session_name;
- static IBusBus *m_bus;
- static IBusComponent *m_component;
- static gchar *m_compose_file;
-+static gchar *m_no_load_compose_file;
- static IBusComposeTableEx *m_compose_table;
-+static IBusComposeTableEx *m_no_load_compose_table;
- static IBusEngine *m_engine;
- static gchar *m_srcdir;
- static gboolean m_is_gtk_32bit_compose_error;
-@@ -83,7 +86,7 @@ get_compose_path ()
- gchar *compose_path = NULL;
-
- if (m_is_gtk_32bit_compose_error)
-- g_assert (g_setenv ("LANG", m_test_name, TRUE));
-+ g_assert (g_setenv ("LANG", m_test_locale, TRUE));
- #if GLIB_CHECK_VERSION (2, 58, 0)
- langs = g_get_language_names_with_category ("LC_CTYPE");
- #else
-@@ -250,7 +253,17 @@ create_engine_cb (IBusFactory *factory,
- if (m_compose_table)
- g_assert (saved_version);
- }
-- g_free (compose_path);
-+ g_clear_pointer (&compose_path, g_free);
-+ if (m_no_load_compose_file) {
-+ compose_path = g_build_filename (m_srcdir,
-+ m_no_load_compose_file,
-+ NULL);
-+ }
-+ if (compose_path) {
-+ m_no_load_compose_table =
-+ ibus_compose_table_new_with_file (compose_path, NULL);
-+ }
-+ g_clear_pointer (&compose_path, g_free);
- return m_engine;
- }
-
-@@ -313,57 +326,20 @@ window_destroy_cb (void)
-
-
- static void
--set_engine_cb (GObject *object,
-- GAsyncResult *res,
-- gpointer user_data)
-+send_key_event (IBusComposeTableEx *compose_table)
- {
-- IBusBus *bus = IBUS_BUS (object);
--#if GTK_CHECK_VERSION (4, 0, 0)
-- GtkEventController *controller = GTK_EVENT_CONTROLLER (user_data);
--#else
-- GtkWidget *entry = GTK_WIDGET (user_data);
--#endif
-- GError *error = NULL;
- static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 };
- int i, j;
- int index_stride;
- IBusComposeTablePrivate *priv;
-
-- if (!ibus_bus_set_global_engine_async_finish (bus, res, &error)) {
-- g_test_fail_printf ("set engine failed: %s", error->message);
-- g_error_free (error);
-- return;
-- }
--
-- /* ibus_im_context_focus_in() is called after GlboalEngine is set.
-- * The focus-in/out events happen more slowly in a busy system
-- * likes with a TMT tool.
-- */
-- if (is_integrated_desktop () && g_getenv ("IBUS_DAEMON_WITH_SYSTEMD")) {
-- g_test_message ("Start tiny \"focus-in\" signal test");
-- for (i = 0; i < 3; i++) {
-- data.category = TEST_DELAYED_FOCUS_IN;
-- data.idle_id = g_timeout_add_seconds (1, idle_cb, &data);
-- g_main_loop_run (m_loop);
-- if (data.idle_id != 0)
-- return;
-- }
-- g_test_message ("End tiny \"focus-in\" signal test");
-- data.category = TEST_COMMIT_TEXT;
-- }
-- if (m_compose_table == NULL) {
-- g_test_skip ("Your locale uses en_US compose table.");
-- idle_cb (&data);
-- return;
-- }
--
-- index_stride = m_compose_table->max_seq_len + 2;
-+ index_stride = compose_table->max_seq_len + 2;
- for (i = 0;
-- i < (m_compose_table->n_seqs * index_stride);
-+ i < (compose_table->n_seqs * index_stride);
- i += index_stride) {
- data.idle_id = g_timeout_add_seconds (20, idle_cb, &data);
- for (j = i; j < i + (index_stride - 2); j++) {
-- guint keyval = m_compose_table->data[j];
-+ guint keyval = compose_table->data[j];
- guint keycode = 0;
- guint modifiers = 0;
- gboolean retval;
-@@ -387,7 +363,7 @@ set_engine_cb (GObject *object,
- data.idle_id = 0;
- }
- }
-- priv = m_compose_table->priv;
-+ priv = compose_table->priv;
- if (priv) {
- for (i = 0;
- i < (priv->first_n_seqs * index_stride);
-@@ -415,6 +391,54 @@ set_engine_cb (GObject *object,
- }
- }
- }
-+}
-+
-+static void
-+set_engine_cb (GObject *object,
-+ GAsyncResult *res,
-+ gpointer user_data)
-+{
-+ IBusBus *bus = IBUS_BUS (object);
-+#if GTK_CHECK_VERSION (4, 0, 0)
-+ GtkEventController *controller = GTK_EVENT_CONTROLLER (user_data);
-+#else
-+ GtkWidget *entry = GTK_WIDGET (user_data);
-+#endif
-+ GError *error = NULL;
-+ static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 };
-+ int i;
-+
-+ if (!ibus_bus_set_global_engine_async_finish (bus, res, &error)) {
-+ g_test_fail_printf ("set engine failed: %s", error->message);
-+ g_error_free (error);
-+ return;
-+ }
-+
-+ /* ibus_im_context_focus_in() is called after GlboalEngine is set.
-+ * The focus-in/out events happen more slowly in a busy system
-+ * likes with a TMT tool.
-+ */
-+ if (is_integrated_desktop () && g_getenv ("IBUS_DAEMON_WITH_SYSTEMD")) {
-+ g_test_message ("Start tiny \"focus-in\" signal test");
-+ for (i = 0; i < 3; i++) {
-+ data.category = TEST_DELAYED_FOCUS_IN;
-+ data.idle_id = g_timeout_add_seconds (1, idle_cb, &data);
-+ g_main_loop_run (m_loop);
-+ if (data.idle_id != 0)
-+ return;
-+ }
-+ g_test_message ("End tiny \"focus-in\" signal test");
-+ data.category = TEST_COMMIT_TEXT;
-+ }
-+ if (m_compose_table == NULL) {
-+ g_test_skip ("Your locale uses en_US compose table.");
-+ idle_cb (&data);
-+ return;
-+ }
-+
-+ send_key_event (m_compose_table);
-+ if (m_no_load_compose_table)
-+ send_key_event (m_no_load_compose_table);
-
- #if GTK_CHECK_VERSION (4, 0, 0)
- g_signal_handlers_disconnect_by_func (
-@@ -547,6 +571,7 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- static int n_loop = 0;
- #endif
- static guint stride = 0;
-+ static gboolean start_no_load_compose = FALSE;
- static gboolean enable_32bit = FALSE;
- guint i;
- int seq;
-@@ -555,12 +580,17 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- #if ! GTK_CHECK_VERSION (4, 0, 0)
- GtkEntry *entry = GTK_ENTRY (user_data);
- #endif
-+ IBusComposeTableEx *compose_table = NULL;
- IBusComposeTablePrivate *priv;
- static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 };
-
- g_assert (m_compose_table != NULL);
-
-- priv = m_compose_table->priv;
-+ if (!start_no_load_compose)
-+ compose_table = m_compose_table;
-+ else
-+ compose_table = m_no_load_compose_table;
-+ priv = compose_table->priv;
-
- #if !GTK_CHECK_VERSION (3, 22, 16)
- if (n_loop % 2 == 1) {
-@@ -572,12 +602,12 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- if (code == 0)
- return;
- #endif
-- i = stride + (m_compose_table->max_seq_len + 2) - 2;
-- seq = (i + 2) / (m_compose_table->max_seq_len + 2);
-- if (!enable_32bit && !m_compose_table->n_seqs && priv)
-+ i = stride + (compose_table->max_seq_len + 2) - 2;
-+ seq = (i + 2) / (compose_table->max_seq_len + 2);
-+ if (!enable_32bit && !compose_table->n_seqs && priv)
- enable_32bit = TRUE;
- if (!enable_32bit) {
-- if (m_compose_table->data[i] == code) {
-+ if (compose_table->data[i] == code) {
- test = GREEN "PASS" NC;
- } else {
- test = RED "FAIL" NC;
-@@ -585,9 +615,9 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- }
- g_test_message ("%05d/%05d %s expected: %04X typed: %04X",
- seq,
-- m_compose_table->n_seqs,
-+ compose_table->n_seqs,
- test,
-- m_compose_table->data[i],
-+ compose_table->data[i],
- code);
- } else {
- const gchar *p = chars;
-@@ -619,13 +649,18 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- valid_output ? g_utf8_get_char (chars) : code);
- }
-
-- stride += m_compose_table->max_seq_len + 2;
-+ stride += compose_table->max_seq_len + 2;
-
-- if (!enable_32bit && seq == m_compose_table->n_seqs) {
-+ if (!enable_32bit && seq == compose_table->n_seqs) {
- if (priv) {
- enable_32bit = TRUE;
- stride = 0;
- seq = 0;
-+ } else if (!start_no_load_compose && m_no_load_compose_table) {
-+ start_no_load_compose = TRUE;
-+ enable_32bit = FALSE;
-+ stride = 0;
-+ seq = 0;
- } else {
- /* Finish tests */
- idle_cb (&data);
-@@ -633,9 +668,16 @@ window_inserted_text_cb (GtkEntryBuffer *buffer,
- }
- }
- if (enable_32bit && seq == priv->first_n_seqs) {
-- /* Finish tests */
-- idle_cb (&data);
-- return;
-+ if (!start_no_load_compose && m_no_load_compose_table) {
-+ start_no_load_compose = TRUE;
-+ enable_32bit = FALSE;
-+ stride = 0;
-+ seq = 0;
-+ } else {
-+ /* Finish tests */
-+ idle_cb (&data);
-+ return;
-+ }
- }
-
- #if !GTK_CHECK_VERSION (3, 22, 16)
-@@ -777,24 +819,25 @@ main (int argc, char *argv[])
- m_srcdir = (argc > 1 && strlen (argv[1]) < FILENAME_MAX)
- ? g_strdup (argv[1]) : g_strdup (".");
- m_compose_file = g_strdup (g_getenv ("COMPOSE_FILE"));
-+ m_no_load_compose_file = g_strdup (g_getenv ("NO_LOAD_COMPOSE_FILE"));
- #if GLIB_CHECK_VERSION (2, 58, 0)
-- m_test_name = g_strdup (g_get_language_names_with_category ("LC_CTYPE")[0]);
-+ m_test_locale = g_strdup (
-+ g_get_language_names_with_category ("LC_CTYPE")[0]);
- #else
-- m_test_name = g_strdup (g_getenv ("LANG"));
-+ m_test_locale = g_strdup (g_getenv ("LANG"));
- #endif
-- if (m_compose_file &&
-- (!m_test_name || !g_ascii_strncasecmp (m_test_name, "en_US", 5))) {
-- g_free (m_test_name);
-- m_test_name = g_path_get_basename (m_compose_file);
-- }
-+ m_test_name = g_strdup_printf ("%s:%s:%s",
-+ m_test_locale ? m_test_locale : "",
-+ m_compose_file ? m_compose_file : "",
-+ m_no_load_compose_file ? m_no_load_compose_file : "");
- /* The parent of GtkIMContextWayland is GtkIMContextSimple and
- * it outputs a warning of "Can't handle >16bit keyvals" in
- * gtk/gtkcomposetable.c:parse_compose_sequence() in pt-BR locales
- * and any warnings are treated as errors with g_test_run()
- * So export LANG=en_US.UTF-8 for GNOME Wayland as a workaround.
- */
-- if (m_test_name && (!g_ascii_strncasecmp (m_test_name, "pt_BR", 5) ||
-- !g_ascii_strncasecmp (m_test_name, "fi_FI", 5)
-+ if (m_test_locale && (!g_ascii_strncasecmp (m_test_locale, "pt_BR", 5) ||
-+ !g_ascii_strncasecmp (m_test_locale, "fi_FI", 5)
- )) {
- m_is_gtk_32bit_compose_error = TRUE;
- }
-@@ -815,5 +858,8 @@ main (int argc, char *argv[])
-
- retval = g_test_run ();
- g_free (m_test_name);
-+ g_free (m_test_locale);
-+ g_free (m_compose_file);
-+ g_free (m_no_load_compose_file);
- return retval;
- }
-diff --git a/src/tests/ibus-compose.env b/src/tests/ibus-compose.env
-index 2ae99439..e2e08939 100644
---- a/src/tests/ibus-compose.env
-+++ b/src/tests/ibus-compose.env
-@@ -1,5 +1,6 @@
--LANG=el_GR.UTF-8
--LANG=fi_FI.UTF-8
--LANG=pt_BR.UTF-8
-+LANG=el_GR.UTF-8 NO_LOAD_COMPOSE_FILE=ibus-compose.usmin2
-+LANG=fi_FI.UTF-8 NO_LOAD_COMPOSE_FILE=ibus-compose.usmin
-+LANG=pt_BR.UTF-8 NO_LOAD_COMPOSE_FILE=ibus-compose.usmin
- LANG=en_US.UTF-8 COMPOSE_FILE=ibus-compose.basic
-+LANG=en_US.UTF-8 NO_LOAD_COMPOSE_FILE=ibus-compose.usmin COMPOSE_FILE=ibus-compose.basic2
- LANG=en_US.UTF-8 COMPOSE_FILE=ibus-compose.emoji
-diff --git a/src/tests/ibus-compose.usmin b/src/tests/ibus-compose.usmin
-new file mode 100644
-index 00000000..0a2db541
---- /dev/null
-+++ b/src/tests/ibus-compose.usmin
-@@ -0,0 +1,8 @@
-+<dead_tilde> <space> : "~" asciitilde # TILDE
-+<dead_tilde> <dead_tilde> : "~" asciitilde # TILDE
-+<dead_tilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-+<Multi_key> <asciitilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-+<dead_circumflex> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
-+<dead_circumflex> <dead_circumflex> : "^" asciicircum # CIRCUMFLEX ACCENT
-+<dead_circumflex> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
-+<Multi_key> <asciicircum> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
-diff --git a/src/tests/ibus-compose.usmin2 b/src/tests/ibus-compose.usmin2
-new file mode 100644
-index 00000000..71f530da
---- /dev/null
-+++ b/src/tests/ibus-compose.usmin2
-@@ -0,0 +1,6 @@
-+<dead_tilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-+<Multi_key> <asciitilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-+<dead_circumflex> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
-+<dead_circumflex> <dead_circumflex> : "^" asciicircum # CIRCUMFLEX ACCENT
-+<dead_circumflex> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
-+<Multi_key> <asciicircum> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
---
-2.52.0
-
-From d77d6998001557c80c4ac0a1eec31f0a18acfd65 Mon Sep 17 00:00:00 2001
-From: David Edmundson <kde@davidedmundson.co.uk>
-Date: Thu, 8 Jan 2026 23:10:16 +0900
-Subject: [PATCH] client/wayland: Connect delete surrounding text
-
-This wasn't hooked up in the wayland bridge leading to typing not
-working correctly when the backend relies on it.
-
-As well as bridging we need to translate the offset in number of unicode
-characters into a number of bytes for the wayland wire format. The logic
-for this translation is inspired by how it works in Mutter which
-converts IBus->TextInput directly.
-
-Note that InputMethodV1 takes an offset + length, whereas V2 has a
-length before and after.
-
-BUG=https://github.com/ibus/ibus/pull/2830
----
- client/wayland/ibuswaylandim.c | 88 +++++++++++++++++++++++++++++++++-
- 1 file changed, 86 insertions(+), 2 deletions(-)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index 2d9f822e..6580b8a4 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -124,6 +124,11 @@ struct _IBusWaylandIMPrivate
- guint preedit_mode;
- IBusModifierType modifiers;
-
-+#if ENABLE_SURROUNDING
-+ IBusText *surrounding_text;
-+ guint surrounding_cursor_pos;
-+#endif
-+
- struct xkb_context *xkb_context;
-
- struct xkb_keymap *keymap;
-@@ -616,6 +621,7 @@ ibus_wayland_im_update_preedit_style (IBusWaylandIM *wlim)
- }
- }
-
-+
- static void
- _context_show_preedit_text_cb (IBusInputContext *context,
- IBusWaylandIM *wlim)
-@@ -706,6 +712,61 @@ _context_update_preedit_text_cb (IBusInputContext *context,
- }
-
-
-+#if ENABLE_SURROUNDING
-+static void
-+_context_delete_surrounding_text_cb (IBusInputContext *context,
-+ gint offset,
-+ guint nchars,
-+ IBusWaylandIM *wlim)
-+{
-+ IBusWaylandIMPrivate *priv;
-+ const char *start, *end;
-+ const char *before, *after;
-+ const char *cursor;
-+ uint32_t before_length;
-+ uint32_t after_length;
-+
-+ g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
-+ priv = ibus_wayland_im_get_instance_private (wlim);
-+
-+ if (!priv->surrounding_text)
-+ return;
-+
-+ offset = MIN (offset, 0);
-+
-+ start = priv->surrounding_text->text;
-+ end = start + strlen (priv->surrounding_text->text);
-+ cursor = start + priv->surrounding_cursor_pos;
-+
-+ before = g_utf8_offset_to_pointer (cursor, offset);
-+ g_return_if_fail (before >= start);
-+ after = g_utf8_offset_to_pointer (cursor, offset + nchars);
-+ g_return_if_fail (after <= end);
-+
-+ before_length = cursor - before;
-+ after_length = after - cursor;
-+
-+ switch (priv->version) {
-+ case INPUT_METHOD_V1:
-+ zwp_input_method_context_v1_delete_surrounding_text (
-+ priv->context,
-+ -before_length,
-+ before_length + after_length);
-+ break;
-+ case INPUT_METHOD_V2:
-+ zwp_input_method_v2_delete_surrounding_text (
-+ priv->seat->input_method_v2,
-+ before_length,
-+ after_length);
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2, priv->serial);
-+ break;
-+ default:
-+ g_assert_not_reached ();
-+ }
-+}
-+#endif
-+
-+
- static void
- handle_surrounding_text (void *data,
- struct zwp_input_method_context_union *context,
-@@ -716,15 +777,23 @@ handle_surrounding_text (void *data,
- #if ENABLE_SURROUNDING
- IBusWaylandIM *wlim = data;
- IBusWaylandIMPrivate *priv;
-+ IBusText *ibustext;
-
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
-+
-+ ibustext = ibus_text_new_from_string (text);
-+
-+ if (priv->surrounding_text)
-+ g_object_unref (priv->surrounding_text);
-+ priv->surrounding_text = g_object_ref_sink (ibustext);
-+ priv->surrounding_cursor_pos = cursor;
-+
- if (priv->ibuscontext != NULL &&
- ibus_input_context_needs_surrounding_text (priv->ibuscontext)) {
- /* CURSOR_POS and ANCHOR_POS are character offset. */
- guint cursor_pos = g_utf8_pointer_to_offset (text, text + cursor);
- guint anchor_pos = g_utf8_pointer_to_offset (text, text + anchor);
-- IBusText *ibustext = ibus_text_new_from_string (text);
-
- ibus_input_context_set_surrounding_text (priv->ibuscontext,
- ibustext,
-@@ -1762,8 +1831,12 @@ _create_input_context_done (GObject *object,
- g_signal_connect (priv->ibuscontext, "hide-preedit-text",
- G_CALLBACK (_context_hide_preedit_text_cb),
- wlim);
--
-+
- #ifdef ENABLE_SURROUNDING
-+ g_signal_connect (priv->ibuscontext, "delete-surrounding-text",
-+ G_CALLBACK (_context_delete_surrounding_text_cb),
-+ wlim);
-+
- capabilities |= IBUS_CAP_SURROUNDING_TEXT;
- #endif
- if (_use_sync_mode == 1)
-@@ -1882,7 +1955,14 @@ input_method_deactivate (void *data,
- priv->ibuscontext,
- G_CALLBACK (_context_hide_preedit_text_cb),
- wlim);
-+#ifdef ENABLE_SURROUNDING
-+ g_signal_handlers_disconnect_by_func (
-+ priv->ibuscontext,
-+ G_CALLBACK (_context_delete_surrounding_text_cb),
-+ wlim);
-+#endif
- g_clear_object (&priv->ibuscontext);
-+
- g_signal_emit (wlim,
- wayland_im_signals[IBUS_FOCUS_OUT],
- 0,
-@@ -1892,6 +1972,10 @@ input_method_deactivate (void *data,
-
- if (priv->preedit_text)
- g_clear_object (&priv->preedit_text);
-+#if ENABLE_SURROUNDING
-+ if (priv->surrounding_text)
-+ g_clear_object (&priv->surrounding_text);
-+#endif
-
- switch (priv->version) {
- case INPUT_METHOD_V1:
---
-2.52.0
-
-From 696261108c8830e1e30327a0a47cfb30ba5da7d1 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 26 Dec 2025 10:15:30 +0900
-Subject: [PATCH] client/wayland: Fix Backspace after commit-text in Ghostty
-
-Ghostty requires to hide the preedit-text to recover to commit the
-control characters. GtkIMContextWayland can emit the 'preedit-end'
-signal in case zwp_text_input_v3_listener.done is emitted.
-Unfortunately zwp_input_method_v2_set_preedit_string() does not support
-to send a %NULL string while zwp_text_input_v3_listener.preedit_string()
-*does* support a %NULL string.
-To make sure the hiding preedit-text, ibus-wayland calls
-zwp_input_method_v2_commit() after the im_serial is updated.
-
-BUG=https://github.com/ibus/ibus/issues/2819
----
- client/wayland/ibuswaylandim.c | 91 +++++++++++++++++++++-------------
- 1 file changed, 57 insertions(+), 34 deletions(-)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index 2d9f822e..bce050d4 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -123,6 +123,7 @@ struct _IBusWaylandIMPrivate
- guint preedit_cursor_pos;
- guint preedit_mode;
- IBusModifierType modifiers;
-+ gboolean hiding_preedit_text;
-
- #if ENABLE_SURROUNDING
- IBusText *surrounding_text;
-@@ -147,7 +148,7 @@ struct _IBusWaylandIMPrivate
- xkb_mod_mask_t hyper_mask;
- xkb_mod_mask_t meta_mask;
-
-- uint32_t serial;
-+ uint32_t im_serial;
- int32_t repeat_rate;
- int32_t repeat_delay;
-
-@@ -157,7 +158,7 @@ struct _IBusWaylandIMPrivate
- struct _IBusWaylandKeyEvent
- {
- struct zwp_input_method_context_v1 *context;
-- uint32_t serial;
-+ uint32_t key_serial;
- uint32_t time;
- uint32_t key;
- enum wl_keyboard_key_state state;
-@@ -324,12 +325,13 @@ ibus_wayland_im_commit_text (IBusWaylandIM *wlim,
- switch (priv->version) {
- case INPUT_METHOD_V1:
- zwp_input_method_context_v1_commit_string (priv->context,
-- priv->serial,
-+ priv->im_serial,
- str);
- break;
- case INPUT_METHOD_V2:
- zwp_input_method_v2_commit_string (priv->seat->input_method_v2, str);
-- zwp_input_method_v2_commit (priv->seat->input_method_v2, priv->serial);
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2,
-+ priv->im_serial);
- break;
- default:
- g_assert_not_reached ();
-@@ -339,7 +341,7 @@ ibus_wayland_im_commit_text (IBusWaylandIM *wlim,
-
- static void
- ibus_wayland_im_key (IBusWaylandIM *wlim,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t time,
- uint32_t key,
- uint32_t state)
-@@ -350,7 +352,7 @@ ibus_wayland_im_key (IBusWaylandIM *wlim,
- switch (priv->version) {
- case INPUT_METHOD_V1:
- zwp_input_method_context_v1_key (priv->context,
-- serial,
-+ key_serial,
- time,
- key,
- state);
-@@ -367,7 +369,7 @@ ibus_wayland_im_key (IBusWaylandIM *wlim,
-
- static void
- ibus_wayland_im_keysym (IBusWaylandIM *wlim,
-- uint32_t serial,
-+ uint32_t im_serial,
- guint keyval,
- uint32_t state,
- guint modifiers)
-@@ -378,7 +380,7 @@ ibus_wayland_im_keysym (IBusWaylandIM *wlim,
- switch (priv->version) {
- case INPUT_METHOD_V1:
- zwp_input_method_context_v1_keysym (priv->context,
-- serial,
-+ im_serial,
- 0,
- keyval,
- state,
-@@ -420,7 +422,7 @@ _context_forward_key_event_cb (IBusInputContext *context,
- state = WL_KEYBOARD_KEY_STATE_PRESSED;
-
- ibus_wayland_im_keysym (wlim,
-- priv->serial,
-+ priv->im_serial,
- keyval,
- state,
- modifiers);
-@@ -645,7 +647,7 @@ _context_show_preedit_text_cb (IBusInputContext *context,
- cursor);
- ibus_wayland_im_update_preedit_style (wlim);
- zwp_input_method_context_v1_preedit_string (priv->context,
-- priv->serial,
-+ priv->im_serial,
- priv->preedit_text->text,
- commit);
- break;
-@@ -655,7 +657,9 @@ _context_show_preedit_text_cb (IBusInputContext *context,
- priv->preedit_text->text,
- cursor,
- strlen (priv->preedit_text->text));
-- zwp_input_method_v2_commit (priv->seat->input_method_v2, priv->serial);
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2,
-+ priv->im_serial);
-+ priv->hiding_preedit_text = FALSE;
- break;
- default:
- g_assert_not_reached ();
-@@ -673,14 +677,16 @@ _context_hide_preedit_text_cb (IBusInputContext *context,
- switch (priv->version) {
- case INPUT_METHOD_V1:
- zwp_input_method_context_v1_preedit_string (priv->context,
-- priv->serial,
-+ priv->im_serial,
- "",
- "");
- break;
- case INPUT_METHOD_V2:
- zwp_input_method_v2_set_preedit_string (priv->seat->input_method_v2,
- "", 0, 0);
-- zwp_input_method_v2_commit (priv->seat->input_method_v2, priv->serial);
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2,
-+ priv->im_serial);
-+ priv->hiding_preedit_text = TRUE;
- break;
- default:
- g_assert_not_reached ();
-@@ -758,7 +764,8 @@ _context_delete_surrounding_text_cb (IBu
- priv->seat->input_method_v2,
- before_length,
- after_length);
-- zwp_input_method_v2_commit (priv->seat->input_method_v2, priv->serial);
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2,
-+ priv->im_serial);
- break;
- default:
- g_assert_not_reached ();
-@@ -851,7 +858,7 @@ context_commit_state_v1 (void *data,
- IBusWaylandIMPrivate *priv;
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
-- priv->serial = serial;
-+ priv->im_serial = serial;
- }
-
-
-@@ -1151,7 +1158,7 @@ _process_key_event_done (GObject *object,
- /* Check retral from ibus_wayland_im_post_key() */
- if (priv->ibuscontext && !retval) {
- ibus_wayland_im_key (event->wlim,
-- event->serial,
-+ event->key_serial,
- event->time,
- event->key,
- event->state);
-@@ -1234,7 +1241,7 @@ _process_key_event_sync (IBusWaylandIM *wlim,
- retval);
- if (!retval) {
- ibus_wayland_im_key (wlim,
-- event->serial,
-+ event->key_serial,
- event->time,
- event->key,
- event->state);
-@@ -1264,7 +1271,7 @@ _process_key_event_async (IBusWaylandIM *wlim,
- return;
- }
- async_event->context = priv->context;
-- async_event->serial = event->serial;
-+ async_event->key_serial = event->key_serial;
- async_event->time = event->time;
- async_event->key = event->key;
- async_event->modifiers = event->modifiers & ~IBUS_RELEASE_MASK;
-@@ -1336,7 +1343,7 @@ _process_key_event_hybrid_async (IBusWaylandIM *wlim,
- }
- if (priv->ibuscontext && !async_event->retval) {
- ibus_wayland_im_key (wlim,
-- event->serial,
-+ event->key_serial,
- event->time,
- event->key,
- event->state);
-@@ -1506,7 +1513,7 @@ key_event_check_repeat (IBusWaylandIM *wlim,
- static void
- input_method_keyboard_key (void *data,
- struct zwp_keyboard_union *keyboard,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t time,
- uint32_t key,
- uint32_t state)
-@@ -1528,11 +1535,11 @@ input_method_keyboard_key (void *data,
- state,
- FALSE);
- if (!retval)
-- ibus_wayland_im_key (wlim, serial, time, key, state);
-+ ibus_wayland_im_key (wlim, key_serial, time, key, state);
- return;
- }
-
-- event.serial = serial;
-+ event.key_serial = key_serial;
- event.time = time;
- event.key = key;
- event.state = state;
-@@ -1563,7 +1570,7 @@ input_method_keyboard_key (void *data,
- static void
- input_method_keyboard_modifiers (void *data,
- struct zwp_keyboard_union *keyboard,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t mods_depressed,
- uint32_t mods_latched,
- uint32_t mods_locked,
-@@ -1607,7 +1614,7 @@ input_method_keyboard_modifiers (void *data,
-
- switch (priv->version) {
- case INPUT_METHOD_V1:
-- zwp_input_method_context_v1_modifiers (priv->context, serial,
-+ zwp_input_method_context_v1_modifiers (priv->context, key_serial,
- mods_depressed, mods_latched,
- mods_locked, group);
- break;
-@@ -1659,21 +1666,21 @@ input_method_keyboard_keymap_v1 (void *data,
- static void
- input_method_keyboard_key_v1 (void *data,
- struct wl_keyboard *keyboard_v1,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t time,
- uint32_t key,
- uint32_t state)
- {
- struct zwp_keyboard_union keyboard;
- keyboard.u.keyboard_v1 = keyboard_v1;
-- input_method_keyboard_key (data, &keyboard, serial, time, key, state);
-+ input_method_keyboard_key (data, &keyboard, key_serial, time, key, state);
- }
-
-
- static void
- input_method_keyboard_modifiers_v1 (void *data,
- struct wl_keyboard *keyboard_v1,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t mods_depressed,
- uint32_t mods_latched,
- uint32_t mods_locked,
-@@ -1683,7 +1690,7 @@ input_method_keyboard_modifiers_v1 (void *data,
- keyboard.u.keyboard_v1 = keyboard_v1;
- input_method_keyboard_modifiers (data,
- &keyboard,
-- serial,
-+ key_serial,
- mods_depressed,
- mods_latched,
- mods_locked,
-@@ -1721,14 +1728,14 @@ static void
- input_method_keyboard_key_v2 (void *data,
- struct zwp_input_method_keyboard_grab_v2
- *keyboard_v2,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t time,
- uint32_t key,
- uint32_t state)
- {
- struct zwp_keyboard_union keyboard;
- keyboard.u.keyboard_v2 = keyboard_v2;
-- input_method_keyboard_key (data, &keyboard, serial, time, key, state);
-+ input_method_keyboard_key (data, &keyboard, key_serial, time, key, state);
- }
-
-
-@@ -1736,7 +1743,7 @@ static void
- input_method_keyboard_modifiers_v2 (void *data,
- struct zwp_input_method_keyboard_grab_v2
- *keyboard_v2,
-- uint32_t serial,
-+ uint32_t key_serial,
- uint32_t mods_depressed,
- uint32_t mods_latched,
- uint32_t mods_locked,
-@@ -1746,7 +1753,7 @@ input_method_keyboard_modifiers_v2 (void *data,
- keyboard.u.keyboard_v2 = keyboard_v2;
- input_method_keyboard_modifiers (data,
- &keyboard,
-- serial,
-+ key_serial,
- mods_depressed,
- mods_latched,
- mods_locked,
-@@ -1875,7 +1882,7 @@ input_method_activate (void *data,
-
- priv->context = context;
- if (context)
-- priv->serial = 0;
-+ priv->im_serial = 0;
-
- switch (priv->version) {
- case INPUT_METHOD_V1:
-@@ -2088,9 +2095,26 @@ input_method_done_v2 (void *data,
-
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
-- priv->serial++;
-+ priv->im_serial++;
- input_method.u.input_method_v2 = input_method_v2;
-
-+ /* Ghostty requires to receive the 'im_preedit_end' signal with
-+ * zwp_input_method_v2_set_preedit_string() to recover the 'im_commit'
-+ * signal but GtkIMContextWayland::text_input_preedit_apply() can emit
-+ * the 'preedit-end' signal in case that
-+ * GtkIMContextWayland->current_preedit.text is %NULL and it happens
-+ * if zwp_text_input_v3_listener.done is emitted.
-+ * To make sure zwp_text_input_v3_listener.done,
-+ * zwp_input_method_v2_commit() is called after the im_serial is bumped.
-+ */
-+ if (priv->hiding_preedit_text &&
-+ !priv->seat->pending_activate &&
-+ priv->seat->active) {
-+ zwp_input_method_v2_commit (priv->seat->input_method_v2,
-+ priv->im_serial);
-+ priv->hiding_preedit_text = FALSE;
-+ }
-+
- if (priv->seat->pending_activate && !priv->seat->active) {
- priv->seat->active = TRUE;
- input_method_activate (data, &input_method, NULL);
-@@ -2169,7 +2193,7 @@ registry_handle_global (void *data,
- interface, name, version);
- fflush (priv->log);
- }
-- priv->serial = 0;
-+ priv->im_serial = 0;
- if (!g_strcmp0 (interface, zwp_input_method_manager_v2_interface.name)) {
- priv->version = INPUT_METHOD_V2;
- priv->input_method_manager_v2 =
---
-2.52.0
-
-From 63bbe0b43408a1308be797cfab79c9d54bd1c144 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 8 Jan 2026 19:48:35 +0900
-Subject: [PATCH 1/2] ui/gtk3/extension: Fix assertion in panel_binding_construct()
-
-Check m_ibus in extension.vala:bus_name_acquired_cb().
-
-BUG=rhbz#1797120
----
- ui/gtk3/extension.vala | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala
-index 5cd1a6ad..3acd76ea 100644
---- a/ui/gtk3/extension.vala
-+++ b/ui/gtk3/extension.vala
-@@ -73,6 +73,10 @@ class ExtensionGtk : Gtk.Application {
- string signal_name,
- Variant parameters) {
- debug("signal_name = %s", signal_name);
-+ /* rhbz#1797120 Fix assert(bus.is_connected()) in
-+ * panel_binding_construct()
-+ */
-+ return_if_fail(m_bus.is_connected());
- m_panel = new PanelBinding(m_bus, this);
- m_panel.load_settings();
- }
---
-2.52.0
-
-From e8628f50640567890e08d2e5fb0230e891bbe0fd Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 8 Jan 2026 19:52:12 +0900
-Subject: [PATCH 2/2] ui/gtk3: Fix SEGV with double bus_name_acquired_cb()
-
-When PanelBinding() is called twice, g_dbus_connection_register_object()
-is failed in ibus_service_register() due to the duplicated object path
-and it calls unnecessary g_object_unref() although g_object_unref() is
-called in g_dbus_connection_register_object() and it causes a SEGV.
-
-But @user_data_free_func in g_dbus_connection_register_object() is not
-called with g_dbus_connection_unregister_object() immediately and I'd
-think not to use @user_data_free_func.
-
-BUG=rhbz#2419469
----
- src/ibusservice.c | 18 ++++++++++++++++--
- ui/gtk3/application.vala | 16 ++++++++++++++--
- ui/gtk3/extension.vala | 16 ++++++++++++++--
- 3 files changed, 44 insertions(+), 6 deletions(-)
-
-diff --git a/src/ibusservice.c b/src/ibusservice.c
-index 51bd2ee4..3c7c04a4 100644
---- a/src/ibusservice.c
-+++ b/src/ibusservice.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2026 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -495,9 +495,15 @@ ibus_service_unregister_cb (GDBusConnection *connection,
- guint *p = ids;
- while (*p != 0) {
- g_dbus_connection_unregister_object (connection, *p++);
-+ /* g_dbus_connection_register_object(connection) calls
-+ * g_object_ref(service).
-+ */
-+ g_object_unref (service);
- }
- g_signal_handlers_disconnect_by_func (connection,
- G_CALLBACK (ibus_service_connection_closed_cb), service);
-+ /* g_hash_table_insert(service->priv->table) calls g_object_ref(connection)
-+ */
- g_object_unref (connection);
- g_free (ids);
- }
-@@ -566,12 +572,19 @@ ibus_service_register (IBusService *service,
-
- array = g_array_new (TRUE, TRUE, sizeof (guint));
- while (*p != NULL) {
-+ /* Probably I think @user_data_free_func in
-+ * g_dbus_connection_register_object() is not useful in this case
-+ * since the free func is not called until the @connection is closed
-+ * but the @connection is shared with other instances
-+ * so it would be better to call g_object_unref(service)
-+ * after g_dbus_connection_unregister_object() is called.
-+ */
- guint id = g_dbus_connection_register_object (connection,
- service->priv->object_path,
- *p,
- &ibus_service_interface_vtable,
- g_object_ref (service),
-- (GDestroyNotify)g_object_unref,
-+ NULL,
- error);
- if (id != 0) {
- g_array_append_val (array, id);
-@@ -594,6 +607,7 @@ error_out:
- guint *ids = (guint*) array->data;
- while (*ids != 0) {
- g_dbus_connection_unregister_object (connection, *ids++);
-+ g_object_unref (service);
- }
- g_array_free (array, TRUE);
- }
-diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala
-index 65ab43cf..dcabc892 100644
---- a/ui/gtk3/application.vala
-+++ b/ui/gtk3/application.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2011 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2017-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2017-2026 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
-@@ -98,6 +98,16 @@ class Application {
- string signal_name,
- Variant parameters) {
- debug("signal_name = %s", signal_name);
-+ if (m_panel != null) {
-+ // ibus_object_destroy() is needed because g_object_unref() is
-+ // called by ibus_service_unregister_cb() but another
-+ // g_object_unref() is also called by g_object_run_dispose()
-+ // and one g_object_unref() is not needed because Vala calls it
-+ // with `m_panel = null`.
-+ m_panel.ref();
-+ ((IBus.Object)m_panel).destroy();
-+ m_panel.disconnect_signals();
-+ }
- m_panel = new Panel(bus, m_enable_wayland_im);
- if (m_log != null)
- m_panel.set_log(m_log, m_verbose);
-@@ -128,7 +138,8 @@ class Application {
- // g_dbus_connection_register_object()
- debug("signal_name = %s", signal_name);
-
-- // unref m_panel
-+ m_panel.ref();
-+ ((IBus.Object)m_panel).destroy();
- m_panel.disconnect_signals();
- #if USE_GDK_WAYLAND
- if (m_realize_surface_id != 0) {
-@@ -144,6 +155,7 @@ class Application {
- m_ibus_focus_out_id = 0;
- }
- #endif
-+ // unref m_panel
- m_panel = null;
- }
-
-diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala
-index 3acd76ea..7ee54cd3 100644
---- a/ui/gtk3/extension.vala
-+++ b/ui/gtk3/extension.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2018-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2018-2026 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
-@@ -77,6 +77,16 @@ class ExtensionGtk : Gtk.Application {
- * panel_binding_construct()
- */
- return_if_fail(m_bus.is_connected());
-+ if (m_panel != null) {
-+ // ibus_object_destroy() is needed because g_object_unref() is
-+ // called by ibus_service_unregister_cb() but another
-+ // g_object_unref() is also called by g_object_run_dispose()
-+ // and one g_object_unref() is not needed because Vala calls it
-+ // with `m_panel = null`.
-+ m_panel.ref();
-+ ((IBus.Object)m_panel).destroy();
-+ m_panel.disconnect_signals();
-+ }
- m_panel = new PanelBinding(m_bus, this);
- m_panel.load_settings();
- }
-@@ -95,8 +105,10 @@ class ExtensionGtk : Gtk.Application {
- // g_dbus_connection_register_object()
- debug("signal_name = %s", signal_name);
-
-- // unref m_panel
-+ m_panel.ref();
-+ ((IBus.Object)m_panel).destroy();
- m_panel.disconnect_signals();
-+ // unref m_panel
- m_panel = null;
- }
-
---
-2.52.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:09 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:09 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 9b4ff6f321135aa88d28a2b85d3bff24fa78fae0
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-11-22T15:20:54+09:00
Stats : +0/-669 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/9b4ff6f321135aa88d28a2b85d3bff24fa78fae0?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index e7cb596..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,669 +0,0 @@
-From ea70b2dff6bbcedc8c339f4f016cf6862e20d1e7 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 7 Oct 2025 14:24:54 +0900
-Subject: [PATCH] Revert "bus: Update gdm bits based on new gdm changes"
-
-Unfortunately this patch(4a45bf1) enables ibus-daemon in gdm by default
-and I'm reverting it for ibus 1.5.33.
-The GDM default has been disable IBus.
-
-Fixes: https://github.com/ibus/ibus/commit/4a45bf1
-BUG=https://github.com/ibus/ibus/pull/2804
----
- bus/main.c | 33 +------------------
- ....freedesktop.IBus.session.GNOME.service.in | 3 ++
- configure.ac | 2 +-
- 3 files changed, 5 insertions(+), 33 deletions(-)
-
-diff --git a/bus/main.c b/bus/main.c
-index e0db15b3..63ec5536 100644
---- a/bus/main.c
-+++ b/bus/main.c
-@@ -39,7 +39,6 @@
-
- #ifdef G_OS_UNIX
- #include <glib-unix.h>
--#include <grp.h>
- #endif
-
- #include "global.h"
-@@ -57,12 +56,10 @@ static gchar *config = "default";
- static gchar *desktop = "gnome";
-
- static gchar *panel_extension_disable_users[] = {
-+ "gdm",
- "gnome-initial-setup",
- "liveuser"
- };
--static gchar *panel_extension_disable_groups[] = {
-- "gdm",
--};
-
- static void
- show_version_and_quit (void)
-@@ -187,11 +184,6 @@ main (gint argc, gchar **argv)
- {
- int i;
- const gchar *username = ibus_get_user_name ();
-- const gchar *groupname = NULL;
--#ifdef HAVE_GETGRGID_R
-- char buffer[4096];
-- struct group gbuf;
--#endif
-
- setlocale (LC_ALL, "");
-
-@@ -224,23 +216,6 @@ main (gint argc, gchar **argv)
- }
- }
-
-- /* get group name */
-- {
-- struct group *grp = NULL;
--#ifdef HAVE_GETGRGID_R
-- /* MT-Safe locale */
-- getgrgid_r (getgid (), &gbuf, buffer, sizeof(buffer), &grp);
--#else
-- /* MT-Unsafe race:grgid locale */
-- grp = getgrgid (getgid ());
--#endif
--
-- if (grp && grp->gr_name && grp->gr_name[0])
-- groupname = grp->gr_name;
-- else
-- g_warning ("Couldn't get group name");
-- }
--
- /* daemonize process */
- if (daemonize) {
- if (daemon (1, 0) != 0) {
-@@ -284,12 +259,6 @@ main (gint argc, gchar **argv)
- break;
- }
- }
-- for (i = 0; i < G_N_ELEMENTS(panel_extension_disable_groups); i++) {
-- if (g_strcmp0 (groupname, panel_extension_disable_groups[i]) == 0) {
-- emoji_extension = "disable";
-- break;
-- }
-- }
- if (!single) {
- /* execute config component */
- if (g_strcmp0 (config, "default") == 0) {
-diff --git a/bus/services/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-index f0debb37..858cf10d 100644
---- a/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-+++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-@@ -12,6 +12,9 @@ Before=gnome-session.target
- After=gnome-session-initialized.target
- PartOf=gnome-session-initialized.target
-
-+# Never run in GDM
-+Conflicts=gnome-session@gnome-login.target
-+
- [Service]
- Type=dbus
- # Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
-diff --git a/configure.ac b/configure.ac
-index ad4f1929..b353a654 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -178,7 +178,7 @@ AC_MSG_RESULT([$enable_product_build])
- AC_CHECK_HEADERS([sys/prctl.h])
-
- # Check functions.
--AC_CHECK_FUNCS(daemon getgrgid_r)
-+AC_CHECK_FUNCS(daemon)
-
- # Check dlclose() in libc.so.
- AC_CHECK_LIB(c, dlclose, LIBDL="", [AC_CHECK_LIB(dl, dlclose, LIBDL="-ldl")])
---
-2.51.0
-
-From 4a45bf155c968bcc2f711d6b4827788802de18d1 Mon Sep 17 00:00:00 2001
-From: Joan Torres Lopez <joantolo@redhat.com>
-Date: Sun, 5 Oct 2025 10:39:50 +0900
-Subject: [PATCH] bus: Update gdm bits based on new gdm changes
-
-Since GDM 49 version, gdm user doesn't exist and for each greeter
-there's a dynamic user creation, e.g. gdm-greeter-1, gdm-greeter-2.
-All of them are part of gdm group, so instead of checking for a specific
-user, we check for a specific group.
-
-Also, remove Conflicts in systemd service to allow ibus in GDM sessions.
-This covers some cases where users might have special characters in their
-password or username.
-
-BUG=https://gitlab.gnome.org/GNOME/gdm/-/issues/1018
-BUG=https://github.com/ibus/ibus/pull/2804
----
- bus/main.c | 33 ++++++++++++++++++-
- ....freedesktop.IBus.session.GNOME.service.in | 3 --
- configure.ac | 2 +-
- 3 files changed, 33 insertions(+), 5 deletions(-)
-
-diff --git a/bus/main.c b/bus/main.c
-index 63ec5536..e0db15b3 100644
---- a/bus/main.c
-+++ b/bus/main.c
-@@ -39,6 +39,7 @@
-
- #ifdef G_OS_UNIX
- #include <glib-unix.h>
-+#include <grp.h>
- #endif
-
- #include "global.h"
-@@ -56,10 +57,12 @@ static gchar *config = "default";
- static gchar *desktop = "gnome";
-
- static gchar *panel_extension_disable_users[] = {
-- "gdm",
- "gnome-initial-setup",
- "liveuser"
- };
-+static gchar *panel_extension_disable_groups[] = {
-+ "gdm",
-+};
-
- static void
- show_version_and_quit (void)
-@@ -184,6 +187,11 @@ main (gint argc, gchar **argv)
- {
- int i;
- const gchar *username = ibus_get_user_name ();
-+ const gchar *groupname = NULL;
-+#ifdef HAVE_GETGRGID_R
-+ char buffer[4096];
-+ struct group gbuf;
-+#endif
-
- setlocale (LC_ALL, "");
-
-@@ -216,6 +224,23 @@ main (gint argc, gchar **argv)
- }
- }
-
-+ /* get group name */
-+ {
-+ struct group *grp = NULL;
-+#ifdef HAVE_GETGRGID_R
-+ /* MT-Safe locale */
-+ getgrgid_r (getgid (), &gbuf, buffer, sizeof(buffer), &grp);
-+#else
-+ /* MT-Unsafe race:grgid locale */
-+ grp = getgrgid (getgid ());
-+#endif
-+
-+ if (grp && grp->gr_name && grp->gr_name[0])
-+ groupname = grp->gr_name;
-+ else
-+ g_warning ("Couldn't get group name");
-+ }
-+
- /* daemonize process */
- if (daemonize) {
- if (daemon (1, 0) != 0) {
-@@ -259,6 +284,12 @@ main (gint argc, gchar **argv)
- break;
- }
- }
-+ for (i = 0; i < G_N_ELEMENTS(panel_extension_disable_groups); i++) {
-+ if (g_strcmp0 (groupname, panel_extension_disable_groups[i]) == 0) {
-+ emoji_extension = "disable";
-+ break;
-+ }
-+ }
- if (!single) {
- /* execute config component */
- if (g_strcmp0 (config, "default") == 0) {
-diff --git a/bus/services/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-index 858cf10d..f0debb37 100644
---- a/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-+++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
-@@ -12,9 +12,6 @@ Before=gnome-session.target
- After=gnome-session-initialized.target
- PartOf=gnome-session-initialized.target
-
--# Never run in GDM
--Conflicts=gnome-session@gnome-login.target
--
- [Service]
- Type=dbus
- # Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
-diff --git a/configure.ac b/configure.ac
-index a9396d7e..fc32398c 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -178,7 +178,7 @@ AC_MSG_RESULT([$enable_product_build])
- AC_CHECK_HEADERS([sys/prctl.h])
-
- # Check functions.
--AC_CHECK_FUNCS(daemon)
-+AC_CHECK_FUNCS(daemon getgrgid_r)
-
- # Check dlclose() in libc.so.
- AC_CHECK_LIB(c, dlclose, LIBDL="", [AC_CHECK_LIB(dl, dlclose, LIBDL="-ldl")])
---
-2.51.0
-
-From 94c6ede4289666782d860ae964f9a09cbdc78554 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 13 Nov 2025 20:15:37 +0900
-Subject: [PATCH] engine: Update simple.xml with xkeyboard-config 2.46
-
----
- engine/gensimple.py | 8 ++---
- engine/simple.xml.in | 70 ++++++++++++++++++++++++++++++++++++++++----
- 2 files changed, 69 insertions(+), 9 deletions(-)
-
-diff --git a/engine/gensimple.py b/engine/gensimple.py
-index de6d7ff5..4e331732 100755
---- a/engine/gensimple.py
-+++ b/engine/gensimple.py
-@@ -248,7 +248,7 @@ class GenerateEngineXML():
- self._AUTHOR,
- self.__first)
- parser.setContentHandler(self.__handler)
-- f = codecs.open(self.__path, 'r', encoding='utf-8')
-+ f = open(self.__path, 'r', encoding='utf-8')
- try:
- parser.parse(f)
- except SAXParseException:
-@@ -257,7 +257,7 @@ class GenerateEngineXML():
- f.close()
- def write(self, output=None):
- if output != None:
-- od = codecs.open(output, 'w', encoding='utf-8')
-+ od = open(output, 'w', encoding='utf-8')
- else:
- if PY3K:
- od = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
-@@ -311,7 +311,7 @@ class ISO639XML(XMLFilterBase):
-
-
- def parse_iso639(path):
-- f = codecs.open(path, 'r', encoding='utf-8')
-+ f = open(path, 'r', encoding='utf-8')
- parser = sax_make_parser()
- parser.setFeature(sax_feature_namespaces, 0)
- handler = ISO639XML(parser)
-@@ -327,7 +327,7 @@ def parse_iso639(path):
-
- def parse_denylist(denyfile):
- denylist = []
-- f = codecs.open(denyfile, 'r', encoding='utf-8')
-+ f = open(denyfile, 'r', encoding='utf-8')
- for line in f.readlines():
- if line == '\n' or line[0] == '#':
- continue
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index 92fea8a8..c39d4134 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -3,7 +3,7 @@
- <name>org.freedesktop.IBus.Simple</name>
- <description>A table based simple engine</description>
- <exec>@libexecdir@/ibus-engine-simple</exec>
-- <version>1.5.33-beta1.20250916</version>
-+ <version>1.5.33.20251113</version>
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
- <license>GPL</license>
- <homepage>https://github.com/ibus/ibus/wiki</homepage>
-@@ -2738,8 +2738,20 @@
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
- <layout>us</layout>
- <layout_variant>mac</layout_variant>
-- <longname>English (Macintosh)</longname>
-- <description>English (Macintosh)</description>
-+ <longname>English (Macintosh, ABC, ANSI)</longname>
-+ <description>English (Macintosh, ABC, ANSI)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:us:mac-iso:eng</name>
-+ <language>en</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>us</layout>
-+ <layout_variant>mac-iso</layout_variant>
-+ <longname>English (Macintosh, ABC, ISO)</longname>
-+ <description>English (Macintosh, ABC, ISO)</description>
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-@@ -2906,8 +2918,20 @@
- <author>Peng Huang <shawn.p.huang@gmail.com></author>
- <layout>us</layout>
- <layout_variant>dvorak-mac</layout_variant>
-- <longname>English (Dvorak, Macintosh)</longname>
-- <description>English (Dvorak, Macintosh)</description>
-+ <longname>English (Dvorak, Macintosh, ANSI)</longname>
-+ <description>English (Dvorak, Macintosh, ANSI)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:us:dvorak-mac-iso:eng</name>
-+ <language>en</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>us</layout>
-+ <layout_variant>dvorak-mac-iso</layout_variant>
-+ <longname>English (Dvorak, Macintosh, ISO)</longname>
-+ <description>English (Dvorak, Macintosh, ISO)</description>
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-@@ -11041,6 +11065,18 @@
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-+ <engine>
-+ <name>xkb:th:mnc:tha</name>
-+ <language>th</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>th</layout>
-+ <layout_variant>mnc</layout_variant>
-+ <longname>Thai (Manoonchai)</longname>
-+ <description>Thai (Manoonchai)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
- <engine>
- <name>xkb:bw::tsn</name>
- <language>tn</language>
-@@ -11217,6 +11253,18 @@
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-+ <engine>
-+ <name>xkb:ua:winkeysenhanced:ukr</name>
-+ <language>uk</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>ua</layout>
-+ <layout_variant>winkeysenhanced</layout_variant>
-+ <longname>Ukrainian (Windows Enhanced)</longname>
-+ <description>Ukrainian (Windows Enhanced)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
- <engine>
- <name>xkb:ua:macOS:ukr</name>
- <language>uk</language>
-@@ -11324,6 +11372,18 @@
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-+ <engine>
-+ <name>xkb:pk:pak_urdu_phonetic:urd</name>
-+ <language>ur</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>pk</layout>
-+ <layout_variant>pak_urdu_phonetic</layout_variant>
-+ <longname>Urdu (Pak Urdu Phonetic)</longname>
-+ <description>Urdu (Pak Urdu Phonetic)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
- <engine>
- <name>xkb:pk:ara:ara</name>
- <language>ar</language>
---
-2.51.0
-
-From 8720838d7f59de485e6769bb939b6eef0c985276 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 14 Nov 2025 02:39:56 +0900
-Subject: [PATCH] src: Load EN compose file in pt-BR locale
-
-- The EN compose table is enabled in case that language compose files,
- el-GR, fi-FI, pt-BR languages, are loaded but the user has no
- user compose file.
-- Output double dead keys with the well-known chars likes the EN compose
- table in case that the user has a user compose file but not enable
- the EN compose table.
-- Load language compose files in case the user compose file is loaded
- with the 'include "%L"' keyword.
-
-Fixes: https://github.com/ibus/ibus/commit/7c2b32b4
-BUG=https://github.com/ibus/ibus/issues/2825
----
- src/ibuscomposetable.c | 32 ++++++++++++++--
- src/ibuscomposetable.h | 1 +
- src/ibusenginesimple.c | 85 +++++++++++++++++++++++++-----------------
- 3 files changed, 81 insertions(+), 37 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index e60ad091..8e1785ca 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1576,6 +1576,20 @@ ibus_compose_table_new_with_list (GList *compose_list,
- }
-
-
-+static gboolean
-+_datafile_is_system (const gchar *compose_file)
-+{
-+ g_assert (compose_file);
-+ if (!g_ascii_strncasecmp (compose_file, "/usr", 4) ||
-+ !g_ascii_strncasecmp (compose_file, "/etc", 4) ||
-+ !g_ascii_strncasecmp (compose_file, "/usr", 4) ||
-+ !g_ascii_strncasecmp (compose_file, "/opt", 4)) {
-+ return TRUE;
-+ }
-+ return FALSE;
-+}
-+
-+
- IBusComposeTableEx *
- ibus_compose_table_new_with_file (const gchar *compose_file,
- GSList *compose_tables)
-@@ -1632,6 +1646,7 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- } else {
- compose_table->id = g_str_hash (compose_file);
- compose_table->can_load_en_us = can_load_en_us;
-+ compose_table->is_system = _datafile_is_system (compose_file);
- return compose_table;
- }
- }
-@@ -1647,8 +1662,10 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- max_compose_len,
- n_index_stride,
- g_str_hash (compose_file));
-- if (compose_table)
-+ if (compose_table) {
- compose_table->can_load_en_us = can_load_en_us;
-+ compose_table->is_system = _datafile_is_system (compose_file);
-+ }
-
- g_list_free_full (compose_list,
- (GDestroyNotify) ibus_compose_list_element_free);
-@@ -1793,8 +1810,10 @@ ibus_compose_table_list_add_file (GSList *compose_tables,
-
- compose_table = ibus_compose_table_load_cache (compose_file,
- &saved_version);
-- if (compose_table != NULL)
-+ if (compose_table != NULL) {
-+ compose_table->is_system = _datafile_is_system (compose_file);
- return g_slist_prepend (compose_tables, compose_table);
-+ }
-
- parse:
- if ((compose_table = ibus_compose_table_new_with_file (compose_file,
-@@ -2138,8 +2157,15 @@ ibus_check_algorithmically (const guint *compose_buffer,
-
- for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
- ;
-- if (i == n_compose)
-+ if (i == n_compose) {
-+ /* If no EN compose, double dead keys should be output? */
-+ if (i == 2 && compose_buffer[0] == compose_buffer[1]) {
-+ *output_char = ibus_keysym_to_unicode (compose_buffer[0],
-+ FALSE,
-+ NULL);
-+ }
- return TRUE;
-+ }
-
- if (i > 0 && i == n_compose - 1) {
- combination_buffer[0] = ibus_keyval_to_unicode (compose_buffer[i]);
-diff --git a/src/ibuscomposetable.h b/src/ibuscomposetable.h
-index 2068657d..ce4cdae1 100644
---- a/src/ibuscomposetable.h
-+++ b/src/ibuscomposetable.h
-@@ -65,6 +65,7 @@ struct _IBusComposeTableEx
- guint32 id;
- char *rawdata;
- gboolean can_load_en_us;
-+ gboolean is_system;
- };
-
-
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index baef9508..ac7ffc41 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -173,7 +173,9 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- length,
- &saved_version);
- g_bytes_unref (data);
-- if (!en_compose_table && saved_version) {
-+ if (en_compose_table) {
-+ en_compose_table->is_system = TRUE;
-+ } else if (!en_compose_table && saved_version) {
- g_warning ("Failed to parse the builtin compose due to the different "
- "version %u. Please rebuild IBus resource files.",
- saved_version);
-@@ -1023,6 +1025,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- GString *output = g_string_new ("");
- gboolean success = FALSE;
- gboolean is_32bit = FALSE;
-+ gboolean all_is_system = TRUE;
- gboolean can_load_en_us = FALSE;
- gunichar output_char = '\0';
-
-@@ -1034,18 +1037,27 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
-
- G_LOCK (global_tables);
- tmp_list = global_tables;
-+ while (tmp_list) {
-+ IBusComposeTableEx *compose_table = tmp_list->data;
-+ if (!compose_table->is_system) {
-+ all_is_system = FALSE;
-+ break;
-+ }
-+ tmp_list = tmp_list->next;
-+ }
-+ tmp_list = global_tables;
- while (tmp_list) {
- IBusComposeTableEx *compose_table = tmp_list->data;
- if (compose_table->can_load_en_us)
- can_load_en_us = TRUE;
-- /* If global_tables includes en_compose_table only, i.e. no user
-- * or locale compose tables, en_compose_table is used.
-- * If not, en_compose_table is used in case one of the other compose
-- * tables has can_load_en_us = %TRUE, i.e. the table file has
-- * the line of 'include "%L"'.
-+ /* If global_tables includes system compose tables only, i.e. no user
-+ * compose tables, en_compose_table is used.
-+ * If user compose table is included in global_tables, en_compose_table
-+ * is used in case that the user compose table has can_load_en_us =
-+ * %TRUE, i.e. the compose file has the line of 'include "%L"'.
- * en_compose_table is always appended to the last of global_tables.
- */
-- if ((compose_table == en_compose_table) && global_tables->next != NULL
-+ if ((compose_table == en_compose_table) && !all_is_system
- && !can_load_en_us) {
- tmp_list = tmp_list->next;
- continue;
-@@ -1102,7 +1114,12 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- g_string_free (output, TRUE);
- output = NULL;
-
-- if (ibus_check_algorithmically (priv->compose_buffer,
-+ /* TODO: priv->tentative_match should not be used in case
-+ * success == %TRUE? Now ibus_check_algorithmically() hits double dead
-+ * keys.
-+ */
-+ if (!success &&
-+ ibus_check_algorithmically (priv->compose_buffer,
- n_compose,
- &output_char)) {
- priv->in_compose_sequence = TRUE;
-@@ -1689,42 +1706,42 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
- if (locale == NULL) {
- path = g_build_filename (g_get_user_config_dir (),
- "ibus", "Compose", NULL);
-- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
-+ if (g_file_test (path, G_FILE_TEST_EXISTS))
- ibus_engine_simple_add_compose_file (simple, path);
-- g_free (path);
-- return retval;
-- }
- g_clear_pointer(&path, g_free);
-
-- path = g_build_filename (g_get_user_config_dir (),
-- "gtk-4.0", "Compose", NULL);
-- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
-- ibus_engine_simple_add_compose_file (simple, path);
-- g_free (path);
-- return retval;
-+ /* If user compose is not loaded except for en_compose_table */
-+ if (global_tables && !global_tables->next) {
-+ path = g_build_filename (g_get_user_config_dir (),
-+ "gtk-4.0", "Compose", NULL);
-+ if (g_file_test (path, G_FILE_TEST_EXISTS))
-+ ibus_engine_simple_add_compose_file (simple, path);
-+ g_clear_pointer(&path, g_free);
- }
-- g_clear_pointer(&path, g_free);
-
-- path = g_build_filename (g_get_user_config_dir (),
-- "gtk-3.0", "Compose", NULL);
-- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
-- ibus_engine_simple_add_compose_file (simple, path);
-- g_free (path);
-- return retval;
-+ if (global_tables && !global_tables->next) {
-+ path = g_build_filename (g_get_user_config_dir (),
-+ "gtk-3.0", "Compose", NULL);
-+ if (g_file_test (path, G_FILE_TEST_EXISTS))
-+ ibus_engine_simple_add_compose_file (simple, path);
-+ g_clear_pointer(&path, g_free);
- }
-- g_clear_pointer(&path, g_free);
-
- home = g_get_home_dir ();
-- if (home == NULL)
-- return retval;
-
-- path = g_build_filename (home, ".XCompose", NULL);
-- if (g_file_test (path, G_FILE_TEST_EXISTS)) {
-- ibus_engine_simple_add_compose_file (simple, path);
-- g_free (path);
-- return retval;
-+ if (home && global_tables && !global_tables->next) {
-+ path = g_build_filename (home, ".XCompose", NULL);
-+ if (g_file_test (path, G_FILE_TEST_EXISTS))
-+ ibus_engine_simple_add_compose_file (simple, path);
-+ g_clear_pointer(&path, g_free);
-+ }
-+
-+ /* Decide if both user compose and locale compose is loaded. */
-+ if (global_tables && global_tables->next) {
-+ IBusComposeTableEx *compose_table = global_tables->data;
-+ if (!compose_table->can_load_en_us)
-+ return retval;
- }
-- g_clear_pointer(&path, g_free);
-
- #if GLIB_CHECK_VERSION (2, 58, 0)
- langs = g_get_language_names_with_category ("LC_CTYPE");
---
-2.51.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : eb9b4a574f42bac93b2262a06695ccc772232321
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-08-22T09:48:10+09:00
Stats : +0/-6030 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/eb9b4a574f42bac93b2262a06695ccc772232321?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 9ea8b3c..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,6030 +0,0 @@
-From d0ad4e6e519439f034d08fd6531403027bd7fbde Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 18 Apr 2025 16:36:43 +0900
-Subject: [PATCH] ui/gtk3: Fix Exit and Restart menu items in Wayland input-method V2
-
----
- tools/main.vala | 1 +
- ui/gtk3/panel.vala | 18 +++++++-----------
- 2 files changed, 8 insertions(+), 11 deletions(-)
-
-diff --git a/tools/main.vala b/tools/main.vala
-index 4b5bcff2..a7c6d95d 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -277,6 +277,7 @@ bool start_daemon_in_wayland(bool restart,
- "directly.\n");
- }
- bus = null;
-+ Posix.sleep(3);
- } else if (bus != null) {
- stderr.printf("%s\n".printf(_("IBus is running.")));
- Posix.exit(Posix.EXIT_FAILURE);
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index e42a166e..ab514bab 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -1524,25 +1524,21 @@ class Panel : IBus.PanelService {
- string[] _args = {};
- _args += binary;
- _args += args;
-- if (args == "exit" || args == "restart")
-- _args += "--type=kde-wayland";
-- string? standard_out = null;
-- string? standard_error = null;
-+ // FIXME: stdout & stderr causes a dead lock with `ibus restart`
-+ // in Wayland input-method V2.
- GLib.Process.spawn_sync(null,
- _args,
- GLib.Environ.get(),
-- 0,
-+ GLib.SpawnFlags.SEARCH_PATH_FROM_ENVP,
-+ null,
-+ null,
- null,
-- out standard_out,
-- out standard_error,
- null);
-- if (standard_out != null)
-- print(standard_out);
-- if (standard_error != null)
-- warning("Execute %s failed! %s", binary, standard_error);
- } catch (GLib.SpawnError e) {
- warning("Execute %s failed! %s", binary, e.message);
- }
-+ IBus.quit();
-+ Gtk.main_quit();
- }
-
- private void append_preferences_menu(Gtk.Menu menu) {
---
-2.49.0
-
-From b4f51b69f03b18fadf4bbd82abc7b7e92fae44f0 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 3 May 2025 11:54:21 +0900
-Subject: [PATCH] bus/inputcontext: Free data in bus_input_context_forward_process_key_event
-
-Should free data in case of no focuses and engines.
----
- bus/inputcontext.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index c551fbc8..41b47540 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2024 Red Hat, Inc.
-+ * Copyright (C) 2015-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2025 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
-@@ -3564,5 +3564,7 @@ bus_input_context_forward_process_key_event (BusInputContext *context,
- (GAsyncReadyCallback)
- _forward_process_key_event_reply_cb,
- data);
-+ } else {
-+ g_slice_free (ProcessKeyEventData, data);
- }
- }
---
-2.49.0
-
-From e7222db9b72dfd08d7ef1a03d5b6baa046d025f0 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 22 May 2025 23:23:48 +0900
-Subject: [PATCH] ui/gtk3: Update Plasma setup message
-
-BUG=https://github.com/ibus/ibus/issues/2753
----
- ui/gtk3/panel.vala | 11 +++++------
- 1 file changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index ab514bab..363834e9 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -926,12 +926,11 @@ class Panel : IBus.PanelService {
- var format =
- _("IBus should be called from the desktop session in " +
- "%s. For KDE, you can launch '%s' " +
-- "utility and go to \"Input Devices\" -> " +
-- "\"Virtual Keyboard\" section and select " +
-+ "utility and go to \"Input & Output\" -> \"Keyboard\" " +
-+ "-> \"Virtual Keyboard\" section and select " +
- "\"%s\" icon and click \"Apply\" button to " +
- "configure IBus in %s. For other desktop " +
-- "sessions, you can copy the 'Exec=' line in %s file " +
-- "to a configuration file of the session. " +
-+ "sessions, you can run \"%s\" command. " +
- "Please refer each document about the \"Wayland " +
- "input method\" configuration. Before you configure " +
- "the \"Wayland input method\", you should make sure " +
-@@ -939,10 +938,10 @@ class Panel : IBus.PanelService {
- "variables are unset in the desktop session.");
- message = format.printf(
- "Wayland",
-- "systemsettings5",
-+ "systemsettings",
- "IBus Wayland",
- "Wayland",
-- "org.freedesktop.IBus.Panel.Wayland.Gtk3.desktop");
-+ "ibus start");
- } else if (m_is_wayland && m_is_wayland_im && !is_gnome()) {
- if (Environment.get_variable("QT_IM_MODULE") == "ibus") {
- var format =
---
-2.49.0
-
-From 7feb57a8330d0969f82c742a2c1c0aeb120971fc Mon Sep 17 00:00:00 2001
-From: matiwari <matiwari@redhat.com>
-Date: Tue, 29 Apr 2025 12:52:25 +0530
-Subject: [PATCH] src/ibusobservedpath: Free IBusObservedPath objects during traversal
-
-BUG=https://github.com/ibus/ibus/issues/2755
----
- src/ibusobservedpath.c | 9 ++++++++-
- 1 file changed, 8 insertions(+), 1 deletion(-)
-
-diff --git a/src/ibusobservedpath.c b/src/ibusobservedpath.c
-index 42192431..224bfb8b 100644
---- a/src/ibusobservedpath.c
-+++ b/src/ibusobservedpath.c
-@@ -79,7 +79,12 @@ ibus_observed_path_init (IBusObservedPath *path)
- static void
- ibus_observed_path_destroy (IBusObservedPath *path)
- {
-+ IBusObservedPathPrivate *priv;
- g_free (path->path);
-+ if (IBUS_IS_OBSERVED_PATH (path)) {
-+ priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
-+ g_clear_pointer (&priv->file_hash_list, g_free);
-+ }
- IBUS_OBJECT_CLASS (ibus_observed_path_parent_class)->destroy (IBUS_OBJECT (path));
- }
-
-@@ -349,6 +354,8 @@ ibus_observed_path_traverse (IBusObservedPath *path,
- ibus_observed_path_traverse (sub, dir_only));
- } else if (sub->is_exist && !dir_only) {
- paths = g_list_append (paths, sub);
-+ } else {
-+ g_object_unref (sub);
- }
- }
- g_dir_close (dir);
-@@ -513,7 +520,7 @@ ibus_observed_path_new (const gchar *path,
- priv->file_hash_list[i + 1] = 0;
- ++i;
- }
-- g_list_free_full (file_list, (GDestroyNotify)ibus_observed_path_destroy);
-+ g_list_free_full (file_list, (GDestroyNotify)g_object_unref);
-
- if (fill_stat)
- ibus_observed_path_fill_stat (op);
---
-2.49.0
-
-From c5d98f98ecc98f8c726b5d9631464305306c8fb1 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 25 May 2025 19:08:24 +0900
-Subject: [PATCH 1/3] ui/gtk3: Delete Vala deprecated APIs before 0.34
-
-Vala 0.34 has been available since 2018 and now the deprecated APIs
-can be deleted safely for 5 years.
-
-BUG=https://github.com/ibus/ibus/pull/2761
----
- ui/gtk3/bindingcommon.vala | 11 +-----
- ui/gtk3/candidatepanel.vala | 7 ----
- ui/gtk3/emojier.vala | 34 ----------------
- ui/gtk3/propertypanel.vala | 61 -----------------------------
- ui/gtk3/switcher.vala | 78 -------------------------------------
- 5 files changed, 2 insertions(+), 189 deletions(-)
-
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index 8c332542..727e1257 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -76,17 +76,10 @@ class BindingCommon {
- Gdk.ModifierType.HYPER_MASK |
- Gdk.ModifierType.META_MASK);
- if ((switch_modifiers & VIRTUAL_MODIFIERS) != 0) {
-- // workaround a bug in gdk vapi vala > 0.18
-- // https://bugzilla.gnome.org/show_bug.cgi?id=677559
--#if VALA_0_18
-+ // workaround a bug in gdk vapi vala > 0.18
-+ // https://bugzilla.gnome.org/show_bug.cgi?id=677559
- Gdk.Keymap.get_for_display(Gdk.Display.get_default()
- ).map_virtual_modifiers(ref switch_modifiers);
--#else
-- if ((switch_modifiers & Gdk.ModifierType.SUPER_MASK) != 0)
-- switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
-- if ((switch_modifiers & Gdk.ModifierType.HYPER_MASK) != 0)
-- switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
--#endif
- switch_modifiers &= ~VIRTUAL_MODIFIERS;
- }
-
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index 5ba8cf36..aa1a34ce 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -508,17 +508,10 @@ public class CandidatePanel : Gtk.Box{
- // Use get_monitor_geometry() instead of get_monitor_area().
- // get_monitor_area() excludes docks, but the lookup window should be
- // shown over them.
--#if VALA_0_34
- Gdk.Monitor monitor = window.get_display().get_monitor_at_point(
- m_cursor_location.x,
- m_cursor_location.y);
- monitor_area = monitor.get_geometry();
--#else
-- Gdk.Screen screen = Gdk.Screen.get_default();
-- int monitor_num = screen.get_monitor_at_point(m_cursor_location.x,
-- m_cursor_location.y);
-- screen.get_monitor_geometry(monitor_num, out monitor_area);
--#endif
- return monitor_area;
- }
-
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index 519da3e2..1770de2f 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -29,11 +29,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- valign : Gtk.Align.FILL
- );
- this.motion_notify_event.connect((e) => {
--#if VALA_0_24
- Gdk.EventMotion pe = e;
--#else
-- Gdk.EventMotion *pe = &e;
--#endif
- if (m_mouse_x == pe.x_root && m_mouse_y == pe.y_root)
- return false;
- m_mouse_x = pe.x_root;
-@@ -1516,11 +1512,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- return false;
- if (m_lookup_table.get_cursor_pos() == index)
- return false;
--#if VALA_0_24
- Gdk.EventMotion pe = e;
--#else
-- Gdk.EventMotion *pe = &e;
--#endif
- if (m_mouse_x == pe.x_root && m_mouse_y == pe.y_root)
- return false;
- m_mouse_x = pe.x_root;
-@@ -1964,17 +1956,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- // Use get_monitor_geometry() instead of get_monitor_area().
- // get_monitor_area() excludes docks, but the lookup window should be
- // shown over them.
--#if VALA_0_34
- Gdk.Monitor monitor = Gdk.Display.get_default().get_monitor_at_point(
- m_cursor_location.x,
- m_cursor_location.y);
- monitor_area = monitor.get_geometry();
--#else
-- Gdk.Screen screen = Gdk.Screen.get_default();
-- int monitor_num = screen.get_monitor_at_point(m_cursor_location.x,
-- m_cursor_location.y);
-- screen.get_monitor_geometry(monitor_num, out monitor_area);
--#endif
- return monitor_area;
- }
-
-@@ -2268,24 +2253,12 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- present_centralize(event);
-
- Gdk.Device pointer;
--#if VALA_0_34
- Gdk.Seat seat = event.get_seat();
- if (seat == null) {
- var display = get_display();
- seat = display.get_default_seat();
- }
- pointer = seat.get_pointer();
--#else
-- Gdk.Device device = event.get_device();
-- if (device == null) {
-- var display = get_display();
-- device = display.list_devices().data;
-- }
-- if (device.get_source() == Gdk.InputSource.KEYBOARD)
-- pointer = device.get_associated_device();
-- else
-- pointer = device;
--#endif
- pointer.get_position_double(null,
- out m_mouse_x,
- out m_mouse_y);
-@@ -2521,17 +2494,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- get_allocation(out allocation);
- Gdk.Rectangle monitor_area;
- Gdk.Rectangle work_area;
--#if VALA_0_34
- Gdk.Display display = get_display();
- Gdk.Monitor monitor = display.get_monitor_at_window(this.get_window());
- monitor_area = monitor.get_geometry();
- work_area = monitor.get_workarea();
--#else
-- Gdk.Screen screen = Gdk.Screen.get_default();
-- int monitor_num = screen.get_monitor_at_window(this.get_window());
-- screen.get_monitor_geometry(monitor_num, out monitor_area);
-- work_area = screen.get_monitor_workarea(monitor_num);
--#endif
- int x = (monitor_area.x + monitor_area.width - allocation.width)/2;
- int y = (monitor_area.y + monitor_area.height
- - allocation.height)/2;
-diff --git a/ui/gtk3/propertypanel.vala b/ui/gtk3/propertypanel.vala
-index 20739b9c..f1ecd7f7 100644
---- a/ui/gtk3/propertypanel.vala
-+++ b/ui/gtk3/propertypanel.vala
-@@ -359,15 +359,10 @@ public class PropertyPanel : Gtk.Box {
- m_toplevel.get_allocation(out allocation);
-
- Gdk.Rectangle monitor_area;
--#if VALA_0_34
- // gdk_screen_get_monitor_workarea() no longer return the correct
- // area from "_NET_WORKAREA" atom in GTK 3.22
- Gdk.Monitor monitor = Gdk.Display.get_default().get_monitor(0);
- monitor_area = monitor.get_workarea();
--#else
-- Gdk.Screen screen = Gdk.Screen.get_default();
-- monitor_area = screen.get_monitor_workarea(0);
--#endif
- int monitor_right = monitor_area.x + monitor_area.width;
- int monitor_bottom = monitor_area.y + monitor_area.height;
- int x, y;
-@@ -524,15 +519,10 @@ public class PropMenu : Gtk.Menu, IPropToolItem {
- public new void popup(uint button,
- uint32 activate_time,
- Gtk.Widget widget) {
--#if VALA_0_34
- base.popup_at_widget(widget,
- Gdk.Gravity.SOUTH_WEST,
- Gdk.Gravity.NORTH_WEST,
- null);
--#else
-- m_parent_button = widget;
-- base.popup(null, null, menu_position, button, activate_time);
--#endif
- }
-
- public override void destroy() {
-@@ -590,57 +580,6 @@ public class PropMenu : Gtk.Menu, IPropToolItem {
- }
- }
- }
--
--#if !VALA_0_34
-- private void menu_position(Gtk.Menu menu,
-- out int x,
-- out int y,
-- out bool push_in) {
-- var button = m_parent_button;
-- var screen = button.get_screen();
-- var monitor = screen.get_monitor_at_window(button.get_window());
--
-- Gdk.Rectangle monitor_location;
-- screen.get_monitor_geometry(monitor, out monitor_location);
--
-- button.get_window().get_origin(out x, out y);
--
-- Gtk.Allocation button_allocation;
-- button.get_allocation(out button_allocation);
--
-- x += button_allocation.x;
-- y += button_allocation.y;
--
-- int menu_width;
-- int menu_height;
-- menu.get_size_request(out menu_width, out menu_height);
--
-- if (x + menu_width >= monitor_location.width)
-- x -= menu_width - button_allocation.width;
-- else if (x - menu_width <= 0)
-- ;
-- else {
-- if (x <= monitor_location.width * 3 / 4)
-- ;
-- else
-- x -= menu_width - button_allocation.width;
-- }
--
-- if (y + button_allocation.height + menu_width
-- >= monitor_location.height)
-- y -= menu_height;
-- else if (y - menu_height <= 0)
-- y += button_allocation.height;
-- else {
-- if (y <= monitor_location.height * 3 / 4)
-- y += button_allocation.height;
-- else
-- y -= menu_height;
-- }
--
-- push_in = false;
-- }
--#endif
- }
-
- public class PropToolButton : Gtk.ToolButton, IPropToolItem {
-diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
-index 99a2fa0b..d4a5fa11 100644
---- a/ui/gtk3/switcher.vala
-+++ b/ui/gtk3/switcher.vala
-@@ -235,7 +235,6 @@ class Switcher : Gtk.Window {
- }
-
- Gdk.Device pointer;
--#if VALA_0_34
- Gdk.Seat seat = event.get_seat();
- if (seat == null) {
- var display = get_display();
-@@ -262,54 +261,6 @@ class Switcher : Gtk.Window {
- null);
- if (status != Gdk.GrabStatus.SUCCESS)
- warning("Grab pointer failed! status = %d", status);
--#else
-- Gdk.Device device = event.get_device();
-- if (device == null) {
-- var display = get_display();
-- var device_manager = display.get_device_manager();
--/* The macro VALA_X_Y supports even numbers.
-- * http://git.gnome.org/browse/vala/commit/?id=294b374af6
-- */
--#if VALA_0_16
-- device = device_manager.list_devices(Gdk.DeviceType.MASTER).data;
--#else
-- unowned GLib.List<Gdk.Device> devices =
-- device_manager.list_devices(Gdk.DeviceType.MASTER);
-- device = devices.data;
--#endif
-- }
--
-- Gdk.Device keyboard;
-- if (device.get_source() == Gdk.InputSource.KEYBOARD) {
-- keyboard = device;
-- pointer = device.get_associated_device();
-- } else {
-- pointer = device;
-- keyboard = device.get_associated_device();
-- }
--
-- Gdk.GrabStatus status;
-- // Grab all keyboard events
-- status = keyboard.grab(get_window(),
-- Gdk.GrabOwnership.NONE,
-- true,
-- Gdk.EventMask.KEY_PRESS_MASK |
-- Gdk.EventMask.KEY_RELEASE_MASK,
-- null,
-- Gdk.CURRENT_TIME);
-- if (status != Gdk.GrabStatus.SUCCESS)
-- warning("Grab keyboard failed! status = %d", status);
-- // Grab all pointer events
-- status = pointer.grab(get_window(),
-- Gdk.GrabOwnership.NONE,
-- true,
-- Gdk.EventMask.BUTTON_PRESS_MASK |
-- Gdk.EventMask.BUTTON_RELEASE_MASK,
-- null,
-- Gdk.CURRENT_TIME);
-- if (status != Gdk.GrabStatus.SUCCESS)
-- warning("Grab pointer failed! status = %d", status);
--#endif
-
- // Probably we can delete m_popup_delay_time in 1.6
- pointer.get_position_double(null,
-@@ -322,12 +273,7 @@ class Switcher : Gtk.Window {
- m_loop.run();
- m_loop = null;
-
--#if VALA_0_34
- seat.ungrab();
--#else
-- keyboard.ungrab(Gdk.CURRENT_TIME);
-- pointer.ungrab(Gdk.CURRENT_TIME);
--#endif
-
- hide();
- // Make sure the switcher is hidden before returning from this function.
-@@ -372,11 +318,7 @@ class Switcher : Gtk.Window {
- return true;
- });
- button.motion_notify_event.connect((e) => {
--#if VALA_0_24
- Gdk.EventMotion pe = e;
--#else
-- Gdk.EventMotion *pe = &e;
--#endif
- if (m_selected_engine == index)
- return false;
- if (!m_mouse_moved &&
-@@ -414,21 +356,12 @@ class Switcher : Gtk.Window {
-
- Gdk.Display display = Gdk.Display.get_default();
- int screen_width = 0;
--#if VALA_0_34
- // display.get_monitor_at_window() is null because of unrealized window
- Gdk.Monitor monitor = display.get_primary_monitor();
- if (monitor == null)
- return;
- Gdk.Rectangle area = monitor.get_geometry();
- screen_width = area.width;
--#else
-- Gdk.Screen screen = (display != null) ?
-- display.get_default_screen() : null;
--
-- if (screen != null) {
-- screen_width = screen.get_width();
-- }
--#endif
-
- if (screen_width > 0 && max_label_width > (screen_width / 4)) {
- max_label_width = screen_width / 4;
-@@ -503,14 +436,7 @@ class Switcher : Gtk.Window {
- public override bool key_press_event(Gdk.EventKey e) {
- bool retval = Gdk.EVENT_STOP;
-
--/* Gdk.EventKey is changed to the pointer.
-- * https://git.gnome.org/browse/vala/commit/?id=598942f1
-- */
--#if VALA_0_24
- Gdk.EventKey pe = e;
--#else
-- Gdk.EventKey *pe = &e;
--#endif
-
- if (m_popup_delay_time > 0) {
- restore_window_position("pressed");
-@@ -557,11 +483,7 @@ class Switcher : Gtk.Window {
- }
-
- public override bool key_release_event(Gdk.EventKey e) {
--#if VALA_0_24
- Gdk.EventKey pe = e;
--#else
-- Gdk.EventKey *pe = &e;
--#endif
-
- if (KeybindingManager.primary_modifier_still_pressed((Gdk.Event) pe,
- m_primary_modifier)) {
---
-2.49.0
-
-From cf6263e4742fa338fd9bbed78396bb29a70aeccb Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 1 Jun 2025 20:24:42 +0900
-Subject: [PATCH 2/3] Implement IBusMessage
-
-IBusEngine and IBusPanel can send IBusMessage to IBusPanel.
-Currently GtkPopup takes input focus in Wayland, and the Panel can only
-display non-focused popups with the Wayland panel protocol.
-
-While GTK allows the IM modules to flash the focused window to alert
-users of thier typing errors, individual IBus engines lack this
-capability. This is because engines typically only receive keyboard
-input (keysyms/keycodes) and not the associated window information.
-The proposed solution is to redirect the error messages to the system
-Panel. The Panel, having access to window management in Wayland and
-Xorg, could then handle the display of non-focused popup notifications.
-
-GNOME-Shell needs to handle the IBusMessage. As a temporary solution in
-GNOME, the compose sequence will be flashed to alert users as a
-workaround until the full implementation is completed.
-
-Also refactor "Free data in bus_input_context_forward_process_key_event".
-
-Fixes: https://github.com/ibus/ibus/commit/b4f51b69
-BUG=https://github.com/ibus/ibus/issues/2722
----
- bindings/vala/IBus-1.0-custom.vala | 40 +-
- bus/engineproxy.c | 40 +-
- bus/ibusimpl.c | 67 ++--
- bus/inputcontext.c | 34 +-
- bus/panelproxy.c | 37 +-
- bus/panelproxy.h | 7 +-
- src/Makefile.am | 6 +-
- src/ibusengine.c | 33 +-
- src/ibusengine.h | 36 +-
- src/ibusenginesimple.c | 63 +++-
- src/ibusmessage.c | 562 +++++++++++++++++++++++++++++
- src/ibusmessage.h | 205 +++++++++++
- src/ibuspanelservice.c | 128 ++++++-
- src/ibuspanelservice.h | 38 +-
- src/ibustypes.h | 14 +
- ui/gtk3/Makefile.am | 1 +
- ui/gtk3/emojier.vala | 39 +-
- ui/gtk3/message.vala | 353 ++++++++++++++++++
- ui/gtk3/panel.vala | 137 +++++--
- ui/gtk3/panelbinding.vala | 5 +-
- 20 files changed, 1727 insertions(+), 118 deletions(-)
- create mode 100644 src/ibusmessage.c
- create mode 100644 src/ibusmessage.h
- create mode 100644 ui/gtk3/message.vala
-
-diff --git a/bindings/vala/IBus-1.0-custom.vala b/bindings/vala/IBus-1.0-custom.vala
-index ec46fc90..8ced8a97 100644
---- a/bindings/vala/IBus-1.0-custom.vala
-+++ b/bindings/vala/IBus-1.0-custom.vala
-@@ -1,24 +1,38 @@
- namespace IBus {
-+ public class EmojiData : IBus.Serializable {
-+ [CCode (cname = "ibus_emoji_data_new",
-+ has_construct_function = true)]
-+ public EmojiData (string first_property_name, ...);
-+ }
-+ public class ExtensionEvent : IBus.Serializable {
-+ [CCode (cname = "ibus_extension_event_new",
-+ has_construct_function = true)]
-+ public ExtensionEvent (string first_property_name, ...);
-+ }
-+ public class Message : IBus.Serializable {
-+ [CCode (cname = "ibus_message_new",
-+ has_construct_function = true)]
-+ public Message (uint domain,
-+ uint code,
-+ string? title,
-+ string description,
-+ ...);
-+ }
-+ public class PanelService : IBus.Service {
-+ public void
-+ panel_extension_register_keys(string first_property_name, ...);
-+ }
- // For some reason, ibus_text_new_from_static_string is hidden in GIR
- // https://github.com/ibus/ibus/commit/37e6e587
- [CCode (type_id = "ibus_text_get_type ()", cheader_filename = "ibus.h")]
- public class Text : IBus.Serializable {
-- [CCode (cname = "ibus_text_new_from_static_string", has_construct_function = false)]
-+ [CCode (cname = "ibus_text_new_from_static_string",
-+ has_construct_function = false)]
- public Text.from_static_string (string str);
- }
-- public class ExtensionEvent : IBus.Serializable {
-- [CCode (cname = "ibus_extension_event_new", has_construct_function = true)]
-- public ExtensionEvent (string first_property_name, ...);
-- }
- public class XEvent : IBus.Serializable {
-- [CCode (cname = "ibus_x_event_new", has_construct_function = true)]
-+ [CCode (cname = "ibus_x_event_new",
-+ has_construct_function = true)]
- public XEvent (string first_property_name, ...);
- }
-- public class PanelService : IBus.Service {
-- public void panel_extension_register_keys(string first_property_name, ...);
-- }
-- public class EmojiData : IBus.Serializable {
-- [CCode (cname = "ibus_emoji_data_new", has_construct_function = true)]
-- public EmojiData (string first_property_name, ...);
-- }
- }
-diff --git a/bus/engineproxy.c b/bus/engineproxy.c
-index 8bd6cefd..98ec63fe 100644
---- a/bus/engineproxy.c
-+++ b/bus/engineproxy.c
-@@ -95,6 +95,7 @@ enum {
- REGISTER_PROPERTIES,
- UPDATE_PROPERTY,
- PANEL_EXTENSION,
-+ SEND_MESSAGE,
- LAST_SIGNAL,
- };
-
-@@ -458,6 +459,20 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_FROM_CLASS (class),
- bus_marshal_VOID__OBJECTv);
-
-+ engine_signals[SEND_MESSAGE] =
-+ g_signal_new (I_("send-message"),
-+ G_TYPE_FROM_CLASS (class),
-+ G_SIGNAL_RUN_LAST,
-+ 0,
-+ NULL, NULL,
-+ bus_marshal_VOID__VARIANT,
-+ G_TYPE_NONE,
-+ 1,
-+ G_TYPE_VARIANT);
-+ g_signal_set_va_marshaller (engine_signals[SEND_MESSAGE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VARIANTv);
-+
- text_empty = ibus_text_new_from_static_string ("");
- g_object_ref_sink (text_empty);
-
-@@ -594,7 +609,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
-
- gint i;
- for (i = 0; i < G_N_ELEMENTS (signals); i++) {
-- if (g_strcmp0 (signal_name, signals[i].signal_name) == 0) {
-+ if (!g_strcmp0 (signal_name, signals[i].signal_name)) {
- g_signal_emit (engine, engine_signals[signals[i].signal_id], 0);
- return;
- }
-@@ -603,7 +618,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- /* Handle D-Bus signals with parameters. Deserialize them and emit a glib
- * signal.
- */
-- if (g_strcmp0 (signal_name, "CommitText") == 0) {
-+ if (!g_strcmp0 (signal_name, "CommitText")) {
- GVariant *arg0 = NULL;
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-@@ -616,7 +631,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "ForwardKeyEvent") == 0) {
-+ if (!g_strcmp0 (signal_name, "ForwardKeyEvent")) {
- guint32 keyval = 0;
- guint32 keycode = 0;
- guint32 states = 0;
-@@ -631,7 +646,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "DeleteSurroundingText") == 0) {
-+ if (!g_strcmp0 (signal_name, "DeleteSurroundingText")) {
- gint offset_from_cursor = 0;
- guint nchars = 0;
- g_variant_get (parameters, "(iu)", &offset_from_cursor, &nchars);
-@@ -642,7 +657,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "UpdatePreeditText") == 0) {
-+ if (!g_strcmp0 (signal_name, "UpdatePreeditText")) {
- GVariant *arg0 = NULL;
- guint cursor_pos = 0;
- gboolean visible = FALSE;
-@@ -664,7 +679,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "UpdateAuxiliaryText") == 0) {
-+ if (!g_strcmp0 (signal_name, "UpdateAuxiliaryText")) {
- GVariant *arg0 = NULL;
- gboolean visible = FALSE;
-
-@@ -684,7 +699,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "UpdateLookupTable") == 0) {
-+ if (!g_strcmp0 (signal_name, "UpdateLookupTable")) {
- GVariant *arg0 = NULL;
- gboolean visible = FALSE;
-
-@@ -705,7 +720,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "RegisterProperties") == 0) {
-+ if (!g_strcmp0 (signal_name, "RegisterProperties")) {
- GVariant *arg0 = NULL;
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-@@ -723,7 +738,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "UpdateProperty") == 0) {
-+ if (!g_strcmp0 (signal_name, "UpdateProperty")) {
- GVariant *arg0 = NULL;
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-@@ -738,7 +753,7 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-- if (g_strcmp0 (signal_name, "PanelExtension") == 0) {
-+ if (!g_strcmp0 (signal_name, "PanelExtension")) {
- GVariant *arg0 = NULL;
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-@@ -752,6 +767,11 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-+ if (!g_strcmp0 (signal_name, "SendMessage")) {
-+ g_signal_emit (engine, engine_signals[SEND_MESSAGE], 0, parameters);
-+ return;
-+ }
-+
- g_return_if_reached ();
- }
-
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 5c9c52ce..fe521f2d 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -470,6 +470,19 @@ _panel_forward_process_key_event_cb (BusPanelProxy *panel,
- modifiers);
- }
-
-+static void
-+_panel_send_message_cb (BusPanelProxy *panel,
-+ GVariant *parameters,
-+ BusIBusImpl *ibus)
-+{
-+ if (!ibus->panel) {
-+ g_warning ("Panel is not running.");
-+ return;
-+ }
-+ g_return_if_fail (BUS_IS_PANEL_PROXY (ibus->panel));
-+ bus_panel_proxy_send_message_received (ibus->panel, parameters);
-+}
-+
- static void
- _registry_changed_cb (IBusRegistry *registry,
- BusIBusImpl *ibus)
-@@ -556,26 +569,29 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus,
- G_CALLBACK (
- _panel_panel_extension_register_keys_cb),
- ibus);
-- g_signal_connect (
-- *panel,
-- "update-preedit-text-received",
-- G_CALLBACK (_panel_update_preedit_text_received_cb),
-- ibus);
-- g_signal_connect (
-- *panel,
-- "update-lookup-table-received",
-- G_CALLBACK (_panel_update_lookup_table_received_cb),
-- ibus);
-- g_signal_connect (
-- *panel,
-- "update-auxiliary-text-received",
-- G_CALLBACK (_panel_update_auxiliary_text_received_cb),
-- ibus);
-- g_signal_connect (
-- *panel,
-- "forward-process-key-event",
-- G_CALLBACK (_panel_forward_process_key_event_cb),
-- ibus);
-+ g_signal_connect (*panel,
-+ "update-preedit-text-received",
-+ G_CALLBACK (
-+ _panel_update_preedit_text_received_cb),
-+ ibus);
-+ g_signal_connect (*panel,
-+ "update-lookup-table-received",
-+ G_CALLBACK (
-+ _panel_update_lookup_table_received_cb),
-+ ibus);
-+ g_signal_connect (*panel,
-+ "update-auxiliary-text-received",
-+ G_CALLBACK (
-+ _panel_update_auxiliary_text_received_cb),
-+ ibus);
-+ g_signal_connect (*panel,
-+ "forward-process-key-event",
-+ G_CALLBACK (_panel_forward_process_key_event_cb),
-+ ibus);
-+ g_signal_connect (*panel,
-+ "send-message",
-+ G_CALLBACK (_panel_send_message_cb),
-+ ibus);
-
- if (ibus->focused_context != NULL) {
- context = ibus->focused_context;
-@@ -849,11 +865,20 @@ _context_panel_extension_cb (BusInputContext *context,
- bus_ibus_impl_set_panel_extension_mode (ibus, event);
- }
-
-+static void
-+_context_send_message_cb (BusInputContext *context,
-+ GVariant *parameters,
-+ BusIBusImpl *ibus)
-+{
-+ _panel_send_message_cb (ibus->panel, parameters, ibus);
-+}
-+
- const static struct {
- const gchar *name;
- GCallback callback;
- } context_signals [] = {
-- { "panel-extension", G_CALLBACK (_context_panel_extension_cb) }
-+ { "panel-extension", G_CALLBACK (_context_panel_extension_cb) },
-+ { "send-message", G_CALLBACK (_context_send_message_cb) }
- };
-
- /**
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index 41b47540..ee4fa99b 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -165,6 +165,7 @@ enum {
- REQUEST_ENGINE,
- SET_CONTENT_TYPE,
- PANEL_EXTENSION,
-+ SEND_MESSAGE,
- LAST_SIGNAL,
- };
-
-@@ -767,6 +768,20 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_FROM_CLASS (class),
- bus_marshal_VOID__OBJECTv);
-
-+ context_signals[SEND_MESSAGE] =
-+ g_signal_new (I_("send-message"),
-+ G_TYPE_FROM_CLASS (class),
-+ G_SIGNAL_RUN_LAST,
-+ 0,
-+ NULL, NULL,
-+ bus_marshal_VOID__VARIANT,
-+ G_TYPE_NONE,
-+ 1,
-+ G_TYPE_VARIANT);
-+ g_signal_set_va_marshaller (context_signals[SEND_MESSAGE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VARIANTv);
-+
- text_empty = ibus_text_new_from_string ("");
- g_object_ref_sink (text_empty);
- lookup_table_empty = ibus_lookup_table_new (9 /* page size */,
-@@ -2789,6 +2804,20 @@ _engine_panel_extension_cb (BusEngineProxy *engine,
- g_signal_emit (context, context_signals[PANEL_EXTENSION], 0, event);
- }
-
-+/**
-+ * _engine_send_message_cb:
-+ *
-+ * A function to be called when "send-message" glib signal is sent
-+ * from the engine object.
-+ */
-+static void
-+_engine_send_message_cb (BusEngineProxy *engine,
-+ GVariant *parameters,
-+ BusInputContext *context)
-+{
-+ g_signal_emit (context, context_signals[SEND_MESSAGE], 0, parameters);
-+}
-+
- static void
- _engine_show_preedit_text_cb (BusEngineProxy *engine,
- BusInputContext *context)
-@@ -2978,6 +3007,7 @@ const static struct {
- { "register-properties", G_CALLBACK (_engine_register_properties_cb) },
- { "update-property", G_CALLBACK (_engine_update_property_cb) },
- { "panel-extension", G_CALLBACK (_engine_panel_extension_cb) },
-+ { "send-message", G_CALLBACK (_engine_send_message_cb) },
- { "destroy", G_CALLBACK (_engine_destroy_cb) }
- };
-
-@@ -3549,9 +3579,9 @@ bus_input_context_forward_process_key_event (BusInputContext *context,
- guint keycode,
- guint modifiers)
- {
-- ProcessKeyEventData *data = g_slice_new0 (ProcessKeyEventData);
- g_assert (BUS_IS_INPUT_CONTEXT (context));
- if (context->has_focus && context->engine && context->fake == FALSE) {
-+ ProcessKeyEventData *data = g_slice_new0 (ProcessKeyEventData);
- data->context = g_object_ref (context);
- data->keyval = keyval;
- data->keycode = keycode;
-@@ -3564,7 +3594,5 @@ bus_input_context_forward_process_key_event (BusInputContext *context,
- (GAsyncReadyCallback)
- _forward_process_key_event_reply_cb,
- data);
-- } else {
-- g_slice_free (ProcessKeyEventData, data);
- }
- }
-diff --git a/bus/panelproxy.c b/bus/panelproxy.c
-index b76d6f76..997f5964 100644
---- a/bus/panelproxy.c
-+++ b/bus/panelproxy.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2017-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2024 Red Hat, Inc.
-+ * Copyright (C) 2017-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2025 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
-@@ -57,6 +57,7 @@ enum {
- UPDATE_LOOKUP_TABLE_RECEIVED,
- UPDATE_AUXILIARY_TEXT_RECEIVED,
- FORWARD_PROCESS_KEY_EVENT,
-+ SEND_MESSAGE,
- LAST_SIGNAL
- };
-
-@@ -366,6 +367,19 @@ bus_panel_proxy_class_init (BusPanelProxyClass *class)
- g_signal_set_va_marshaller (panel_signals[FORWARD_PROCESS_KEY_EVENT],
- G_TYPE_FROM_CLASS (class),
- bus_marshal_VOID__UINT_UINT_UINTv);
-+
-+ panel_signals[SEND_MESSAGE] =
-+ g_signal_new (I_("send-message"),
-+ G_TYPE_FROM_CLASS (class),
-+ G_SIGNAL_RUN_LAST,
-+ 0,
-+ NULL, NULL,
-+ bus_marshal_VOID__VARIANT,
-+ G_TYPE_NONE, 1,
-+ G_TYPE_VARIANT);
-+ g_signal_set_va_marshaller (panel_signals[SEND_MESSAGE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VARIANTv);
- }
-
- static void
-@@ -551,6 +565,11 @@ bus_panel_proxy_g_signal (GDBusProxy *proxy,
- return;
- }
-
-+ if (g_strcmp0 ("SendMessage", signal_name) == 0) {
-+ g_signal_emit (panel, panel_signals[SEND_MESSAGE], 0, parameters);
-+ return;
-+ }
-+
- /* shound not be reached */
- g_return_if_reached ();
- }
-@@ -1170,3 +1189,17 @@ bus_panel_proxy_candidate_clicked_lookup_table (BusPanelProxy *panel,
- G_DBUS_CALL_FLAGS_NONE,
- -1, NULL, NULL, NULL);
- }
-+
-+void
-+bus_panel_proxy_send_message_received (BusPanelProxy *panel,
-+ GVariant *parameters)
-+{
-+ g_assert (BUS_IS_PANEL_PROXY (panel));
-+ g_assert (parameters);
-+
-+ g_dbus_proxy_call ((GDBusProxy *)panel,
-+ "SendMessageReceived",
-+ g_variant_ref (parameters),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1, NULL, NULL, NULL);
-+}
-diff --git a/bus/panelproxy.h b/bus/panelproxy.h
-index 4d8afb98..ff205cf1 100644
---- a/bus/panelproxy.h
-+++ b/bus/panelproxy.h
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2017-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2025 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
-@@ -155,6 +155,9 @@ void bus_panel_proxy_candidate_clicked_lookup_table
- guint index,
- guint button,
- guint state);
-+void bus_panel_proxy_send_message_received
-+ (BusPanelProxy *panel,
-+ GVariant *parameters);
-
- G_END_DECLS
- #endif
-diff --git a/src/Makefile.am b/src/Makefile.am
-index bef269cb..519fc64e 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -3,8 +3,8 @@
- # 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) 2007-2017 Red Hat, Inc.
-+# Copyright (c) 2015-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2007-2025 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
-@@ -93,6 +93,7 @@ ibus_sources = \
- ibuskeys.c \
- ibuskeyuni.c \
- ibuslookuptable.c \
-+ ibusmessage.c \
- ibusobject.c \
- ibusobservedpath.c \
- ibuspanelservice.c \
-@@ -151,6 +152,7 @@ ibus_headers = \
- ibuskeysyms-compat.h \
- ibuskeysyms.h \
- ibuslookuptable.h \
-+ ibusmessage.h \
- ibusobject.h \
- ibusobservedpath.h \
- ibuspanelservice.h \
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index c7a0ac78..4e13b23d 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -3,7 +3,7 @@
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2018-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2021 Red Hat, Inc.
-+ * Copyright (C) 2008-2025 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
-@@ -302,6 +302,13 @@ static const gchar introspection_xml[] =
- " <signal name='PanelExtension'>"
- " <arg type='v' name='data' />"
- " </signal>"
-+ " <signal name='SendMessage'>"
-+ " <arg type='v' name='message' />"
-+ " <annotation name='org.gtk.GDBus.Since'\n"
-+ " value='1.5.33' />\n"
-+ " <annotation name='org.gtk.GDBus.DocString'\n"
-+ " value='Stability: Unstable' />\n"
-+ " </signal>"
- /* FIXME properties */
- " <property name='ContentType' type='(uu)' access='write' />"
- " <property name='FocusId' type='(b)' access='read' />"
-@@ -1812,12 +1819,17 @@ ibus_engine_emit_signal (IBusEngine *engine,
- const gchar *signal_name,
- GVariant *parameters)
- {
-+ GError *error = NULL;
- ibus_service_emit_signal ((IBusService *)engine,
- NULL,
- IBUS_INTERFACE_ENGINE,
- signal_name,
- parameters,
-- NULL);
-+ &error);
-+ if (error) {
-+ g_warning ("Failed to emit %s signal: %s", signal_name, error->message);
-+ g_error_free (error);
-+ }
- }
-
- static void
-@@ -2199,3 +2211,20 @@ ibus_engine_get_name (IBusEngine *engine)
- g_return_val_if_fail (IBUS_IS_ENGINE (engine), NULL);
- return engine->priv->engine_name;
- }
-+
-+void
-+ibus_engine_send_message (IBusEngine *engine,
-+ IBusMessage *message)
-+{
-+ GVariant *variant;
-+
-+ g_return_if_fail (IBUS_IS_ENGINE (engine));
-+ g_return_if_fail (IBUS_IS_MESSAGE (message));
-+ variant = ibus_serializable_serialize ((IBusSerializable *)message);
-+ ibus_engine_emit_signal (engine,
-+ "SendMessage",
-+ g_variant_new ("(v)", variant));
-+ if (g_object_is_floating (message)) {
-+ g_object_unref (message);
-+ }
-+}
-diff --git a/src/ibusengine.h b/src/ibusengine.h
-index 6af0e856..cdc96331 100644
---- a/src/ibusengine.h
-+++ b/src/ibusengine.h
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2012-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2022 Red Hat, Inc.
-+ * Copyright (C) 2012-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2025 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
-@@ -43,6 +43,7 @@
- #include "ibusservice.h"
- #include "ibusattribute.h"
- #include "ibuslookuptable.h"
-+#include "ibusmessage.h"
- #include "ibusproplist.h"
-
- /*
-@@ -65,6 +66,24 @@
-
- G_BEGIN_DECLS
-
-+/**
-+ * IBusEngineMsgCode:
-+ * @IBUS_ENGINE_MSG_CODE_GENERAL: Generic message for Engine
-+ * @IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE: User's typing failure
-+ * against the definition of the compose files.
-+ *
-+ * Message codes in the `IBusMessageDomain` domain for Engine
-+ * See also #IBusMessage, ibus_engine_send_message()
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+typedef enum
-+{
-+ IBUS_ENGINE_MSG_CODE_GENERAL,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE
-+} IBusEngineMsgCode;
-+
- typedef struct _IBusEngine IBusEngine;
- typedef struct _IBusEngineClass IBusEngineClass;
- typedef struct _IBusEnginePrivate IBusEnginePrivate;
-@@ -469,5 +488,18 @@ void ibus_engine_get_content_type (IBusEngine *engine,
- */
- const gchar *ibus_engine_get_name (IBusEngine *engine);
-
-+/**
-+ * ibus_engine_send_message:
-+ * @engine: An #IBusEngine.
-+ * @message: An #IBusMessage.
-+ *
-+ * Send a message to the Engine for the focus-less notification popup.
-+ * This is used for the user errors in Wayland mainly but in Xorg too.
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+void ibus_engine_send_message (IBusEngine *engine,
-+ IBusMessage *message);
- G_END_DECLS
- #endif
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index e93c61f5..4e0ba40f 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -3,7 +3,7 @@
- /* ibus - The Input Bus
- * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2015-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2014-2017 Red Hat, Inc.
-+ * Copyright (C) 2014-2025 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
-@@ -36,6 +36,7 @@
-
- #include <memory.h>
- #include <stdlib.h>
-+#include <glib/gi18n-lib.h>
-
- #define IBUS_ENGINE_SIMPLE_GET_PRIVATE(o) \
- ((IBusEngineSimplePrivate *)ibus_engine_simple_get_instance_private (o))
-@@ -204,6 +205,27 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple)
- IBUS_OBJECT (simple));
- }
-
-+static void
-+ibus_engine_simple_send_message_with_code (IBusEngineSimple *simple,
-+ IBusEngineMsgCode code)
-+{
-+ IBusMessage *message;
-+
-+ g_return_if_fail (IBUS_IS_ENGINE_SIMPLE (simple));
-+ message = ibus_message_new (
-+ IBUS_MESSAGE_DOMAIN_ENGINE,
-+ code,
-+ _("Detect unregistered character in your compose sequence"),
-+ _("The character you just input is not recognized as a valid " \
-+ "part of the currently active compose sequence and the " \
-+ "character was cancelled. Try inputting the correct character " \
-+ "to the compose sequence again, or press Escape key to " \
-+ "terminate whole the compose sequence."),
-+ "timeout", 5,
-+ NULL);
-+ ibus_engine_send_message (IBUS_ENGINE (simple), message);
-+}
-+
- static void
- ibus_engine_simple_focus_in (IBusEngine *engine)
- {
-@@ -677,7 +699,9 @@ no_sequence_matches (IBusEngineSimple *simple,
- priv->compose_buffer[0] = 0;
- if (n_compose > 1) {
- /* Invalid sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- ibus_engine_simple_update_preedit_text (simple);
- return TRUE;
- }
-@@ -948,7 +972,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- priv->modifiers_dropped = TRUE;
- } else {
- /* invalid hex sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -971,7 +997,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- priv->modifiers_dropped = TRUE;
- } else {
- /* invalid hex sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -1020,7 +1048,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- }
- else if (is_hex_end) {
- /* invalid hex sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -1119,7 +1149,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- else {
- /* invalid hex sequence */
- if (n_compose > 0) {
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
-@@ -1184,7 +1216,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- return TRUE;
- } else if (!is_hex_end) {
- /* non-hex character in hex sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- return TRUE;
- }
- } else if (priv->in_emoji_sequence) {
-@@ -1243,15 +1277,18 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- return TRUE;
- } else {
- /* invalid hex sequence */
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
- }
-+ } else if (!check_hex (simple, n_compose)) {
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- }
-- else if (!check_hex (simple, n_compose))
-- /* FIXME beep_window (event->window); */
-- ;
- ibus_engine_simple_update_preedit_text (simple);
-
- return TRUE;
-@@ -1343,7 +1380,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
-
- n_compose = n_compose_prev;
- g_assert (n_compose < (COMPOSE_BUFFER_SIZE + 1));
-- /* FIXME beep_window (event->window); */
-+ ibus_engine_simple_send_message_with_code (
-+ simple,
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
- backup_char = priv->compose_buffer[n_compose];
- priv->compose_buffer[n_compose] = 0;
- if (ibus_engine_simple_check_all_compose_table (simple, n_compose))
-diff --git a/src/ibusmessage.c b/src/ibusmessage.c
-new file mode 100644
-index 00000000..89e31771
---- /dev/null
-+++ b/src/ibusmessage.c
-@@ -0,0 +1,562 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2025 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
-+ * 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, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-+ * USA
-+ */
-+#include "ibusmessage.h"
-+#include "ibusinternal.h"
-+
-+enum {
-+ LAST_SIGNAL,
-+};
-+
-+enum {
-+ PROP_0 = 0,
-+ PROP_DOMAIN,
-+ PROP_CODE,
-+ PROP_TITLE,
-+ PROP_DESCRIPTION,
-+ PROP_TIMEOUT,
-+ PROP_PROGRESS,
-+ PROP_SERIAL
-+};
-+
-+
-+/* IBusMessagePriv */
-+struct _IBusMessagePrivate {
-+ guchar domain;
-+ guchar code;
-+ gchar *title;
-+ gchar *description;
-+ int timeout;
-+ int progress;
-+ guint serial;
-+};
-+
-+
-+#define ibus_message_get_const_instance_private(self) \
-+ G_STRUCT_MEMBER_P ((self), IBusMessage_private_offset)
-+
-+#define IBUS_MESSAGE_GET_PRIVATE(o) \
-+ ((IBusMessagePrivate *)ibus_message_get_instance_private (o))
-+#define IBUS_MESSAGE_GET_CONST_PRIVATE(o) \
-+ ((const IBusMessagePrivate *)ibus_message_get_const_instance_private (o))
-+
-+#define DEFAULT_TIMEOUT -1
-+#define DEFAULT_PROGRESS -1
-+
-+// static guint _signals[LAST_SIGNAL] = { 0 };
-+
-+/* functions prototype */
-+static void ibus_message_set_property (IBusMessage *msg,
-+ guint prop_id,
-+ const GValue *value,
-+ GParamSpec *pspec);
-+static void ibus_message_get_property (IBusMessage *msg,
-+ guint prop_id,
-+ GValue *value,
-+ GParamSpec *pspec);
-+static void ibus_message_destroy (IBusMessage *msg);
-+static gboolean ibus_message_serialize (IBusMessage *msg,
-+ GVariantBuilder
-+ *builder);
-+static gint ibus_message_deserialize (IBusMessage *msg,
-+ GVariant
-+ *variant);
-+static gboolean ibus_message_copy (IBusMessage *dest,
-+ const IBusMessage *src);
-+
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusMessage,
-+ ibus_message,
-+ IBUS_TYPE_SERIALIZABLE)
-+
-+
-+static void
-+ibus_message_class_init (IBusMessageClass *class)
-+{
-+ GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-+ IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
-+ IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
-+
-+ gobject_class->set_property =
-+ (GObjectSetPropertyFunc)ibus_message_set_property;
-+ gobject_class->get_property =
-+ (GObjectGetPropertyFunc)ibus_message_get_property;
-+ object_class->destroy = (IBusObjectDestroyFunc)ibus_message_destroy;
-+
-+ serializable_class->serialize =
-+ (IBusSerializableSerializeFunc)ibus_message_serialize;
-+ serializable_class->deserialize =
-+ (IBusSerializableDeserializeFunc)ibus_message_deserialize;
-+ serializable_class->copy =
-+ (IBusSerializableCopyFunc)ibus_message_copy;
-+
-+ /* install properties */
-+ /**
-+ * IBusMessage:domain:
-+ *
-+ * The domain of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_DOMAIN,
-+ g_param_spec_uchar ("domain",
-+ "message domain",
-+ "The domain of message",
-+ 0,
-+ G_MAXUINT8,
-+ 0,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:code:
-+ *
-+ * The code of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_CODE,
-+ g_param_spec_uchar ("code",
-+ "message code",
-+ "The code of message",
-+ 0,
-+ G_MAXUINT8,
-+ 0,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:title:
-+ *
-+ * The title of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_TITLE,
-+ g_param_spec_string ("title",
-+ "message title",
-+ "The title of message",
-+ NULL,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:description:
-+ *
-+ * The description of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_DESCRIPTION,
-+ g_param_spec_string ("description",
-+ "message description",
-+ "The description of message",
-+ "",
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:timeout:
-+ *
-+ * The timeout of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_TIMEOUT,
-+ g_param_spec_int ("timeout",
-+ "message timeout",
-+ "The timeout of message",
-+ G_MININT,
-+ G_MAXINT,
-+ DEFAULT_TIMEOUT,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:progress:
-+ *
-+ * The progress of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_PROGRESS,
-+ g_param_spec_int ("progress",
-+ "message progress",
-+ "The progress of message",
-+ G_MININT,
-+ G_MAXINT,
-+ DEFAULT_PROGRESS,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+
-+ /**
-+ * IBusMessage:serial:
-+ *
-+ * The serial of message
-+ */
-+ g_object_class_install_property (gobject_class,
-+ PROP_SERIAL,
-+ g_param_spec_uint ("serial",
-+ "message serial",
-+ "The serial of message",
-+ 0,
-+ G_MAXUINT,
-+ 0,
-+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-+}
-+
-+
-+static void
-+ibus_message_init (IBusMessage *msg)
-+{
-+ IBusMessagePrivate *priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ priv->timeout = DEFAULT_TIMEOUT;
-+ priv->progress = DEFAULT_PROGRESS;
-+}
-+
-+
-+static void
-+ibus_message_destroy (IBusMessage *msg)
-+{
-+ IBusMessagePrivate *priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ g_free (priv->title);
-+ g_free (priv->description);
-+
-+ IBUS_OBJECT_CLASS (ibus_message_parent_class)->destroy (IBUS_OBJECT (msg));
-+}
-+
-+
-+static void
-+ibus_message_set_property (IBusMessage *msg,
-+ guint prop_id,
-+ const GValue *value,
-+ GParamSpec *pspec)
-+{
-+ IBusMessagePrivate *priv;
-+
-+ g_return_if_fail (IBUS_IS_MESSAGE (msg));
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ switch (prop_id) {
-+ case PROP_DOMAIN:
-+ g_assert (priv->domain == 0);
-+ priv->domain = g_value_get_uchar (value);
-+ break;
-+ case PROP_CODE:
-+ g_assert (priv->code == 0);
-+ priv->code = g_value_get_uchar (value);
-+ break;
-+ case PROP_TITLE:
-+ g_assert (priv->title == NULL);
-+ priv->title = g_value_dup_string (value);
-+ break;
-+ case PROP_DESCRIPTION:
-+ g_assert (priv->description == NULL);
-+ priv->description = g_value_dup_string (value);
-+ break;
-+ case PROP_TIMEOUT:
-+ g_assert (priv->timeout == DEFAULT_TIMEOUT);
-+ priv->timeout = g_value_get_int (value);
-+ break;
-+ case PROP_PROGRESS:
-+ g_assert (priv->progress == DEFAULT_PROGRESS);
-+ priv->progress = g_value_get_int (value);
-+ break;
-+ case PROP_SERIAL:
-+ g_assert (priv->serial == 0);
-+ priv->serial = g_value_get_uint (value);
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (msg, prop_id, pspec);
-+ }
-+}
-+
-+
-+static void
-+ibus_message_get_property (IBusMessage *msg,
-+ guint prop_id,
-+ GValue *value,
-+ GParamSpec *pspec)
-+{
-+ switch (prop_id) {
-+ case PROP_DOMAIN: {
-+ int domain = ibus_message_get_domain (msg);
-+ g_assert (domain > 0 && domain <= G_MAXUINT8);
-+ g_value_set_uchar (value, (guchar)domain);
-+ }
-+ break;
-+ case PROP_CODE: {
-+ int code = ibus_message_get_code (msg);
-+ g_assert (code >= 0 && code <= G_MAXUINT8);
-+ g_value_set_uchar (value, (guchar)code);
-+ }
-+ break;
-+ case PROP_TITLE:
-+ g_value_set_string (value, ibus_message_get_title (msg));
-+ break;
-+ case PROP_DESCRIPTION:
-+ g_value_set_string (value, ibus_message_get_description (msg));
-+ break;
-+ case PROP_TIMEOUT:
-+ g_value_set_int (value, ibus_message_get_timeout (msg));
-+ break;
-+ case PROP_PROGRESS:
-+ g_value_set_int (value, ibus_message_get_progress (msg));
-+ break;
-+ case PROP_SERIAL:
-+ g_value_set_uint (value, ibus_message_get_serial (msg));
-+ break;
-+ default:
-+ G_OBJECT_WARN_INVALID_PROPERTY_ID (msg, prop_id, pspec);
-+ }
-+}
-+
-+
-+static gboolean
-+ibus_message_serialize (IBusMessage *msg,
-+ GVariantBuilder *builder)
-+{
-+ gboolean retval;
-+ IBusMessagePrivate *priv;
-+
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_message_parent_class)->
-+ serialize ((IBusSerializable *)msg, builder);
-+ g_return_val_if_fail (retval, FALSE);
-+ /* End dict iter */
-+
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (msg), FALSE);
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+
-+#define NOTNULL(s) ((s) != NULL ? (s) : "")
-+ /* If you will add a new property, you can append it at the end and
-+ * you should not change the serialized order of domain, code,
-+ * title, .... */
-+ g_variant_builder_add (builder, "y", priv->domain);
-+ g_variant_builder_add (builder, "y", priv->code);
-+ g_variant_builder_add (builder, "s", NOTNULL (priv->title));
-+ g_variant_builder_add (builder, "s", NOTNULL (priv->description));
-+ g_variant_builder_add (builder, "i", priv->timeout);
-+ g_variant_builder_add (builder, "i", priv->progress);
-+ g_variant_builder_add (builder, "u", priv->serial);
-+ /* The serialized order should be kept. */
-+#undef NOTNULL
-+
-+ return TRUE;
-+}
-+
-+
-+static gint
-+ibus_message_deserialize (IBusMessage *msg,
-+ GVariant *variant)
-+{
-+ gint retval;
-+ IBusMessagePrivate *priv;
-+
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_message_parent_class)->
-+ deserialize ((IBusSerializable *)msg, variant);
-+ g_return_val_if_fail (retval, 0);
-+
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (msg), retval);
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+
-+ /* If you will add a new property, you can append it at the end and
-+ * you should not change the serialized order of domain, code,
-+ * title, .... */
-+ g_variant_get_child (variant, retval++, "y", &priv->domain);
-+ g_variant_get_child (variant, retval++, "y", &priv->code);
-+ ibus_g_variant_get_child_string (variant, retval++,
-+ &priv->title);
-+ ibus_g_variant_get_child_string (variant, retval++,
-+ &priv->description);
-+ g_variant_get_child (variant, retval++, "i", &priv->timeout);
-+ g_variant_get_child (variant, retval++, "i", &priv->progress);
-+ g_variant_get_child (variant, retval++, "u", &priv->serial);
-+ /* The serialized order should be kept. */
-+ return retval;
-+}
-+
-+
-+static gboolean
-+ibus_message_copy (IBusMessage *dest,
-+ const IBusMessage *src)
-+{
-+ gboolean retval;
-+ IBusMessagePrivate *priv_dest;
-+ const IBusMessagePrivate *priv_src;
-+
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_message_parent_class)->
-+ copy ((IBusSerializable *)dest, (IBusSerializable *)src);
-+ g_return_val_if_fail (retval, FALSE);
-+
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (dest), FALSE);
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (src), FALSE);
-+ priv_dest = IBUS_MESSAGE_GET_PRIVATE (dest);
-+ priv_src = IBUS_MESSAGE_GET_CONST_PRIVATE (src);
-+
-+ priv_dest->domain = priv_src->domain;
-+ priv_dest->code = priv_src->code;
-+ priv_dest->title = g_strdup (priv_src->title);
-+ priv_dest->description = g_strdup (priv_src->description);
-+ priv_dest->timeout = priv_src->timeout;
-+ priv_dest->progress = priv_src->progress;
-+ priv_dest->serial = priv_src->serial;
-+ return TRUE;
-+}
-+
-+
-+guint
-+ibus_message_get_domain (IBusMessage *msg)
-+{
-+ IBusMessagePrivate *priv;
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (msg), 0);
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ return (guint)priv->domain;
-+}
-+
-+
-+guint
-+ibus_message_get_code (IBusMessage *msg)
-+{
-+ IBusMessagePrivate *priv;
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (msg), 0);
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ return (guint)priv->code;
-+}
-+
-+
-+#define IBUS_MESSAGE_GET_PROPERTY(property, return_type, defval) \
-+return_type \
-+ibus_message_get_ ## property (IBusMessage *msg) \
-+{ \
-+ IBusMessagePrivate *priv; \
-+ g_return_val_if_fail (IBUS_IS_MESSAGE (msg), (defval)); \
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg); \
-+ return priv->property; \
-+}
-+
-+IBUS_MESSAGE_GET_PROPERTY (title, const gchar *, NULL)
-+IBUS_MESSAGE_GET_PROPERTY (description, const gchar *, NULL)
-+IBUS_MESSAGE_GET_PROPERTY (timeout, int, DEFAULT_TIMEOUT)
-+IBUS_MESSAGE_GET_PROPERTY (progress, int, DEFAULT_PROGRESS)
-+IBUS_MESSAGE_GET_PROPERTY (serial, guint32, 0)
-+#undef IBUS_MESSAGE_GET_PROPERTY
-+
-+
-+IBusMessage *
-+ibus_message_new (guint domain,
-+ guint code,
-+ const gchar *title,
-+ const gchar *description,
-+ ...)
-+{
-+ va_list var_args;
-+ gchar *prop;
-+ gchar **names, **names_tmp;
-+ GValue *values, *values_tmp;
-+ guint n_properties = 4, i;
-+ IBusMessage *msg;
-+ IBusMessagePrivate *priv;
-+
-+ g_return_val_if_fail (domain > 0 && domain <= G_MAXUINT8, NULL);
-+ g_return_val_if_fail (code <= G_MAXUINT8, NULL);
-+ g_return_val_if_fail (description, NULL);
-+ g_return_val_if_fail (*description != '\0', NULL);
-+
-+ if (!(names = g_new0 (gchar *, n_properties))) {
-+ g_warning ("allocation error in %s", G_STRFUNC);
-+ return NULL;
-+ }
-+ if (!(values = g_new0 (GValue, n_properties))) {
-+ g_warning ("allocation error in %s", G_STRFUNC);
-+ return NULL;
-+ }
-+
-+ names[0] = "domain";
-+ g_value_init (&values[0], G_TYPE_UCHAR);
-+ g_value_set_uchar (&values[0], domain);
-+ names[1] = "code";
-+ g_value_init (&values[1], G_TYPE_UCHAR);
-+ g_value_set_uchar (&values[1], code);
-+ names[2] = "title";
-+ g_value_init (&values[2], G_TYPE_STRING);
-+ g_value_set_string (&values[2], title);
-+ names[3] = "description";
-+ g_value_init (&values[3], G_TYPE_STRING);
-+ g_value_set_string (&values[3], description);
-+
-+#define IF_PROPERTY_IS_MATCHED(property, gtype, ctype) \
-+ if (!g_strcmp0 (prop, #property)) { \
-+ if (!(names_tmp = g_renew (gchar *, names, n_properties + 1))) { \
-+ g_warning ("allocation error in %s", G_STRFUNC); \
-+ va_end (var_args); \
-+ g_free (names); \
-+ for (i = 0; i <= n_properties; i++) \
-+ g_value_unset (&values[i]); \
-+ g_free (values); \
-+ return NULL; \
-+ } \
-+ names = names_tmp; \
-+ names[n_properties] = prop; \
-+ if (!(values_tmp = g_renew (GValue, values, n_properties + 1))) { \
-+ g_warning ("allocation error in %s", G_STRFUNC); \
-+ va_end (var_args); \
-+ g_free (names); \
-+ for (i = 0; i < n_properties; i++) \
-+ g_value_unset (&values[i]); \
-+ g_free (values); \
-+ return NULL; \
-+ } \
-+ values = values_tmp; \
-+ memset (&values[n_properties], 0, sizeof (GValue)); \
-+ g_value_init (&values[n_properties], (gtype)); \
-+ g_value_set_## ctype (&values[n_properties], \
-+ va_arg (var_args, g ## ctype)); \
-+ }
-+
-+ va_start (var_args, description);
-+ while ((prop = va_arg (var_args, gchar *))) {
-+ IF_PROPERTY_IS_MATCHED (timeout, G_TYPE_INT, int)
-+ else IF_PROPERTY_IS_MATCHED (progress, G_TYPE_INT, int)
-+ else IF_PROPERTY_IS_MATCHED (serial, G_TYPE_UINT, uint)
-+ else {
-+ g_warning ("wrong parameter %s in %s", prop, G_STRFUNC);
-+ for (i = 0; i < n_properties; i++)
-+ g_value_unset (&values[i]);
-+ g_free (values);
-+ g_free (names);
-+ va_end (var_args);
-+ return NULL;
-+ }
-+ n_properties++;
-+ }
-+ va_end (var_args);
-+
-+#undef IF_PROPERTY_IS_MATCHED
-+
-+ msg = (IBusMessage *)g_object_new_with_properties (IBUS_TYPE_MESSAGE,
-+ n_properties,
-+ (const gchar **)names,
-+ (const GValue*)values);
-+
-+
-+ for (i = 0; i < n_properties; i++)
-+ g_value_unset (&values[i]);
-+ g_free (values);
-+ g_free (names);
-+ if (!IBUS_IS_MESSAGE (msg)) {
-+ g_warning ("msg is not IBusMessage in %s", G_STRFUNC);
-+ return NULL;
-+ }
-+ priv = IBUS_MESSAGE_GET_PRIVATE (msg);
-+ /* name is required. Other properties are set in class_init by default. */
-+ g_assert (priv->domain > 0 && priv->domain <= G_MAXUINT8);
-+ g_assert (priv->code <= G_MAXUINT8);
-+ g_assert (priv->description);
-+ g_assert (*(priv->description) != '\0');
-+
-+ return msg;
-+}
-diff --git a/src/ibusmessage.h b/src/ibusmessage.h
-new file mode 100644
-index 00000000..0ab58b80
---- /dev/null
-+++ b/src/ibusmessage.h
-@@ -0,0 +1,205 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* bus - The Input Bus
-+ * Copyright (C) 2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2025 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
-+ * 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, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-+ * USA
-+ */
-+
-+#if !defined (__IBUS_H_INSIDE__) && !defined (IBUS_COMPILATION)
-+#error "Only <ibus.h> can be included directly"
-+#endif
-+
-+#ifndef __IBUS_MESSAGE_H_
-+#define __IBUS_MESSAGE_H_
-+
-+/**
-+ * SECTION: ibusmessage
-+ * @short_description: Message data which is forwarded to IBus Panel.
-+ * @title: IBusMessage
-+ * @stability: Unstable
-+ *
-+ * An IBusMessage stores the message type, description, timeout.
-+ * The message data can generated by ibus_message_new(),
-+ *
-+ * see_also: #IBusEngine, #IBuPanels
-+ *
-+ */
-+
-+#include "ibusserializable.h"
-+
-+/*
-+ * Type macros.
-+ */
-+
-+/* define GOBJECT macros */
-+#define IBUS_TYPE_MESSAGE \
-+ (ibus_message_get_type ())
-+#define IBUS_MESSAGE(obj) \
-+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), IBUS_TYPE_MESSAGE, IBusMessage))
-+#define IBUS_MESSAGE_CLASS(klass) \
-+ (G_TYPE_CHECK_CLASS_CAST ((klass), IBUS_TYPE_MESSAGE, IBusMessageClass))
-+#define IBUS_IS_MESSAGE(obj) \
-+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_MESSAGE))
-+#define IBUS_IS_MESSAGE_CLASS(klass) \
-+ (G_TYPE_CHECK_CLASS_TYPE ((klass), IBUS_TYPE_MESSAGE))
-+#define IBUS_MESSAGE_GET_CLASS(obj) \
-+ (G_TYPE_INSTANCE_GET_CLASS ((obj), IBUS_TYPE_MESSAGE, IBusMessageClass))
-+
-+G_BEGIN_DECLS
-+
-+typedef struct _IBusMessage IBusMessage;
-+typedef struct _IBusMessagePrivate IBusMessagePrivate;
-+typedef struct _IBusMessageClass IBusMessageClass;
-+
-+/**
-+ * IBusMessage:
-+ *
-+ * Message data which is forwarded to IBus Panel.
-+ * You can get values with g_object_get_properties.
-+ *
-+ * Since: 1.5.33
-+ */
-+struct _IBusMessage {
-+ IBusSerializable parent;
-+ /* instance members */
-+
-+ /*< public >*/
-+ /*< private >*/
-+ IBusMessagePrivate *priv;
-+};
-+
-+struct _IBusMessageClass {
-+ IBusSerializableClass parent;
-+ /* class members */
-+
-+ /*< private >*/
-+ /* padding */
-+ gpointer pdummy[5]; // We can add 5 pointers without breaking the ABI.
-+};
-+
-+GType ibus_message_get_type (void);
-+
-+/**
-+ * ibus_message_new:
-+ * @domain: the message domain with @IBusMessageDomain likes #GError.
-+ * @code: the message code with @IBusPanelServiceMsgCode likes #GError.
-+ * @title: the message title.
-+ * @description: the message description.
-+ * @...: the NULL-terminated arguments of the properties and values.
-+ *
-+ * Creates a new #IBusMessage.
-+ * You can give additional parameters to the API. E.g.
-+ * ibus_message_new(IBUS_MESSAGE_DOMAIN_PANEL,
-+ * IBUS_PANEL_SERVICE_MSG_CODE_LOADING_UNICODE, "IBus Emoji utility",
-+ * "Loading a Unicode dictionary", "timeout", 10, "progress", 30, NULL)
-+ *
-+ * Returns: A newly allocated IBusMessage.
-+ *
-+ * Since: 1.5.33
-+ */
-+IBusMessage *ibus_message_new (guint domain,
-+ guint code,
-+ const gchar *title,
-+ const gchar *description,
-+ ...) G_GNUC_NULL_TERMINATED;
-+
-+/**
-+ * ibus_message_get_domain:
-+ * @msg: An #IBusMessage.
-+ *
-+ * Gets the domain property in #IBusMessage.
-+ *
-+ * Returns: domain property in #IBusMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+guint ibus_message_get_domain (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_code:
-+ * @msg: An #IBusMessage.
-+ *
-+ * Gets the code property in #IBusMessage.
-+ *
-+ * Returns: code property in #IBusMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+guint ibus_message_get_code (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_title:
-+ * @msg: An #IBuMessages.
-+ *
-+ * Gets the title property in #IBusMessage. It should not be freed.
-+ *
-+ * Returns: title property in #IBuaMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+const gchar *ibus_message_get_title (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_description:
-+ * @msg: An #IBuMessages.
-+ *
-+ * Gets the description property in #IBusMessage. It should not be freed.
-+ *
-+ * Returns: description property in #IBuaMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+const gchar *ibus_message_get_description (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_timeout:
-+ * @msg: An #IBusMessage.
-+ *
-+ * Gets the timeout property in #IBusMessage.
-+ *
-+ * Returns: timeout property in #IBusMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+int ibus_message_get_timeout (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_progress:
-+ * @msg: An #IBusMessage.
-+ *
-+ * Gets the progress property in #IBusMessage.
-+ *
-+ * Returns: progress property in #IBusMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+int ibus_message_get_progress (IBusMessage *msg);
-+
-+/**
-+ * ibus_message_get_serial:
-+ * @msg: An #IBusMessage.
-+ *
-+ * Gets the serial property in #IBusMessage.
-+ *
-+ * Returns: serial property in #IBusMessage
-+ *
-+ * Since: 1.5.33
-+ */
-+guint ibus_message_get_serial (IBusMessage *msg);
-+G_END_DECLS
-+#endif
-diff --git a/src/ibuspanelservice.c b/src/ibuspanelservice.c
-index 80637ca2..9e3939d0 100644
---- a/src/ibuspanelservice.c
-+++ b/src/ibuspanelservice.c
-@@ -3,7 +3,7 @@
- /* ibus - The Input Bus
- * Copyright (c) 2009-2014 Google Inc. All rights reserved.
- * Copyright (C) 2010-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2017-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2017-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
-@@ -60,6 +60,7 @@ enum {
- PROCESS_KEY_EVENT,
- COMMIT_TEXT_RECEIVED,
- CANDIDATE_CLICKED_LOOKUP_TABLE,
-+ SEND_MESSAGE_RECEIVED,
- LAST_SIGNAL,
- };
-
-@@ -240,6 +241,13 @@ static const gchar introspection_xml[] =
- " <method name='CommitTextReceived'>"
- " <arg direction='in' type='v' name='text' />"
- " </method>"
-+ " <method name='SendMessageReceived'>"
-+ " <arg direction='in' type='v' name='message' />"
-+ " <annotation name='org.gtk.GDBus.Since'\n"
-+ " value='1.5.33' />\n"
-+ " <annotation name='org.gtk.GDBus.DocString'\n"
-+ " value='Stability: Unstable' />\n"
-+ " </method>"
- /* Signals */
- " <signal name='CursorUp' />"
- " <signal name='CursorDown' />"
-@@ -266,9 +274,9 @@ static const gchar introspection_xml[] =
- " <signal name='PanelExtension'>"
- " <arg type='v' name='event' />"
- " </signal>"
-- " <method name='PanelExtensionRegisterKeys'>"
-+ " <signal name='PanelExtensionRegisterKeys'>"
- " <arg type='v' name='data' />"
-- " </method>"
-+ " </signal>"
- " <signal name='UpdatePreeditTextReceived'>"
- " <arg type='v' name='text' />"
- " <arg type='u' name='cursor_pos' />"
-@@ -286,6 +294,17 @@ static const gchar introspection_xml[] =
- " <arg type='u' name='keyval' />"
- " <arg type='u' name='keycode' />"
- " <arg type='u' name='state' />"
-+ " <annotation name='org.gtk.GDBus.Since'\n"
-+ " value='1.5.32' />\n"
-+ " <annotation name='org.gtk.GDBus.DocString'\n"
-+ " value='Stability: Unstable' />\n"
-+ " </signal>"
-+ " <signal name='SendMessage'>"
-+ " <arg type='v' name='message' />"
-+ " <annotation name='org.gtk.GDBus.Since'\n"
-+ " value='1.5.33' />\n"
-+ " <annotation name='org.gtk.GDBus.DocString'\n"
-+ " value='Stability: Unstable' />\n"
- " </signal>"
- " </interface>"
- "</node>";
-@@ -1006,7 +1025,7 @@ ibus_panel_service_class_init (IBusPanelServiceClass *class)
- /**
- * IBusPanelService::commit-text-received:
- * @panel: An #IBusPanelService
-- * @text: A #IBusText
-+ * @text: An #IBusText
- *
- * Emitted when the client application get the ::commit-text-received.
- * Implement the member function
-@@ -1027,6 +1046,20 @@ ibus_panel_service_class_init (IBusPanelServiceClass *class)
- 1,
- IBUS_TYPE_TEXT);
-
-+ /**
-+ * IBusPanelService::candidate-clicked-lookup-table:
-+ * @panel: An #IBusPanelService
-+ * @text: An #IBusText
-+ *
-+ * Emitted when the client application get the
-+ * ::candidate-clicked-lookup-table.
-+ * Implement the member function
-+ * IBusPanelServiceClass::candidate_cllicked_lookup_table in extended class
-+ * to receive this signal.
-+ *
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
-+ */
- panel_signals[CANDIDATE_CLICKED_LOOKUP_TABLE] =
- g_signal_new (I_("candidate-clicked-lookup-table"),
- G_TYPE_FROM_CLASS (gobject_class),
-@@ -1040,6 +1073,31 @@ ibus_panel_service_class_init (IBusPanelServiceClass *class)
- G_TYPE_UINT,
- G_TYPE_UINT,
- G_TYPE_UINT);
-+
-+ /**
-+ * IBusPanelService::send-message-received:
-+ * @panel: An #IBusPanelService
-+ * @message: An #IBusMessage
-+ *
-+ * Emitted when the client application get the ::send-meeeage-received.
-+ * Implement the member function
-+ *
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+ panel_signals[SEND_MESSAGE_RECEIVED] =
-+ g_signal_new (I_("send-message-received"),
-+ G_TYPE_FROM_CLASS (gobject_class),
-+ G_SIGNAL_RUN_LAST,
-+ 0,
-+ NULL, NULL,
-+ _ibus_marshal_VOID__OBJECT,
-+ G_TYPE_NONE,
-+ 1,
-+ IBUS_TYPE_MESSAGE);
- }
-
- static void
-@@ -1310,6 +1368,26 @@ ibus_panel_service_service_method_call (IBusService *service,
- index, button, state);
- return;
- }
-+ if (g_strcmp0 (method_name, "SendMessageReceived") == 0) {
-+ GVariant *arg0 = NULL;
-+ IBusMessage *message = NULL;
-+ g_variant_get (parameters, "(v)", &arg0);
-+ if (arg0) {
-+ message = (IBusMessage *)ibus_serializable_deserialize (arg0);
-+ g_variant_unref (arg0);
-+ }
-+ if (!message) {
-+ g_dbus_method_invocation_return_error (
-+ invocation,
-+ G_DBUS_ERROR,
-+ G_DBUS_ERROR_FAILED,
-+ "SendMessageReceived method gives NULL");
-+ return;
-+ }
-+ g_signal_emit (panel, panel_signals[SEND_MESSAGE_RECEIVED], 0, message);
-+ _g_object_unref_if_floating (message);
-+ return;
-+ }
-
-
- const static struct {
-@@ -1510,7 +1588,7 @@ ibus_panel_service_candidate_clicked (IBusPanelService *panel,
- guint state)
- {
- g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "CandidateClicked",
-@@ -1524,7 +1602,7 @@ ibus_panel_service_property_activate (IBusPanelService *panel,
- guint prop_state)
- {
- g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "PropertyActivate",
-@@ -1537,7 +1615,7 @@ ibus_panel_service_property_show (IBusPanelService *panel,
- const gchar *prop_name)
- {
- g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "PropertyShow",
-@@ -1550,7 +1628,7 @@ ibus_panel_service_property_hide (IBusPanelService *panel,
- const gchar *prop_name)
- {
- g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "PropertyHide",
-@@ -1567,7 +1645,7 @@ ibus_panel_service_commit_text (IBusPanelService *panel,
- g_return_if_fail (IBUS_IS_TEXT (text));
-
- variant = ibus_serializable_serialize ((IBusSerializable *)text);
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "CommitText",
-@@ -1588,7 +1666,7 @@ ibus_panel_service_panel_extension (IBusPanelService *panel,
- g_return_if_fail (IBUS_IS_EXTENSION_EVENT (event));
-
- variant = ibus_serializable_serialize ((IBusSerializable *)event);
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "PanelExtension",
-@@ -1662,7 +1740,7 @@ ibus_panel_service_update_preedit_text_received (IBusPanelService *panel,
-
- variant = ibus_serializable_serialize ((IBusSerializable *)text);
- g_return_if_fail (variant);
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "UpdatePreeditTextReceived",
-@@ -1686,7 +1764,7 @@ ibus_panel_service_update_auxiliary_text_received (IBusPanelService *panel,
-
- variant = ibus_serializable_serialize ((IBusSerializable *)text);
- g_return_if_fail (variant);
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "UpdateAuxiliaryTextReceived",
-@@ -1711,7 +1789,7 @@ ibus_panel_service_update_lookup_table_received (IBusPanelService *panel,
-
- variant = ibus_serializable_serialize ((IBusSerializable *)table);
- g_return_if_fail (variant);
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "UpdateLookupTableReceived",
-@@ -1731,7 +1809,7 @@ ibus_panel_service_forward_process_key_event (IBusPanelService *panel,
- guint32 state)
- {
- g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-- ibus_service_emit_signal ((IBusService *) panel,
-+ ibus_service_emit_signal ((IBusService *)panel,
- NULL,
- IBUS_INTERFACE_PANEL,
- "ForwardProcessKeyEvent",
-@@ -1740,6 +1818,28 @@ ibus_panel_service_forward_process_key_event (IBusPanelService *panel,
- NULL);
- }
-
-+void
-+ibus_panel_service_send_message (IBusPanelService *panel,
-+ IBusMessage *message)
-+{
-+ GVariant *variant;
-+ GError *error = NULL;
-+
-+ g_return_if_fail (IBUS_IS_PANEL_SERVICE (panel));
-+ g_return_if_fail (IBUS_IS_MESSAGE (message));
-+ variant = ibus_serializable_serialize ((IBusSerializable *)message);
-+ ibus_service_emit_signal ((IBusService *)panel,
-+ NULL,
-+ IBUS_INTERFACE_PANEL,
-+ "SendMessage",
-+ g_variant_new ("(v)", variant),
-+ &error);
-+ if (error) {
-+ g_warning ("Error in %s: %s", G_STRFUNC, error->message);
-+ g_error_free (error);
-+ }
-+}
-+
- #define DEFINE_FUNC(name, Name) \
- void \
- ibus_panel_service_##name (IBusPanelService *panel) \
-diff --git a/src/ibuspanelservice.h b/src/ibuspanelservice.h
-index 64efca55..57045956 100644
---- a/src/ibuspanelservice.h
-+++ b/src/ibuspanelservice.h
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (c) 2009-2014 Google Inc. All rights reserved.
-- * Copyright (c) 2017-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (c) 2017-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
-@@ -36,6 +36,7 @@
- * Developers can "extend" this class for panel UI development.
- */
- #include "ibuslookuptable.h"
-+#include "ibusmessage.h"
- #include "ibusservice.h"
- #include "ibusproplist.h"
- #include "ibusxevent.h"
-@@ -60,6 +61,24 @@
-
- G_BEGIN_DECLS
-
-+/**
-+ * IBusPanelServiceMsgCode:
-+ * @IBUS_PANEL_SERVICE_MSG_CODE_GENERAL: Generic message for Panel
-+ * @IBUS_PANEL_SERVICE_MSG_CODE_LOADING_UNICODE: Progress message when the
-+ * Unicode data is loading.
-+ *
-+ * Message codes in the `IBusMessageDomain` domain for Panel.
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+typedef enum
-+{
-+ IBUS_PANEL_SERVICE_MSG_CODE_GENERAL,
-+ IBUS_PANEL_SERVICE_MSG_CODE_LOADING_UNICODE
-+} IBusPanelServiceMsgCode;
-+
-+
- typedef struct _IBusPanelService IBusPanelService;
- typedef struct _IBusPanelServiceClass IBusPanelServiceClass;
-
-@@ -372,11 +391,28 @@ void ibus_panel_service_update_lookup_table_received
- *
- * Forward key events when an IBus popup takes the focus and the events
- * needs to be forwared to the target IBus engine.
-+ *
-+ * Since: 1.5.32
-+ * Stability: Unstable
- */
- void ibus_panel_service_forward_process_key_event
- (IBusPanelService *panel,
- guint32 keyval,
- guint32 keycode,
- guint32 state);
-+
-+/**
-+ * ibus_panel_service_send_message:
-+ * @panel: An #IBusPanelService.
-+ * @message: An #IBusMessage.
-+ *
-+ * Send a message to the Panel for the focus-less notification popup.
-+ * This is used for the emoji component in Wayland mainly but in Xorg too.
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+void ibus_panel_service_send_message (IBusPanelService *panel,
-+ IBusMessage *message);
- G_END_DECLS
- #endif
-diff --git a/src/ibustypes.h b/src/ibustypes.h
-index c8dfb89a..1243b2bc 100644
---- a/src/ibustypes.h
-+++ b/src/ibustypes.h
-@@ -358,5 +358,19 @@ typedef enum
- IBUS_SUPER_MASK | \
- IBUS_HYPER_MASK | \
- IBUS_META_MASK))
-+/**
-+ * IBusMessageDomain:
-+ * @IBUS_MESSAGE_ENGINE: The message domain for Engine messages
-+ * @IBUS_MESSAGE_PANEL: The message domain for Panel messages
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+typedef enum
-+{
-+ IBUS_MESSAGE_DOMAIN_NONE,
-+ IBUS_MESSAGE_DOMAIN_ENGINE,
-+ IBUS_MESSAGE_DOMAIN_PANEL
-+} IBusMessageDomain;
-
- #endif
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index 4cc10780..d99d8e82 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -97,6 +97,7 @@ ibus_ui_gtk3_SOURCES = \
- handle.vala \
- iconwidget.vala \
- keybindingmanager.vala \
-+ message.vala \
- panel.vala \
- pango.vala \
- property.vala \
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index 1770de2f..2d8754a4 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -2,7 +2,7 @@
- *
- * ibus - The Input Bus
- *
-- * Copyright (c) 2017-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (c) 2017-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
-@@ -312,6 +312,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- private uint m_unicode_progress_id;
- private Gtk.Label m_unicode_percent_label;
- private double m_unicode_percent;
-+ private ulong m_unicode_deserialize_unicode_signal_id;
- private Gdk.Rectangle m_cursor_location;
- private bool m_is_up_side_down = false;
- private uint m_redraw_window_id;
-@@ -321,6 +322,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- public signal void candidate_clicked(uint index, uint button, uint state);
- public signal void commit_text(string text);
- public signal void cancel();
-+ public signal void send_message(IBus.Message message);
-
- public IBusEmojier(bool is_wayland) {
- GLib.Object(
-@@ -1178,9 +1180,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- hbox.pack_start(m_unicode_percent_label, false, true, 0);
- hbox.show_all();
-
-- m_unicode_progress_object.deserialize_unicode.connect((i, n) => {
-- m_unicode_percent = (double)i / n;
-- });
-+ if (m_unicode_deserialize_unicode_signal_id == 0) {
-+ m_unicode_deserialize_unicode_signal_id =
-+ m_unicode_progress_object.deserialize_unicode.connect(
-+ (i, n) => {
-+ m_unicode_percent = (double)i / n;
-+ });
-+ }
- if (m_unicode_progress_id > 0) {
- GLib.Source.remove(m_unicode_progress_id);
- }
-@@ -1199,6 +1205,18 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- }
-
-
-+ private void show_unicode_popup(int progress) {
-+ var message = new IBus.Message(IBus.MessageDomain.PANEL,
-+ IBus.PanelServiceMsgCode.LOADING_UNICODE,
-+ _("IBus Emoji initialization"),
-+ _("Loading a Unicode dictionary:"),
-+ "timeout", 3,
-+ "progress", progress,
-+ "serial", 50001);
-+ send_message(message);
-+ }
-+
-+
- private static string? check_unicode_point(string annotation) {
- string unicode_point = null;
- // Add "0x" because uint64.ascii_strtoull() is not accessible
-@@ -1232,7 +1250,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- }
-
-
-- private static GLib.SList<string>?
-+ private GLib.SList<string>?
- lookup_emojis_from_annotation(string annotation) {
- GLib.SList<string>? total_emojis = null;
- unowned GLib.SList<string>? sub_emojis = null;
-@@ -1310,6 +1328,17 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- }
- }
- }
-+ if (!m_loaded_unicode && m_unicode_deserialize_unicode_signal_id == 0) {
-+ m_unicode_deserialize_unicode_signal_id =
-+ m_unicode_progress_object.deserialize_unicode.connect(
-+ (i, n) => {
-+ m_unicode_percent = (double)i / n;
-+ show_unicode_popup(
-+ (int)(m_unicode_percent * 100));
-+ });
-+ }
-+ if (!m_loaded_unicode)
-+ show_unicode_popup(0);
- return total_emojis;
- }
-
-diff --git a/ui/gtk3/message.vala b/ui/gtk3/message.vala
-new file mode 100644
-index 00000000..0c7dd478
---- /dev/null
-+++ b/ui/gtk3/message.vala
-@@ -0,0 +1,353 @@
-+/* vim:set et sts=4 sw=4:
-+ *
-+ * ibus - The Input Bus
-+ *
-+ * Copyright(c) 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, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-+ * USA
-+ */
-+
-+public class MessageDialog : Gtk.Box{
-+ private Gtk.Window m_toplevel;
-+ private Gtk.Box m_vbox;
-+ private Gtk.Box m_hbox;
-+ private Gtk.Label m_title_label;
-+ private Gtk.Label m_description_label;
-+ private Gtk.ProgressBar m_progress_bar;
-+ private Gtk.Label m_progress_label;
-+ private Gtk.Label m_timeout_label;
-+ private Gtk.Button m_button;
-+ private int m_timeout_time;
-+ private int m_elapsed_time;
-+ private uint m_timeout_id;
-+
-+ private Gdk.Rectangle m_cursor_location;
-+
-+ private bool m_is_wayland;
-+ private bool m_no_wayland_panel;
-+
-+#if USE_GDK_WAYLAND
-+ private bool m_hide_after_show;
-+#endif
-+
-+ public signal void close();
-+
-+#if USE_GDK_WAYLAND
-+ public signal void realize_surface(void *surface);
-+#endif
-+
-+ public MessageDialog (bool is_wayland,
-+ bool no_wayland_panel,
-+ IBus.Message message) {
-+ // Call base class constructor
-+ GLib.Object(
-+ name : "IBusMessageDialog",
-+ orientation: Gtk.Orientation.HORIZONTAL,
-+ visible: true
-+ );
-+
-+ m_is_wayland = is_wayland;
-+ m_no_wayland_panel = no_wayland_panel;
-+ m_toplevel = new Gtk.Window(Gtk.WindowType.POPUP);
-+ m_toplevel.add_events(Gdk.EventMask.BUTTON_PRESS_MASK);
-+ m_toplevel.size_allocate.connect((w, a) => {
-+ adjust_window_position(w);
-+ });
-+#if USE_GDK_WAYLAND
-+ if (m_is_wayland) {
-+ m_toplevel.realize.connect((w) => {
-+ realize_window(true);
-+ });
-+ m_toplevel.show.connect((w) => {
-+ if (m_hide_after_show)
-+ realize_window(false);
-+ m_hide_after_show = false;
-+ });
-+ m_toplevel.hide.connect((w) => {
-+ m_hide_after_show = true;
-+ });
-+ }
-+#endif
-+
-+ m_vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
-+ m_vbox.set_visible(true);
-+ pack_start(m_vbox, false, false, 0);
-+
-+ m_toplevel.add(this);
-+
-+ create_ui(message);
-+ }
-+
-+ public void set_cursor_location(int x, int y, int width, int height) {
-+ Gdk.Rectangle location = Gdk.Rectangle(){
-+ x = x, y = y, width = width, height = height };
-+ if (m_cursor_location == location)
-+ return;
-+ m_cursor_location = location;
-+
-+ /* Do not call adjust_window_position() here because
-+ * m_toplevel is not shown yet and
-+ * m_toplevel.get_allocation() returns height = width = 1 */
-+ }
-+
-+ private void create_ui(IBus.Message message) {
-+ string? title = message.get_title();
-+ string description = message.get_description();
-+
-+ if (title.length > 0) {
-+ m_title_label = new Gtk.Label(title);
-+ } else {
-+ m_title_label = new Gtk.Label(null);
-+ m_title_label.set_no_show_all(true);
-+ }
-+ m_title_label.set_halign(Gtk.Align.CENTER);
-+ m_title_label.set_valign(Gtk.Align.CENTER);
-+ m_title_label.set_margin_start(8);
-+ m_title_label.set_margin_end(8);
-+ m_title_label.set_line_wrap(true);
-+ m_title_label.set_width_chars(50);
-+
-+ m_description_label = new Gtk.Label(description);
-+ m_description_label.set_halign(Gtk.Align.START);
-+ m_description_label.set_valign(Gtk.Align.CENTER);
-+ m_description_label.set_margin_start(8);
-+ m_description_label.set_margin_end(8);
-+ m_description_label.set_line_wrap(true);
-+ m_description_label.set_width_chars(50);
-+
-+ m_hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 5);
-+ m_hbox.set_halign(Gtk.Align.CENTER);
-+ m_hbox.set_valign(Gtk.Align.CENTER);
-+ m_progress_bar = new Gtk.ProgressBar();
-+ m_progress_bar.set_ellipsize(Pango.EllipsizeMode.MIDDLE);
-+ m_progress_bar.set_halign(Gtk.Align.CENTER);
-+ m_progress_bar.set_valign(Gtk.Align.CENTER);
-+ m_progress_label = new Gtk.Label(null);
-+
-+ int progress = message.get_progress();
-+ double progress_f = progress / 100.0;
-+ if (progress_f <= 1.0 && progress >= 0) {
-+ m_progress_bar.set_fraction(progress_f);
-+ m_progress_bar.set_text(
-+ "%2u%%\n".printf(progress));
-+ m_progress_label.set_text(
-+ "%2u%%\n".printf(progress));
-+ } else {
-+ if (progress_f > 1.0)
-+ warning ("Progress should be below 100.");
-+ m_hbox.set_no_show_all(true);
-+ }
-+
-+ m_timeout_time = message.get_timeout();
-+ if (m_timeout_time >= 0) {
-+ m_timeout_label = new Gtk.Label(_("%5dSec").printf(m_timeout_time));
-+ } else {
-+ m_timeout_label = new Gtk.Label(null);
-+ m_timeout_label.set_no_show_all(true);
-+ }
-+ m_timeout_label.set_size_request(20, -1);
-+ m_timeout_label.set_halign(Gtk.Align.CENTER);
-+ m_timeout_label.set_valign(Gtk.Align.CENTER);
-+ m_timeout_label.set_margin_start(8);
-+ m_timeout_label.set_margin_end(8);
-+
-+ if (message.get_serial() > 0 && m_timeout_time >= 0) {
-+ m_button = new Gtk.Button();
-+ m_button.set_no_show_all(true);
-+ } else {
-+ m_button = new Gtk.Button.with_label(_("Close"));
-+ m_button.get_style_context().add_class("text-button");
-+ m_button.set_can_default(true);
-+ }
-+ m_button.set_use_underline(true);
-+ m_button.set_valign(Gtk.Align.BASELINE);
-+ m_button.clicked.connect((w) => {
-+ if (m_timeout_id > 0) {
-+ GLib.Source.remove(m_timeout_id);
-+ m_timeout_id = 0;
-+ }
-+ close();
-+ });
-+ if (m_timeout_time >= 0) {
-+ m_elapsed_time = 1;
-+ m_timeout_id = Timeout.add_seconds(1,
-+ () => {
-+ if (m_elapsed_time >= m_timeout_time) {
-+ close();
-+ m_timeout_id = 0;
-+ return Source.REMOVE;
-+ }
-+ m_timeout_label.set_text(_("%5dSec").printf(
-+ m_timeout_time - m_elapsed_time++));
-+ return Source.CONTINUE;
-+ });
-+ }
-+
-+ m_vbox.pack_start(m_title_label, false, false, 4);
-+ m_vbox.pack_start(m_description_label, false, false, 4);
-+ m_vbox.add(m_hbox);
-+ m_hbox.add(m_progress_bar);
-+ m_hbox.add(m_progress_label);
-+ m_vbox.pack_start(m_timeout_label, false, false, 4);
-+ m_vbox.pack_start(m_button, false, false, 0);
-+
-+ m_toplevel.resize(1, 1);
-+ }
-+
-+ public void update_message(IBus.Message message) {
-+ string? title = message.get_title();
-+ string description = message.get_description();
-+
-+ if (title.length > 0) {
-+ m_title_label.set_text(title);
-+ m_title_label.show();
-+ } else {
-+ m_title_label.hide();
-+ }
-+ m_description_label.set_text(description);
-+
-+ m_timeout_time = message.get_timeout();
-+ if (m_timeout_time >= 0) {
-+ m_timeout_label.set_text(_("%5dSec").printf(m_timeout_time));
-+ m_timeout_label.show();
-+ m_elapsed_time = 1;
-+ } else {
-+ m_timeout_label.hide();
-+ }
-+
-+ int progress = message.get_progress();
-+ double progress_f = progress / 100.0;
-+ if (progress_f <= 1.0 && progress >= 0) {
-+ m_progress_bar.set_fraction(progress_f);
-+ m_progress_bar.set_text(
-+ "%2u%%\n".printf(progress));
-+ m_progress_label.set_text(
-+ "%2u%%\n".printf(progress));
-+ m_hbox.show();
-+ } else {
-+ if (progress_f > 1.0)
-+ warning ("Progress should be below 100.");
-+ m_hbox.hide();
-+ }
-+
-+ m_toplevel.resize(1, 1);
-+ this.show();
-+ }
-+
-+ public new void show() {
-+ m_toplevel.show_all();
-+ }
-+
-+ public new void hide() {
-+#if USE_GDK_WAYLAND
-+ if (m_is_wayland)
-+ realize_surface(null);
-+#endif
-+ m_toplevel.hide();
-+ }
-+
-+ /**
-+ * move:
-+ * @x: left position of the #MessageDialog
-+ * @y: top position of the #MessageDialog
-+ */
-+ private void move(int x, int y) {
-+ m_toplevel.move(x, y);
-+ }
-+
-+ private void adjust_window_position(Gtk.Widget window) {
-+ adjust_window_position_horizontal(window);
-+ }
-+
-+ /**
-+ * adjust_window_position_horizontal:
-+ * @window: A Gtk.Widget of the toplevel window.
-+ *
-+ * Horizontal writing mode but not the horizontal lookup table
-+ * when the allocation is emmitted.
-+ */
-+ private void adjust_window_position_horizontal(Gtk.Widget window) {
-+ Gdk.Point cursor_left_bottom = {
-+ m_cursor_location.x,
-+ m_cursor_location.y + m_cursor_location.height
-+ };
-+
-+ Gtk.Allocation allocation;
-+ m_toplevel.get_allocation(out allocation);
-+ Gdk.Point window_right_bottom = {
-+ cursor_left_bottom.x + allocation.width,
-+ cursor_left_bottom.y + allocation.height
-+ };
-+
-+ Gdk.Rectangle monitor_area = get_monitor_geometry(window);
-+ int monitor_right = monitor_area.x + monitor_area.width;
-+ int monitor_bottom = monitor_area.y + monitor_area.height;
-+
-+ int x, y;
-+ if (window_right_bottom.x > monitor_right)
-+ x = monitor_right - allocation.width;
-+ else
-+ x = cursor_left_bottom.x;
-+ if (x < 0)
-+ x = 0;
-+
-+ if (window_right_bottom.y > monitor_bottom)
-+ y = m_cursor_location.y - allocation.height;
-+ else
-+ y = cursor_left_bottom.y;
-+ if (y < 0)
-+ y = 0;
-+
-+ move(x, y);
-+ }
-+
-+ private Gdk.Rectangle get_monitor_geometry(Gtk.Widget window) {
-+ Gdk.Rectangle monitor_area = { 0, };
-+
-+ // Use get_monitor_geometry() instead of get_monitor_area().
-+ // get_monitor_area() excludes docks, but the lookup window should be
-+ // shown over them.
-+ Gdk.Monitor monitor = window.get_display().get_monitor_at_point(
-+ m_cursor_location.x,
-+ m_cursor_location.y);
-+ monitor_area = monitor.get_geometry();
-+ return monitor_area;
-+ }
-+
-+#if USE_GDK_WAYLAND
-+ private void realize_window(bool initial) {
-+ // The custom surface can be used when the Wayland input-method
-+ // is activated.
-+ if (m_no_wayland_panel)
-+ return;
-+ var window = m_toplevel.get_window();
-+ if (!window.ensure_native()) {
-+ warning("No native window.");
-+ return;
-+ }
-+ Type instance_type = window.get_type();
-+ Type wayland_type = typeof(GdkWayland.Window);
-+ if (!instance_type.is_a(wayland_type)) {
-+ warning("Not GdkWindowWayland.");
-+ return;
-+ }
-+ if (initial)
-+ ((GdkWayland.Window)window).set_use_custom_surface();
-+ var surface = ((GdkWayland.Window)window).get_wl_surface();
-+ realize_surface(surface);
-+ }
-+#endif
-+}
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 363834e9..d65ffbb3 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -93,6 +93,10 @@ class Panel : IBus.PanelService {
- private ulong m_registered_status_notifier_item_id;
- private unowned FileStream m_log;
- private bool m_verbose;
-+ private GLib.HashTable<uint, MessageDialog> m_popup_dialogs =
-+ new GLib.HashTable<uint, MessageDialog>(GLib.direct_hash,
-+ GLib.direct_equal);
-+ private uint m_popup_dialog_index;
-
- private GLib.List<BindingCommon.Keybinding> m_keybindings =
- new GLib.List<BindingCommon.Keybinding>();
-@@ -246,12 +250,12 @@ class Panel : IBus.PanelService {
- m_settings_panel = new GLib.Settings("org.freedesktop.ibus.panel");
-
- m_settings_general.changed["preload-engines"].connect((key) => {
-- update_engines(m_settings_general.get_strv(key),
-- null);
-+ update_engines(m_settings_general.get_strv(key),
-+ null);
- });
-
- m_settings_general.changed["switcher-delay-time"].connect((key) => {
-- set_switcher_delay_time();
-+ set_switcher_delay_time();
- });
-
- m_settings_general.changed["use-system-keyboard-layout"].connect(
-@@ -260,72 +264,72 @@ class Panel : IBus.PanelService {
- });
-
- m_settings_general.changed["embed-preedit-text"].connect((key) => {
-- set_embed_preedit_text();
-+ set_embed_preedit_text();
- });
-
- m_settings_general.changed["use-global-engine"].connect((key) => {
-- set_use_global_engine();
-+ set_use_global_engine();
- });
-
- m_settings_general.changed["use-xmodmap"].connect((key) => {
-- set_use_xmodmap();
-+ set_use_xmodmap();
- });
-
- m_settings_hotkey.changed["triggers"].connect((key) => {
-- BindingCommon.unbind_switch_shortcut(
-- BindingCommon.KeyEventFuncType.IME_SWITCHER,
-- m_keybindings);
-- m_keybindings = null;
-- bind_switch_shortcut();
-+ BindingCommon.unbind_switch_shortcut(
-+ BindingCommon.KeyEventFuncType.IME_SWITCHER,
-+ m_keybindings);
-+ m_keybindings = null;
-+ bind_switch_shortcut();
- });
-
- m_settings_panel.changed["custom-font"].connect((key) => {
-- BindingCommon.set_custom_font(m_settings_panel,
-- null,
-- ref m_css_provider);
-+ BindingCommon.set_custom_font(m_settings_panel,
-+ null,
-+ ref m_css_provider);
- });
-
- m_settings_panel.changed["use-custom-font"].connect((key) => {
-- BindingCommon.set_custom_font(m_settings_panel,
-- null,
-- ref m_css_provider);
-+ BindingCommon.set_custom_font(m_settings_panel,
-+ null,
-+ ref m_css_provider);
- });
-
- m_settings_panel.changed["custom-theme"].connect((key) => {
-- BindingCommon.set_custom_theme(m_settings_panel);
-+ BindingCommon.set_custom_theme(m_settings_panel);
- });
-
- m_settings_panel.changed["use-custom-theme"].connect((key) => {
-- BindingCommon.set_custom_theme(m_settings_panel);
-+ BindingCommon.set_custom_theme(m_settings_panel);
- });
-
- m_settings_panel.changed["custom-icon"].connect((key) => {
-- BindingCommon.set_custom_icon(m_settings_panel);
-+ BindingCommon.set_custom_icon(m_settings_panel);
- });
-
- m_settings_panel.changed["use-custom-icon"].connect((key) => {
-- BindingCommon.set_custom_icon(m_settings_panel);
-+ BindingCommon.set_custom_icon(m_settings_panel);
- });
-
- m_settings_panel.changed["use-glyph-from-engine-lang"].connect((key) =>
- {
-- set_use_glyph_from_engine_lang();
-+ set_use_glyph_from_engine_lang();
- });
-
- m_settings_panel.changed["show-icon-on-systray"].connect((key) => {
-- set_show_icon_on_systray(true);
-+ set_show_icon_on_systray(true);
- });
-
- m_settings_panel.changed["lookup-table-orientation"].connect((key) => {
-- set_lookup_table_orientation();
-+ set_lookup_table_orientation();
- });
-
- m_settings_panel.changed["show"].connect((key) => {
-- set_show_property_panel();
-+ set_show_property_panel();
- });
-
- m_settings_panel.changed["timeout"].connect((key) => {
-- set_timeout_property_panel();
-+ set_timeout_property_panel();
- });
-
- m_settings_panel.changed["follow-input-cursor-when-always-shown"]
-@@ -334,11 +338,27 @@ class Panel : IBus.PanelService {
- });
-
- m_settings_panel.changed["xkb-icon-rgba"].connect((key) => {
-- set_xkb_icon_rgba();
-+ set_xkb_icon_rgba();
- });
-
- m_settings_panel.changed["property-icon-delay-time"].connect((key) => {
-- set_property_icon_delay_time();
-+ set_property_icon_delay_time();
-+ });
-+
-+ this.send_message_received.connect((o, m) => {
-+ uint domain = m.get_domain();
-+ switch (domain) {
-+ case IBus.MessageDomain.ENGINE:
-+ set_message_engine(m);
-+ break;
-+ case IBus.MessageDomain.PANEL:
-+ set_message_panel(m);
-+ break;
-+ default:
-+ warning("SendMessageReceived does not support the domain %u",
-+ domain);
-+ break;
-+ }
- });
- }
-
-@@ -855,6 +875,67 @@ class Panel : IBus.PanelService {
- }
-
-
-+ private void set_message_engine(IBus.Message message) {
-+ uint code = message.get_code();
-+ switch (code) {
-+ case IBus.EngineMsgCode.INVALID_COMPOSE_SEQUENCE:
-+ set_message_engine_invalid_compose(message);
-+ break;
-+ default:
-+ set_message_general(message);
-+ break;
-+ }
-+ }
-+
-+
-+ private void set_message_engine_invalid_compose(IBus.Message message) {
-+ var display = Gdk.Display.get_default();
-+ display.beep();
-+ }
-+
-+
-+ private void set_message_panel(IBus.Message message) {
-+ uint code = message.get_code();
-+ switch (code) {
-+ case IBus.PanelServiceMsgCode.LOADING_UNICODE:
-+ set_message_general(message);
-+ break;
-+ }
-+ }
-+
-+
-+ private void set_message_general(IBus.Message message) {
-+ MessageDialog popup = null;
-+ uint serial = message.get_serial();
-+ if (serial != 0)
-+ popup = m_popup_dialogs.lookup(serial);
-+ else
-+ serial = m_popup_dialog_index++ + 20000;
-+ if (popup != null) {
-+ popup.update_message(message);
-+ } else {
-+ popup = new MessageDialog(m_is_wayland,
-+#if USE_GDK_WAYLAND
-+ m_wayland_object_path == null,
-+#else
-+ true,
-+#endif
-+ message);
-+ popup.close.connect((w) => {
-+ popup.hide();
-+ m_popup_dialogs.remove(serial);
-+ popup = null;
-+ });
-+#if USE_GDK_WAYLAND
-+ popup.realize_surface.connect(
-+ (w, s) => this.realize_surface(s));
-+#endif
-+ m_popup_dialogs.insert(serial, popup);
-+ popup.show();
-+ }
-+ }
-+
-+
- private int compare_versions(string version1, string version2) {
- string[] version1_list = version1.split(".");
- string[] version2_list = version2.split(".");
-diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
-index 10d09d75..f0827b3e 100644
---- a/ui/gtk3/panelbinding.vala
-+++ b/ui/gtk3/panelbinding.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2018-2024 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2018-2025 Takao Fujwiara <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
-@@ -902,6 +902,9 @@ class PanelBinding : IBus.PanelService {
- "is-extension", true);
- panel_extension(close_event);
- });
-+ m_emojier.send_message.connect((m) => {
-+ send_message(m);
-+ });
- }
- m_emojier.reset();
- m_emojier.set_annotation("");
---
-2.49.0
-
-From 40fcbebb8a4a60172d80482e35dcab2f39b80c2d Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 1 Jun 2025 20:32:05 +0900
-Subject: [PATCH 3/3] Add workaround until GNOME handle IBusMessage
-
-The IBusEngine's focus-id feature is now always used in case the engine
-is IBusEngineSimple to make a workaround in GNOME and Wayland because
-GNOME-Shell does not implement the new D-Bus method
-"SendMessageReceived" yet and the Wayland input-method protocol cannot
-get the input surface for the Wayland xdg-system-bell protocol.
-
-The auxiliary text is shown with the candidate popup in GNOME as a
-workaround to notify the Unicode loading message until GNOME-Shell
-implements the D-Bus method "SendMessageReceived".
-
-Update the POT file.
-
-BUG=https://github.com/ibus/ibus/issues/2722
----
- po/POTFILES.in | 2 +
- src/ibusengine.c | 18 ++-
- src/ibusenginesimple.c | 134 ++++++++++++++++++++++-
- ui/gtk3/candidatepanel.vala | 55 +++++++---
- ui/gtk3/emojier.vala | 44 ++++++--
- ui/gtk3/extension.vala | 3 +-
- ui/gtk3/panelbinding.vala | 5 +-
- 7 files changed, 338 insertions(+), 134 deletions(-)
-
-diff --git a/po/POTFILES.in b/po/POTFILES.in
-index c56408f7..d9178c85 100644
---- a/po/POTFILES.in
-+++ b/po/POTFILES.in
-@@ -40,9 +40,11 @@ setup/keyboardshortcut.py
- setup/main.py
- setup/setup.ui
- src/ibusbus.c
-+src/ibuscomposetable.c
- src/ibusconfig.c
- src/ibusemojigen.h
- src/ibusengine.c
-+src/ibusenginesimple.c
- src/ibusfactory.c
- src/ibushotkey.c
- src/ibusinputcontext.c
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index 4e13b23d..1f12d253 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -34,6 +34,8 @@
- #define IBUS_ENGINE_GET_PRIVATE(o) \
- ((IBusEnginePrivate *)ibus_engine_get_instance_private (o))
-
-+extern GType ibus_engine_simple_get_type (void);
-+
- enum {
- PROCESS_KEY_EVENT,
- FOCUS_IN,
-@@ -1544,7 +1546,21 @@ _ibus_engine_has_focus_id (IBusEngine *engine,
- GDBusConnection *connection,
- GError **error)
- {
-- GVariant *retval = g_variant_new_boolean (engine->priv->has_focus_id);
-+ GVariant *retval;
-+
-+#ifndef IBUS_TYPE_ENGINE_SIMPLE
-+#define IBUS_TYPE_ENGINE_SIMPLE (ibus_engine_simple_get_type ())
-+#define __IBUS_SET_LOCAL_ENGINE_SIMPLE
-+#endif
-+ /* Should not use IBUS_IS_ENGINE_SIMPLE() not to effect the inherited
-+ * class.*/
-+ if (G_OBJECT_TYPE (engine) == IBUS_TYPE_ENGINE_SIMPLE)
-+ engine->priv->has_focus_id = TRUE;
-+#ifdef __IBUS_SET_LOCAL_ENGINE_SIMPLE
-+#undef __IBUS_SET_LOCAL_ENGINE_SIMPLE
-+#undef IBUS_TYPE_ENGINE_SIMPLE
-+#endif
-+ retval = g_variant_new_boolean (engine->priv->has_focus_id);
- g_assert (retval);
- return retval;
- }
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 4e0ba40f..15c45c2e 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -75,6 +75,7 @@ struct _IBusEngineSimplePrivate {
- GString *tentative_match;
- int tentative_match_len;
- char *tentative_emoji;
-+ char *client;
-
- guint hex_mode_enabled : 1;
- guint in_hex_sequence : 1;
-@@ -85,6 +86,8 @@ struct _IBusEngineSimplePrivate {
- IBusLookupTable *lookup_table;
- gboolean lookup_table_visible;
- IBusText *updated_preedit;
-+ gboolean do_inform_user_error;
-+ guint inform_user_error_timeout_id;
- };
-
- guint COMPOSE_BUFFER_SIZE = 20;
-@@ -96,7 +99,13 @@ static IBusComposeTableEx *en_compose_table;
- /* 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_in_id (IBusEngine *engine,
-+ const gchar
-+ *object_path,
-+ const gchar *client);
- static void ibus_engine_simple_focus_out (IBusEngine *engine);
-+static void ibus_engine_simple_focus_out_id (IBusEngine *engine,
-+ const gchar *client);
- static void ibus_engine_simple_reset (IBusEngine *engine);
- static gboolean ibus_engine_simple_process_key_event
- (IBusEngine *engine,
-@@ -135,7 +144,11 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- (IBusObjectDestroyFunc) ibus_engine_simple_destroy;
-
- engine_class->focus_in = ibus_engine_simple_focus_in;
-+ engine_class->focus_in_id
-+ = ibus_engine_simple_focus_in_id;
- engine_class->focus_out = ibus_engine_simple_focus_out;
-+ engine_class->focus_out_id
-+ = ibus_engine_simple_focus_out_id;
- engine_class->reset = ibus_engine_simple_reset;
- engine_class->process_key_event
- = ibus_engine_simple_process_key_event;
-@@ -158,6 +171,22 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- en_compose_table = ibus_compose_table_deserialize (contents, length);
- }
-
-+
-+static gboolean
-+inform_user_error_timeout_cb (gpointer user_data)
-+{
-+ IBusEngineSimple *simple = (IBusEngineSimple *)user_data;
-+ IBusEngineSimplePrivate *priv;
-+
-+ g_return_val_if_fail (IBUS_IS_ENGINE_SIMPLE (simple), G_SOURCE_REMOVE);
-+ priv = simple->priv;
-+ priv->do_inform_user_error = FALSE;
-+ priv->inform_user_error_timeout_id = 0;
-+ ibus_engine_show_preedit_text ((IBusEngine *)simple);
-+ return G_SOURCE_REMOVE;
-+}
-+
-+
- static void
- ibus_engine_simple_init (IBusEngineSimple *simple)
- {
-@@ -205,13 +234,18 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple)
- IBUS_OBJECT (simple));
- }
-
-+
- static void
- ibus_engine_simple_send_message_with_code (IBusEngineSimple *simple,
- IBusEngineMsgCode code)
- {
-+ IBusEngineSimplePrivate *priv;
- IBusMessage *message;
-
- g_return_if_fail (IBUS_IS_ENGINE_SIMPLE (simple));
-+
-+ priv = simple->priv;
-+ priv->do_inform_user_error = TRUE;
- message = ibus_message_new (
- IBUS_MESSAGE_DOMAIN_ENGINE,
- code,
-@@ -226,19 +260,57 @@ ibus_engine_simple_send_message_with_code (IBusEngineSimple *simple,
- ibus_engine_send_message (IBUS_ENGINE (simple), message);
- }
-
-+
- static void
- ibus_engine_simple_focus_in (IBusEngine *engine)
- {
-+ ibus_engine_simple_focus_in_id (engine, NULL, NULL);
-+}
-+
-+
-+static void
-+ibus_engine_simple_focus_in_id (IBusEngine *engine,
-+ const gchar *object_path,
-+ const gchar *client)
-+{
-+ /* Do not enable IBusEngine:has-focus-id in the IBusEngineSimple's
-+ * constructor because the property should be enabled by the inherited
-+ * engine. E.g. IBusEngineHangul disables it.
-+ * The property is handled by ibusengine.c:_ibus_engine_has_focus_id();
-+ */
-+ if (IBUS_IS_ENGINE_SIMPLE (engine)) {
-+ IBusEngineSimple *simple = IBUS_ENGINE_SIMPLE (engine);
-+ g_free (simple->priv->client);
-+ simple->priv->client = g_strdup (client);
-+ } else {
-+ g_warning ("IBUS_IS_ENGINE_SIMPLE(engine) in %s", G_STRFUNC);
-+ }
- 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_simple_focus_out_id (engine, NULL);
-+}
-+
-+
-+static void
-+ibus_engine_simple_focus_out_id (IBusEngine *engine,
-+ const gchar *object_path)
-+{
-+ if (IBUS_IS_ENGINE_SIMPLE (engine)) {
-+ IBusEngineSimple *simple = IBUS_ENGINE_SIMPLE (engine);
-+ g_clear_pointer (&simple->priv->client, g_free);
-+ ibus_engine_simple_reset (engine);
-+ } else {
-+ g_warning ("IBUS_IS_ENGINE_SIMPLE(engine) in %s", G_STRFUNC);
-+ }
- IBUS_ENGINE_CLASS (ibus_engine_simple_parent_class)->focus_out (engine);
- }
-
-+
- static void
- ibus_engine_simple_reset (IBusEngine *engine)
- {
-@@ -259,11 +331,17 @@ ibus_engine_simple_reset (IBusEngine *engine)
- priv->tentative_match_len = 0;
- }
- ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-+ priv->do_inform_user_error = FALSE;
-+ if (priv->inform_user_error_timeout_id) {
-+ g_source_remove (priv->inform_user_error_timeout_id);
-+ priv->inform_user_error_timeout_id = 0;
-+ }
- g_object_unref (priv->updated_preedit);
- priv->updated_preedit =
- (IBusText *)g_object_ref_sink (updated_preedit_empty);
- }
-
-+
- static void
- ibus_engine_simple_commit_char (IBusEngineSimple *simple,
- gunichar ch)
-@@ -326,6 +404,7 @@ ibus_engine_simple_commit_str (IBusEngineSimple *simple,
- g_free (backup_str);
- }
-
-+
- static void
- ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- {
-@@ -426,6 +505,11 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- g_object_unref (priv->updated_preedit);
- priv->updated_preedit =
- (IBusText *)g_object_ref_sink (updated_preedit_empty);
-+ priv->do_inform_user_error = FALSE;
-+ if (priv->inform_user_error_timeout_id) {
-+ g_source_remove (priv->inform_user_error_timeout_id);
-+ priv->inform_user_error_timeout_id = 0;
-+ }
- }
- } else if (s->len >= G_MAXINT) {
- g_warning ("%s is too long compose length: %lu", s->str, s->len);
-@@ -433,9 +517,30 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- guint len = (guint)g_utf8_strlen (s->str, -1);
- IBusText *text = ibus_text_new_from_string (s->str);
- ibus_text_append_attribute (text,
-- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
-+ IBUS_ATTR_TYPE_UNDERLINE,
-+ IBUS_ATTR_UNDERLINE_SINGLE,
-+ 0,
-+ len);
- g_object_ref_sink (text);
-- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
-+ /* gnome-shell does not handle "SendMessageReceived" D-Bus method yet.
-+ * Seems other Wayland desktops do not implement xdg-system-bell
-+ * Wayland protocol yet.
-+ */
-+ if (priv->do_inform_user_error && priv->client &&
-+ (!g_ascii_strncasecmp (priv->client, "gnome-shell", 11) ||
-+ !g_ascii_strncasecmp (priv->client, "wayland", 7))
-+ ) {
-+ ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-+ if (priv->inform_user_error_timeout_id)
-+ g_source_remove (priv->inform_user_error_timeout_id);
-+ priv->inform_user_error_timeout_id =
-+ g_timeout_add (500,
-+ inform_user_error_timeout_cb,
-+ simple);
-+ } else {
-+ ibus_engine_update_preedit_text ((IBusEngine *)simple,
-+ text, len, TRUE);
-+ }
- g_object_unref (priv->updated_preedit);
- priv->updated_preedit = text;
- }
-@@ -460,6 +565,7 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- */
- #define HEX_MOD_MASK (IBUS_CONTROL_MASK | IBUS_SHIFT_MASK)
-
-+
- static gboolean
- check_hex (IBusEngineSimple *simple,
- int n_compose)
-@@ -523,6 +629,7 @@ check_hex (IBusEngineSimple *simple,
- return TRUE;
- }
-
-+
- static IBusEngineDict *
- load_emoji_dict (void)
- {
-@@ -546,6 +653,7 @@ load_emoji_dict (void)
- return emoji_dict;
- }
-
-+
- static gboolean
- check_emoji_table (IBusEngineSimple *simple,
- int n_compose,
-@@ -727,6 +835,7 @@ no_sequence_matches (IBusEngineSimple *simple,
- return FALSE;
- }
-
-+
- static gboolean
- is_hex_keyval (guint keyval)
- {
-@@ -735,6 +844,7 @@ is_hex_keyval (guint keyval)
- return g_unichar_isxdigit (ch);
- }
-
-+
- static gboolean
- is_graph_keyval (guint keyval)
- {
-@@ -743,6 +853,7 @@ is_graph_keyval (guint keyval)
- return g_unichar_isgraph (ch);
- }
-
-+
- static void
- ibus_engine_simple_update_lookup_and_aux_table (IBusEngineSimple *simple)
- {
-@@ -768,6 +879,7 @@ ibus_engine_simple_update_lookup_and_aux_table (IBusEngineSimple *simple)
- priv->lookup_table_visible);
- }
-
-+
- static gboolean
- ibus_engine_simple_if_in_range_of_lookup_table (IBusEngineSimple *simple,
- guint keyval)
-@@ -794,6 +906,7 @@ ibus_engine_simple_if_in_range_of_lookup_table (IBusEngineSimple *simple,
- return TRUE;
- }
-
-+
- static void
- ibus_engine_simple_set_number_on_lookup_table (IBusEngineSimple *simple,
- guint keyval,
-@@ -886,8 +999,9 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- if (is_32bit) {
- ibus_engine_simple_commit_str (simple, output->str);
- } else {
-- ibus_engine_simple_commit_char (simple,
-- g_utf8_get_char (output->str));
-+ ibus_engine_simple_commit_char (
-+ simple,
-+ g_utf8_get_char (output->str));
- }
- }
- ibus_engine_simple_update_preedit_text (simple);
-@@ -951,8 +1065,10 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- guint printable_keyval;
- int i;
-
-- while (n_compose <= COMPOSE_BUFFER_SIZE && priv->compose_buffer[n_compose] != 0)
-+ while (n_compose <= COMPOSE_BUFFER_SIZE &&
-+ priv->compose_buffer[n_compose] != 0) {
- n_compose++;
-+ }
- if (n_compose > COMPOSE_BUFFER_SIZE) {
- g_warning ("copmose table buffer is full.");
- n_compose = COMPOSE_BUFFER_SIZE;
-@@ -1395,6 +1511,7 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- return no_sequence_matches (simple, n_compose, keyval, keycode, modifiers);
- }
-
-+
- static void
- ibus_engine_simple_page_down (IBusEngine *engine)
- {
-@@ -1406,6 +1523,7 @@ ibus_engine_simple_page_down (IBusEngine *engine)
- ibus_engine_simple_update_lookup_and_aux_table (simple);
- }
-
-+
- static void
- ibus_engine_simple_page_up (IBusEngine *engine)
- {
-@@ -1417,6 +1535,7 @@ ibus_engine_simple_page_up (IBusEngine *engine)
- ibus_engine_simple_update_lookup_and_aux_table (simple);
- }
-
-+
- static void
- ibus_engine_simple_candidate_clicked (IBusEngine *engine,
- guint index,
-@@ -1440,6 +1559,7 @@ ibus_engine_simple_candidate_clicked (IBusEngine *engine,
- ibus_engine_simple_set_number_on_lookup_table (simple, keyval, n_compose);
- }
-
-+
- void
- ibus_engine_simple_add_table (IBusEngineSimple *simple,
- const guint16 *data,
-@@ -1454,6 +1574,7 @@ ibus_engine_simple_add_table (IBusEngineSimple *simple,
- n_seqs);
- }
-
-+
- gboolean
- ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
- const gchar *locale)
-@@ -1572,6 +1693,7 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
- return retval;
- }
-
-+
- gboolean
- ibus_engine_simple_add_compose_file (IBusEngineSimple *simple,
- const gchar *compose_file)
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index aa1a34ce..a4137f05 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -491,6 +491,11 @@ public class CandidatePanel : Gtk.Box{
- m_toplevel.hide();
- }
-
-+ /**
-+ * move:
-+ * @x: left position of the #CandidatePanel
-+ * @y: top position of the #CandidatePanel
-+ */
- private void move(int x, int y) {
- m_toplevel.move(x, y);
- }
-@@ -502,21 +507,15 @@ public class CandidatePanel : Gtk.Box{
- adjust_window_position_vertical(window);
- }
-
-- private Gdk.Rectangle get_monitor_geometry(Gtk.Widget window) {
-- Gdk.Rectangle monitor_area = { 0, };
--
-- // Use get_monitor_geometry() instead of get_monitor_area().
-- // get_monitor_area() excludes docks, but the lookup window should be
-- // shown over them.
-- Gdk.Monitor monitor = window.get_display().get_monitor_at_point(
-- m_cursor_location.x,
-- m_cursor_location.y);
-- monitor_area = monitor.get_geometry();
-- return monitor_area;
-- }
--
-+ /**
-+ * adjust_window_position_horizontal:
-+ * @window: A Gtk.Widget of the toplevel window.
-+ *
-+ * Horizontal writing mode but not the horizontal lookup table
-+ * when the allocation is emmitted.
-+ */
- private void adjust_window_position_horizontal(Gtk.Widget window) {
-- Gdk.Point cursor_right_bottom = {
-+ Gdk.Point cursor_left_bottom = {
- m_cursor_location.x,
- m_cursor_location.y + m_cursor_location.height
- };
-@@ -524,8 +523,8 @@ public class CandidatePanel : Gtk.Box{
- Gtk.Allocation allocation;
- m_toplevel.get_allocation(out allocation);
- Gdk.Point window_right_bottom = {
-- cursor_right_bottom.x + allocation.width,
-- cursor_right_bottom.y + allocation.height
-+ cursor_left_bottom.x + allocation.width,
-+ cursor_left_bottom.y + allocation.height
- };
-
- Gdk.Rectangle monitor_area = get_monitor_geometry(window);
-@@ -536,20 +535,27 @@ public class CandidatePanel : Gtk.Box{
- if (window_right_bottom.x > monitor_right)
- x = monitor_right - allocation.width;
- else
-- x = cursor_right_bottom.x;
-+ x = cursor_left_bottom.x;
- if (x < 0)
- x = 0;
-
- if (window_right_bottom.y > monitor_bottom)
- y = m_cursor_location.y - allocation.height;
- else
-- y = cursor_right_bottom.y;
-+ y = cursor_left_bottom.y;
- if (y < 0)
- y = 0;
-
- move(x, y);
- }
-
-+ /**
-+ * adjust_window_position_vertical:
-+ * @window: A Gtk.Widget of the toplevel window.
-+ *
-+ * Vertical writing mode but not the vertical lookup table
-+ * when the allocation is emmitted.
-+ */
- private void adjust_window_position_vertical(Gtk.Widget window) {
- /* Not sure in which top or left cursor appears
- * in the vertical writing mode.
-@@ -611,6 +617,19 @@ public class CandidatePanel : Gtk.Box{
- move(x, y);
- }
-
-+ private Gdk.Rectangle get_monitor_geometry(Gtk.Widget window) {
-+ Gdk.Rectangle monitor_area = { 0, };
-+
-+ // Use get_monitor_geometry() instead of get_monitor_area().
-+ // get_monitor_area() excludes docks, but the lookup window should be
-+ // shown over them.
-+ Gdk.Monitor monitor = window.get_display().get_monitor_at_point(
-+ m_cursor_location.x,
-+ m_cursor_location.y);
-+ monitor_area = monitor.get_geometry();
-+ return monitor_area;
-+ }
-+
- #if USE_GDK_WAYLAND
- private void realize_window(bool initial) {
- // The custom surface can be used when the Wayland input-method
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index 2d8754a4..8c527eca 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -223,8 +223,6 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- BACKWARD,
- }
-
-- public bool is_wayland { get; set; }
--
- public const uint BUTTON_CLOSE_BUTTON = 1000;
-
- private const uint EMOJI_GRID_PAGE = 10;
-@@ -268,6 +266,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- private static bool m_loaded_unicode = false;
- private static string m_warning_message = "";
-
-+ private bool m_is_wayland;
-+ private bool m_is_gnome = false;
- private ThemedRGBA m_rgba;
- private Gtk.Box m_vbox;
- /* If emojier is emoji category list or Unicode category list,
-@@ -328,7 +328,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- GLib.Object(
- type : Gtk.WindowType.POPUP
- );
-- this.is_wayland = is_wayland;
-+ m_is_wayland = is_wayland;
-+ m_is_gnome = is_gnome();
-
- // GLib.ActionEntry accepts const variables only.
- var action = new GLib.SimpleAction.stateful(
-@@ -382,6 +383,23 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- }
-
-
-+ private bool is_gnome() {
-+ unowned string? desktop =
-+ Environment.get_variable("XDG_CURRENT_DESKTOP");
-+ if (desktop == "GNOME")
-+ return true;
-+ /* If ibus-dameon is launched from systemd, XDG_CURRENT_DESKTOP
-+ * environment variable could be set after ibus-dameon would be
-+ * launched and XDG_CURRENT_DESKTOP could be "(null)".
-+ * But XDG_SESSION_DESKTOP can be set with systemd's PAM.
-+ */
-+ if (desktop == null || desktop == "(null)")
-+ desktop = Environment.get_variable("XDG_SESSION_DESKTOP");
-+ if (desktop == "gnome")
-+ return true;
-+ return false;
-+ }
-+
- private static void reload_emoji_dict() {
- init_emoji_dict();
- make_emoji_dict("en");
-@@ -1807,7 +1825,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
-
-
- private void start_rebuild_gui(bool initial_launching) {
-- if (!this.is_wayland)
-+ if (!m_is_wayland)
- return;
- if (!initial_launching && !base.get_visible())
- return;
-@@ -2189,17 +2207,23 @@ public class IBusEmojier : Gtk.ApplicationWindow {
-
-
- public IBus.Text get_title_text() {
-+ if (!m_loaded_unicode && m_is_gnome) {
-+ unichar c = 0x26A0;
-+ return new IBus.Text.from_string("%s%s %u%%".printf(
-+ c.to_string(),
-+ _("Loading a Unicode dictionary:"),
-+ (uint)(m_unicode_percent * 100)));
-+ }
- var language = _(IBus.get_language_name(m_current_lang_id));
- uint ncandidates = this.get_number_of_candidates();
- string main_title = _("Emoji Choice");
- if (m_show_unicode)
- main_title = _("Unicode Choice");
-- var text = new IBus.Text.from_string(
-- "%s (%s) (%u / %u)".printf(
-- main_title,
-- language,
-- this.get_cursor_pos() + 1,
-- ncandidates));
-+ var text = new IBus.Text.from_string("%s (%s) (%u / %u)".printf(
-+ main_title,
-+ language,
-+ this.get_cursor_pos() + 1,
-+ ncandidates));
- int char_count = text.text.char_count();
- int start_index = -1;
- unowned string title = text.text;
-diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala
-index a6f2e8e6..5cd1a6ad 100644
---- a/ui/gtk3/extension.vala
-+++ b/ui/gtk3/extension.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2018-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2018-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
-@@ -99,6 +99,7 @@ class ExtensionGtk : Gtk.Application {
- private void bus_disconnected(IBus.Bus bus) {
- debug("connection is lost.");
- Gtk.main_quit();
-+ this.quit();
- }
-
- private void bus_connected(IBus.Bus bus) {
-diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
-index f0827b3e..a2fd1441 100644
---- a/ui/gtk3/panelbinding.vala
-+++ b/ui/gtk3/panelbinding.vala
-@@ -632,6 +632,8 @@ class PanelBinding : IBus.PanelService {
- m_emojier.key_press_cursor_horizontal(Gdk.Key.Right, 0);
- } else {
- m_emojier.set_annotation(annotation);
-+ var text = m_emojier.get_title_text();
-+ show_candidate = (text.text.get_char() == 0x26A0);
- }
- }
- convert_preedit_text();
-@@ -738,10 +740,11 @@ class PanelBinding : IBus.PanelService {
- private void show_wayland_lookup_table(IBus.Text text) {
- m_wayland_lookup_table_is_visible = true;
- var table = m_emojier.get_one_dimension_lookup_table();
-+ bool do_show_auxiliary_text = (text.text.get_char() == 0x26A0);
- uint ncandidates = table.get_number_of_candidates();
- update_auxiliary_text_received(
- text,
-- ncandidates > 0 ? true : false);
-+ do_show_auxiliary_text ? true : ncandidates > 0 ? true : false);
- update_lookup_table_received(
- table,
- ncandidates > 0 ? true : false);
---
-2.49.0
-
-From a1c1469a2ba70c013f06995fd7665f3e784cbaf0 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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
-symbol file, /usr/share/X11/xkb/symbols/fr, details the proposed
-expressions of the pseudo-deadkeys in the comment lines and IBus
-follows it.
-
-BUG=https://github.com/ibus/ibus/issues/2748
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/8368
----
- 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..4764426a 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -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
-+ /* Refer (BEPO, AFNOR) comments in /usr/share/X11/xkb/symbols/fr file. */
-+ 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..258bd849 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -472,15 +472,59 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- 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 065cb8316ffcb92d97803c8350f02408c478d7f2 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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
-that the user compose file exists or el-GR locale is used since
-4.18.5 and new keyword "include %L" can loads the en-US compose table.
-If the old compose cache version 4 is found, the compose file
-will be rewritten to add the line of "include %L".
-IBus also follows GTK 4.18.5.
-
-Fixes: https://github.com/ibus/ibus/commit/28b357d
-Fixes: https://github.com/ibus/ibus/commit/09ea069
-BUG=https://github.com/ibus/ibus/issues/2706
-BUG=https://github.com/ibus/ibus/issues/2727
----
- src/gencomposetable.c | 9 +-
- src/ibuscomposetable.c | 275 ++++++++++++++++++++++++++++------
- src/ibuscomposetable.h | 24 ++-
- src/ibusengine.h | 5 +-
- src/ibusenginesimple.c | 139 ++++++++++++-----
- src/ibusenginesimpleprivate.h | 19 ++-
- src/tests/ibus-compose.c | 6 +-
- 7 files changed, 414 insertions(+), 95 deletions(-)
-
-diff --git a/src/gencomposetable.c b/src/gencomposetable.c
-index 35d6ce83..161b89e0 100644
---- a/src/gencomposetable.c
-+++ b/src/gencomposetable.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2023 Red Hat, Inc.
-+ * Copyright (C) 2023-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2023-2025 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
-@@ -76,6 +76,7 @@ main (int argc, char *argv[])
- char * const *sys_lang = NULL;
- char *path = NULL;
- IBusComposeTableEx *compose_table;
-+ guint16 saved_version = 0;
- char *basename = NULL;
-
- path = g_strdup ("./Compose");
-@@ -97,13 +98,15 @@ main (int argc, char *argv[])
- g_debug ("Create a cache of %s", path);
- }
- g_setenv ("IBUS_COMPOSE_CACHE_DIR", ".", TRUE);
-- compose_table = ibus_compose_table_load_cache (path);
-+ compose_table = ibus_compose_table_load_cache (path, &saved_version);
- if (!compose_table &&
- (compose_table = ibus_compose_table_new_with_file (path, NULL))
- == NULL) {
- g_warning ("Failed to generate the compose table.");
- return 1;
- }
-+ if (saved_version > 0)
-+ g_warning ("Old cache was updated.");
- g_free (path);
- 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 4764426a..169ca8cb 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -24,6 +24,7 @@
-
- #include <glib.h>
- #include <glib/gstdio.h>
-+#include <glib/gi18n-lib.h>
- #include <stdlib.h>
- #include <string.h>
-
-@@ -38,7 +39,7 @@
-
-
- #define IBUS_COMPOSE_TABLE_MAGIC "IBusComposeTable"
--#define IBUS_COMPOSE_TABLE_VERSION (4)
-+#define IBUS_COMPOSE_TABLE_VERSION (5)
- #define IBUS_MAX_COMPOSE_ALGORITHM_LEN 9
-
- typedef struct {
-@@ -283,10 +284,15 @@ expand_include_path (const char *include_path) {
- break;
- }
- case 'L': /* locale compose file */
-- g_warning ("while handling XCompose include target %s, found "
-- "redundant %%L include; the include has been "
-- "ignored", include_path);
-- goto fail;
-+ out = g_strdup ("%L");
-+ head = i + 2;
-+ while (*head || *head == ' ' || *head == '\t') head++;
-+ if (*head != '\0') {
-+ g_warning ("\"%s\" after \"%%L\" is not supported in "
-+ "XCompose include target.", head);
-+ goto fail;
-+ }
-+ break;
- case 'S': /* system compose dir */
- o = out;
- former = g_strndup (head, i - head);
-@@ -413,7 +419,8 @@ get_en_compose_file (void)
-
- static GList *
- ibus_compose_list_parse_file (const char *compose_file,
-- int *max_compose_len)
-+ int *max_compose_len,
-+ gboolean *can_load_en_us)
- {
- char *contents = NULL;
- char **lines = NULL;
-@@ -423,6 +430,7 @@ ibus_compose_list_parse_file (const char *compose_file,
- int i;
-
- g_assert (max_compose_len);
-+ g_assert (can_load_en_us);
-
- if (!g_file_get_contents (compose_file, &contents, &length, &error)) {
- g_error ("%s", error->message);
-@@ -438,6 +446,11 @@ ibus_compose_list_parse_file (const char *compose_file,
- parse_compose_line (&compose_list, lines[i], &compose_len, &include);
- if (*max_compose_len < compose_len)
- *max_compose_len = compose_len;
-+ if (!g_strcmp0 (include, "%L")) {
-+ *can_load_en_us = TRUE;
-+ g_clear_pointer (&include, g_free);
-+ continue;
-+ }
- if (include && *include) {
- GStatBuf buf_include = { 0, };
- GStatBuf buf_parent = { 0, };
-@@ -486,7 +499,8 @@ ibus_compose_list_parse_file (const char *compose_file,
- if (include && *include) {
- GList *rest = ibus_compose_list_parse_file (
- include,
-- max_compose_len);
-+ max_compose_len,
-+ can_load_en_us);
- if (rest) {
- compose_list = g_list_concat (compose_list, rest);
- }
-@@ -504,13 +518,16 @@ ibus_compose_list_check_duplicated_with_en (GList *compose_list,
- int max_compose_len,
- GSList *compose_tables)
- {
-+ guint *keysyms;
-+ GString *output;
- GList *list;
-- static guint *keysyms;
- GList *removed_list = NULL;
- IBusComposeData *compose_data;
-- GString *output = g_string_new ("");
-
-+ if (!compose_list)
-+ return NULL;
- keysyms = g_new (guint, max_compose_len + 1);
-+ output = g_string_new ("");
-
- for (list = compose_list; list != NULL; list = list->next) {
- int i;
-@@ -694,6 +711,8 @@ ibus_compose_list_check_duplicated_with_own (GList *compose_list,
- int i;
- GList *removed_list = NULL;
-
-+ if (!compose_list)
-+ return NULL;
- for (list = compose_list; list != NULL; list = list->next) {
- gboolean is_different_value = FALSE;
- if (!list->next)
-@@ -921,6 +940,7 @@ ibus_compose_table_serialize (IBusComposeTableEx *compose_table,
- guint16 max_seq_len;
- guint16 index_stride;
- guint16 n_seqs;
-+ guint8 compose_type = 0;
- gsize n_seqs_32bit = 0;
- gsize second_size = 0;
- GVariant *variant_data = NULL;
-@@ -934,8 +954,9 @@ ibus_compose_table_serialize (IBusComposeTableEx *compose_table,
- max_seq_len = compose_table->max_seq_len;
- index_stride = max_seq_len + 2;
- n_seqs = compose_table->n_seqs;
-+ compose_type = compose_table->can_load_en_us ? 1 : 0;
-
-- g_return_val_if_fail (max_seq_len, NULL);
-+ g_return_val_if_fail (max_seq_len || compose_type, NULL);
-
- if (n_seqs) {
- g_return_val_if_fail (compose_table->data, NULL);
-@@ -965,7 +986,7 @@ ibus_compose_table_serialize (IBusComposeTableEx *compose_table,
- n_seqs_32bit = compose_table->priv->first_n_seqs;
- second_size = compose_table->priv->second_size;
- }
-- if (!n_seqs && !n_seqs_32bit) {
-+ if (!n_seqs && !n_seqs_32bit && !compose_type) {
- g_warning ("ComposeTable has not key sequences.");
- goto out_serialize;
- } else if (n_seqs_32bit && !second_size) {
-@@ -1028,7 +1049,7 @@ ibus_compose_table_serialize (IBusComposeTableEx *compose_table,
- sizeof (guint32));
- g_assert (variant_data_32bit_first && variant_data_32bit_second);
- }
-- variant_table = g_variant_new ("(sqqqqqvvv)",
-+ variant_table = g_variant_new ("(sqqqqqvvvy)",
- header,
- version,
- max_seq_len,
-@@ -1037,7 +1058,8 @@ ibus_compose_table_serialize (IBusComposeTableEx *compose_table,
- second_size,
- variant_data,
- variant_data_32bit_first,
-- variant_data_32bit_second);
-+ variant_data_32bit_second,
-+ compose_type);
- return g_variant_ref_sink (variant_table);
-
- out_serialize:
-@@ -1061,7 +1083,8 @@ ibus_compose_table_find (gconstpointer data1,
-
- IBusComposeTableEx *
- ibus_compose_table_deserialize (const char *contents,
-- gsize length)
-+ gsize length,
-+ guint16 *saved_version)
- {
- IBusComposeTableEx *retval = NULL;
- GVariantType *type;
-@@ -1070,9 +1093,9 @@ ibus_compose_table_deserialize (const char *contents,
- GVariant *variant_data_32bit_second = NULL;
- GVariant *variant_table = NULL;
- const char *header = NULL;
-- guint16 version = 0;
- guint16 max_seq_len = 0;
- guint16 n_seqs = 0;
-+ guint8 compose_type = 0;
- guint16 n_seqs_32bit = 0;
- guint16 second_size = 0;
- guint16 index_stride;
-@@ -1083,7 +1106,9 @@ ibus_compose_table_deserialize (const char *contents,
-
- g_return_val_if_fail (contents != NULL, NULL);
- g_return_val_if_fail (length > 0, NULL);
-+ g_assert (saved_version);
-
-+ *saved_version = 0;
- /* Check the cache version at first before load whole the file content. */
- type = g_variant_type_new ("(sq)");
- variant_table = g_variant_new_from_data (type,
-@@ -1100,25 +1125,24 @@ ibus_compose_table_deserialize (const char *contents,
- }
-
- g_variant_ref_sink (variant_table);
-- g_variant_get (variant_table, "(&sq)", &header, &version);
-+ g_variant_get (variant_table, "(&sq)", &header, saved_version);
-
- if (g_strcmp0 (header, IBUS_COMPOSE_TABLE_MAGIC) != 0) {
- g_warning ("cache is not IBusComposeTable.");
- goto out_load_cache;
- }
-
-- if (version != IBUS_COMPOSE_TABLE_VERSION) {
-+ if (*saved_version != IBUS_COMPOSE_TABLE_VERSION) {
- g_warning ("cache version is different: %u != %u",
-- version, IBUS_COMPOSE_TABLE_VERSION);
-+ *saved_version, IBUS_COMPOSE_TABLE_VERSION);
- goto out_load_cache;
- }
-
-- version = 0;
- header = NULL;
- g_variant_unref (variant_table);
- variant_table = NULL;
-
-- type = g_variant_type_new ("(sqqqqqvvv)");
-+ type = g_variant_type_new ("(sqqqqqvvvy)");
- variant_table = g_variant_new_from_data (type,
- contents,
- length,
-@@ -1133,7 +1157,7 @@ ibus_compose_table_deserialize (const char *contents,
- }
-
- g_variant_ref_sink (variant_table);
-- g_variant_get (variant_table, "(&sqqqqqvvv)",
-+ g_variant_get (variant_table, "(&sqqqqqvvvy)",
- NULL,
- NULL,
- &max_seq_len,
-@@ -1142,12 +1166,15 @@ ibus_compose_table_deserialize (const char *contents,
- &second_size,
- &variant_data,
- &variant_data_32bit_first,
-- &variant_data_32bit_second);
-+ &variant_data_32bit_second,
-+ &compose_type);
-
- if (max_seq_len == 0 || (n_seqs == 0 && n_seqs_32bit == 0)) {
-- g_warning ("cache size is not correct %d %d %d",
-- max_seq_len, n_seqs, n_seqs_32bit);
-- goto out_load_cache;
-+ if (!compose_type) {
-+ g_warning ("cache size is not correct %d %d %d",
-+ max_seq_len, n_seqs, n_seqs_32bit);
-+ goto out_load_cache;
-+ }
- }
-
- if (n_seqs && variant_data) {
-@@ -1168,6 +1195,7 @@ ibus_compose_table_deserialize (const char *contents,
- retval->data = data;
- retval->max_seq_len = max_seq_len;
- retval->n_seqs = n_seqs;
-+ retval->can_load_en_us = compose_type ? TRUE : FALSE;
-
- if (n_seqs_32bit && !second_size) {
- g_warning ("32bit key sequences are loaded but the values " \
-@@ -1192,7 +1220,7 @@ ibus_compose_table_deserialize (const char *contents,
- goto out_load_cache;
- }
- }
-- if (!data && !data_32bit_first) {
-+ if (!data && !data_32bit_first && !compose_type) {
- g_warning ("cache data is null.");
- goto out_load_cache;
- }
-@@ -1235,7 +1263,8 @@ out_load_cache:
-
-
- IBusComposeTableEx *
--ibus_compose_table_load_cache (const gchar *compose_file)
-+ibus_compose_table_load_cache (const gchar *compose_file,
-+ guint16 *saved_version)
- {
- IBusComposeTableEx *retval = NULL;
- guint32 hash;
-@@ -1246,6 +1275,8 @@ ibus_compose_table_load_cache (const gchar *compose_file)
- gsize length = 0;
- GError *error = NULL;
-
-+ g_assert (saved_version);
-+ *saved_version = 0;
- do {
- hash = g_str_hash (compose_file);
- if ((path = ibus_compose_hash_get_cache_path (hash)) == NULL)
-@@ -1270,7 +1301,9 @@ ibus_compose_table_load_cache (const gchar *compose_file)
- break;
- }
-
-- retval = ibus_compose_table_deserialize (contents, length);
-+ retval = ibus_compose_table_deserialize (contents,
-+ length,
-+ saved_version);
- if (retval == NULL) {
- g_warning ("Failed to load the cache file: %s", path);
- } else {
-@@ -1369,7 +1402,7 @@ ibus_compose_table_new_with_list (GList *compose_list,
- IBusComposeData *compose_data = NULL;
- IBusComposeTableEx *retval = NULL;
-
-- g_return_val_if_fail (compose_list != NULL, NULL);
-+ g_return_val_if_fail (compose_list, NULL);
-
- s_size_total = g_list_length (compose_list);
- s_size_16bit = s_size_total;
-@@ -1498,6 +1531,7 @@ ibus_compose_table_new_with_list (GList *compose_list,
- retval->n_seqs = s_size_16bit;
- retval->id = hash;
- retval->rawdata = rawdata;
-+ retval->can_load_en_us = FALSE;
- if (s_size_total > s_size_16bit) {
- retval->priv = g_new0 (IBusComposeTablePrivate, 1);
- retval->priv->data_first = ibus_compose_seqs_32bit_first;
-@@ -1515,6 +1549,8 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- GSList *compose_tables)
- {
- GList *compose_list = NULL;
-+ gboolean can_load_en_us = FALSE;
-+ gboolean can_load_en_us_by_any = FALSE;
- IBusComposeTableEx *compose_table;
- int max_compose_len = 0;
- int n_index_stride = 0;
-@@ -1522,13 +1558,29 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- g_assert (compose_file != NULL);
-
- compose_list = ibus_compose_list_parse_file (compose_file,
-- &max_compose_len);
-- if (compose_list == NULL)
-+ &max_compose_len,
-+ &can_load_en_us);
-+ if (compose_list == NULL && !can_load_en_us)
- return NULL;
- n_index_stride = max_compose_len + 2;
-- compose_list = ibus_compose_list_check_duplicated_with_en (compose_list,
-- max_compose_len,
-- compose_tables);
-+ can_load_en_us_by_any = can_load_en_us;
-+ if (!can_load_en_us_by_any) {
-+ GSList *l = compose_tables;
-+ while (l) {
-+ IBusComposeTableEx *table = l->data;
-+ if (table->can_load_en_us) {
-+ can_load_en_us_by_any = TRUE;
-+ break;
-+ }
-+ l = l->next;
-+ }
-+ }
-+ if (can_load_en_us_by_any) {
-+ compose_list = ibus_compose_list_check_duplicated_with_en (
-+ compose_list,
-+ max_compose_len,
-+ compose_tables);
-+ }
- compose_list = g_list_sort_with_data (
- compose_list,
- (GCompareDataFunc) ibus_compose_data_compare,
-@@ -1539,8 +1591,19 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- max_compose_len);
-
- if (compose_list == NULL) {
-- g_warning ("compose file %s does not include any keys besides keys "
-- "in en-us compose file", compose_file);
-+ g_message ("compose file %s does not include any keys besides keys "
-+ "in en-us compose file.\n", compose_file);
-+ if (can_load_en_us) {
-+ if (!(compose_table = g_new0 (IBusComposeTableEx, 1))) {
-+ g_warning ("Failed to alloc IBusComposeTableEx for %s.",
-+ compose_file);
-+ } else {
-+ compose_table->id = g_str_hash (compose_file);
-+ compose_table->can_load_en_us = can_load_en_us;
-+ return compose_table;
-+ }
-+ }
-+
- return NULL;
- }
-
-@@ -1552,6 +1615,8 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- max_compose_len,
- n_index_stride,
- g_str_hash (compose_file));
-+ if (compose_table)
-+ compose_table->can_load_en_us = can_load_en_us;
-
- g_list_free_full (compose_list,
- (GDestroyNotify) ibus_compose_list_element_free);
-@@ -1560,6 +1625,73 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
- }
-
-
-+void
-+ibus_compose_table_free (IBusComposeTableEx *compose_table)
-+{
-+ g_return_if_fail (compose_table);
-+ g_clear_pointer (&compose_table->priv, g_free);
-+ compose_table->data = NULL;
-+ compose_table->max_seq_len = 0;
-+ compose_table->n_seqs = 0;
-+ compose_table->id = 0;
-+ g_clear_pointer (&compose_table->rawdata, g_free);
-+ compose_table->can_load_en_us = FALSE;
-+ g_free (compose_table);
-+
-+}
-+
-+
-+static gboolean
-+rewrite_compose_file (const char *compose_file)
-+{
-+ static const char *prefix =
-+ "# IBus has rewritten this file to add the line:\n"
-+ "\n"
-+ "include \"%L\"\n"
-+ "\n"
-+ "# This is necessary to add your own Compose sequences\n"
-+ "# in addition to the builtin sequences of IBus. If this\n"
-+ "# is not what you want, just remove that line.\n"
-+ "#\n"
-+ "# A backup of the previous file contents has been made.\n"
-+ "\n"
-+ "\n";
-+
-+ char *content = NULL;
-+ gsize content_len;
-+ GFile *file = NULL;
-+ GOutputStream *stream = NULL;
-+ gboolean ret = FALSE;
-+
-+ if (!g_file_get_contents (compose_file, &content, &content_len, NULL))
-+ goto out;
-+
-+ file = g_file_new_for_path (compose_file);
-+ stream = G_OUTPUT_STREAM (g_file_replace (file, NULL, TRUE, 0, NULL, NULL));
-+
-+ if (stream == NULL)
-+ goto out;
-+
-+ if (!g_output_stream_write (stream, prefix, strlen (prefix), NULL, NULL))
-+ goto out;
-+
-+ if (!g_output_stream_write (stream, content, content_len, NULL, NULL))
-+ goto out;
-+
-+ if (!g_output_stream_close (stream, NULL, NULL))
-+ goto out;
-+
-+ ret = TRUE;
-+
-+out:
-+ g_clear_object (&stream);
-+ g_clear_object (&file);
-+ g_clear_pointer (&content, g_free);
-+
-+ return ret;
-+}
-+
-+
- /* if ibus_compose_seqs[N - 1] is an outputed compose character,
- * ibus_compose_seqs[N * 2 - 1] is also an outputed compose character.
- * and ibus_compose_seqs[0] to ibus_compose_seqs[0 + N - 3] are the
-@@ -1609,13 +1741,17 @@ ibus_compose_table_list_add_array (GSList *compose_tables,
-
- GSList *
- ibus_compose_table_list_add_file (GSList *compose_tables,
-- const gchar *compose_file)
-+ const gchar *compose_file,
-+ GError **error)
- {
- guint32 hash;
- IBusComposeTableEx *compose_table;
-+ guint16 saved_version = 0;
-
-- g_return_val_if_fail (compose_file != NULL, compose_tables);
-+ g_return_val_if_fail (compose_file, compose_tables);
-+ g_assert (error);
-
-+ *error = NULL;
- hash = g_str_hash (compose_file);
- if (g_slist_find_custom (compose_tables,
- GINT_TO_POINTER (hash),
-@@ -1623,15 +1759,61 @@ ibus_compose_table_list_add_file (GSList *compose_tables,
- return compose_tables;
- }
-
-- compose_table = ibus_compose_table_load_cache (compose_file);
-+ compose_table = ibus_compose_table_load_cache (compose_file,
-+ &saved_version);
- if (compose_table != NULL)
- return g_slist_prepend (compose_tables, compose_table);
-
-- if ((compose_table = ibus_compose_table_new_with_file (compose_file,
-- compose_tables))
-+parse:
-+ if ((compose_table = ibus_compose_table_new_with_file (compose_file,
-+ compose_tables))
- == NULL) {
-- return compose_tables;
-- }
-+ return compose_tables;
-+ }
-+ if (saved_version > 0 && saved_version < 5 &&
-+ !compose_table->can_load_en_us && compose_table->n_seqs < 100) {
-+ if (rewrite_compose_file (compose_file)) {
-+ g_assert ((*error) == NULL);
-+ *error = g_error_new (
-+ IBUS_COMPOSE_ERROR,
-+ IBUS_ENGINE_MSG_CODE_UPDATE_COMPOSE_TABLE,
-+ _("Since IBus 1.5.33, Compose files replace the "
-+ "builtin\n"
-+ "compose sequences. To keep them and add your own\n"
-+ "sequences on top, the line:\n"
-+ "\n"
-+ " include \"%%L\"\n"
-+ "\n"
-+ "has been added to the Compose file:\n%s.\n"),
-+ compose_file);
-+ ibus_compose_table_free (compose_table);
-+ goto parse;
-+ } else {
-+ gchar *error_message1;
-+ gchar *error_message2;
-+ if (*error) {
-+ error_message1 = g_strdup_printf ("%s\n", (*error)->message);
-+ g_error_free (*error);
-+ } else {
-+ error_message1 = g_strdup ("");
-+ }
-+ error_message2 = g_strdup_printf (
-+ _("Since IBus 1.5.33, Compose files replace the "
-+ "builtin\n"
-+ "compose sequences. To keep them and add your own\n"
-+ "sequences on top, you need to add the line:\n"
-+ "\n"
-+ " include \"%%L\"\n"
-+ "\n"
-+ "to the Compose file:\n%s."), compose_file);
-+ *error = g_error_new (
-+ IBUS_COMPOSE_ERROR,
-+ IBUS_ENGINE_MSG_CODE_UPDATE_COMPOSE_TABLE,
-+ "%s%s", error_message1, error_message2);
-+ g_free (error_message1);
-+ g_free (error_message2);
-+ }
-+ }
-
- ibus_compose_table_save_cache (compose_table);
- return g_slist_prepend (compose_tables, compose_table);
-@@ -2091,3 +2273,10 @@ ibus_keysym_to_unicode_with_layout (guint keysym,
- #undef CASE_KEYSYM
- return ibus_keysym_to_unicode (keysym, combining, need_space);
- }
-+
-+
-+GQuark
-+ibus_compose_error_quark (void)
-+{
-+ return g_quark_from_static_string ("ibus-compose-error-quark");
-+}
-diff --git a/src/ibuscomposetable.h b/src/ibuscomposetable.h
-index 32e337f7..2068657d 100644
---- a/src/ibuscomposetable.h
-+++ b/src/ibuscomposetable.h
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2013-2014 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
-@@ -23,8 +23,19 @@
- #ifndef __IBUS_COMPOSETABLE_H_
- #define __IBUS_COMPOSETABLE_H_
-
--#include <glib.h>
-+/**
-+ * SECTION: ibuscomposetable
-+ * @short_description: Compose table handling based on libX11
-+ * @title: IBusComposeTable
-+ * @stability: Unstable
-+ *
-+ * Generate #IBusComposeTableEx with the compose file or array.
-+ *
-+ * see_also: #IBusEngineSimple
-+ *
-+ */
-
-+#include <glib.h>
-
- G_BEGIN_DECLS
-
-@@ -53,6 +64,7 @@ struct _IBusComposeTableEx
- gint n_seqs;
- guint32 id;
- char *rawdata;
-+ gboolean can_load_en_us;
- };
-
-
-@@ -71,8 +83,11 @@ IBusComposeTableEx *
- ibus_compose_table_new_with_file (const gchar *compose_file,
- GSList
- *compose_tables);
-+void ibus_compose_table_free (IBusComposeTableEx
-+ *compose_table);
- IBusComposeTableEx *
-- ibus_compose_table_load_cache (const gchar *compose_file);
-+ ibus_compose_table_load_cache (const gchar *compose_file,
-+ guint16 *saved_version);
- void ibus_compose_table_save_cache (IBusComposeTableEx
- *compose_table);
- GSList * ibus_compose_table_list_add_array
-@@ -84,7 +99,8 @@ GSList * ibus_compose_table_list_add_array
- gint n_seqs);
- GSList * ibus_compose_table_list_add_file (GSList
- *compose_tables,
-- const gchar *compose_file);
-+ const gchar *compose_file,
-+ GError **error);
- GSList * ibus_compose_table_list_add_table (GSList
- *compose_tables,
- IBusComposeTableEx
-diff --git a/src/ibusengine.h b/src/ibusengine.h
-index cdc96331..6d0c1d1f 100644
---- a/src/ibusengine.h
-+++ b/src/ibusengine.h
-@@ -71,6 +71,8 @@ G_BEGIN_DECLS
- * @IBUS_ENGINE_MSG_CODE_GENERAL: Generic message for Engine
- * @IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE: User's typing failure
- * against the definition of the compose files.
-+ * @IBUS_ENGINE_MSG_CODE_UPDATE_COMPOSE_TABLE: Notification about new
-+ * behaviors or attentions when the compose table version is changed.
- *
- * Message codes in the `IBusMessageDomain` domain for Engine
- * See also #IBusMessage, ibus_engine_send_message()
-@@ -81,7 +83,8 @@ G_BEGIN_DECLS
- typedef enum
- {
- IBUS_ENGINE_MSG_CODE_GENERAL,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ IBUS_ENGINE_MSG_CODE_UPDATE_COMPOSE_TABLE
- } IBusEngineMsgCode;
-
- typedef struct _IBusEngine IBusEngine;
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 258bd849..7bee2403 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -139,6 +139,7 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- GError *error = NULL;
- const char *contents;
- gsize length = 0;
-+ guint16 saved_version = 0;
-
- ibus_object_class->destroy =
- (IBusObjectDestroyFunc) ibus_engine_simple_destroy;
-@@ -168,7 +169,14 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- return;
- }
- contents = g_bytes_get_data (data, &length);
-- en_compose_table = ibus_compose_table_deserialize (contents, length);
-+ en_compose_table = ibus_compose_table_deserialize (contents,
-+ length,
-+ &saved_version);
-+ if (!en_compose_table && saved_version) {
-+ g_warning ("Failed to parse the builtin compose due to the different "
-+ "version %u. Please rebuild IBus resource files.",
-+ saved_version);
-+ }
- }
-
-
-@@ -237,7 +245,8 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple)
-
- static void
- ibus_engine_simple_send_message_with_code (IBusEngineSimple *simple,
-- IBusEngineMsgCode code)
-+ IBusEngineMsgCode code,
-+ GError *error)
- {
- IBusEngineSimplePrivate *priv;
- IBusMessage *message;
-@@ -245,18 +254,33 @@ ibus_engine_simple_send_message_with_code (IBusEngineSimple *simple,
- g_return_if_fail (IBUS_IS_ENGINE_SIMPLE (simple));
-
- priv = simple->priv;
-- priv->do_inform_user_error = TRUE;
-- message = ibus_message_new (
-- IBUS_MESSAGE_DOMAIN_ENGINE,
-- code,
-- _("Detect unregistered character in your compose sequence"),
-- _("The character you just input is not recognized as a valid " \
-- "part of the currently active compose sequence and the " \
-- "character was cancelled. Try inputting the correct character " \
-- "to the compose sequence again, or press Escape key to " \
-- "terminate whole the compose sequence."),
-- "timeout", 5,
-- NULL);
-+ switch (code) {
-+ case IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE:
-+ priv->do_inform_user_error = TRUE;
-+ message = ibus_message_new (
-+ IBUS_MESSAGE_DOMAIN_ENGINE,
-+ code,
-+ _("Detect unregistered character in your compose sequence"),
-+ _("The character you just input is not recognized as a valid " \
-+ "part of the currently active compose sequence and the " \
-+ "character was cancelled. Try inputting the correct " \
-+ "character to the compose sequence again, or press Escape " \
-+ "key to terminate whole the compose sequence."),
-+ "timeout", 5,
-+ NULL);
-+ break;
-+ case IBUS_ENGINE_MSG_CODE_UPDATE_COMPOSE_TABLE:
-+ message = ibus_message_new (
-+ IBUS_MESSAGE_DOMAIN_ENGINE,
-+ code,
-+ _("Compose file update"),
-+ error ? error->message : "",
-+ "timeout", 120,
-+ NULL);
-+ break;
-+ default:
-+ g_assert_not_reached ();
-+ }
- ibus_engine_send_message (IBUS_ENGINE (simple), message);
- }
-
-@@ -853,7 +877,8 @@ no_sequence_matches (IBusEngineSimple *simple,
- /* Invalid sequence */
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- ibus_engine_simple_update_preedit_text (simple);
- return TRUE;
- }
-@@ -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;
-+ gboolean can_load_en_us = FALSE;
- gunichar output_char = '\0';
-
- /* GtkIMContextSimple output the first compose char in case of
-@@ -1008,27 +1034,40 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
- G_LOCK (global_tables);
- tmp_list = global_tables;
- while (tmp_list) {
-+ IBusComposeTableEx *compose_table = tmp_list->data;
-+ if (compose_table->can_load_en_us)
-+ can_load_en_us = TRUE;
-+ /* If global_tables includes en_compose_table only, i.e. no user
-+ * or locale compose tables, en_compose_table is used.
-+ * If not, en_compose_table is used in case one of the other compose
-+ * tables has can_load_en_us = %TRUE, i.e. the table file has
-+ * the line of 'include "%L"'.
-+ * en_compose_table is always appended to the last of global_tables.
-+ */
-+ if ((compose_table == en_compose_table) && global_tables->next != NULL
-+ && !can_load_en_us) {
-+ tmp_list = tmp_list->next;
-+ continue;
-+ }
- is_32bit = FALSE;
-- if (ibus_compose_table_check (
-- (IBusComposeTableEx *)tmp_list->data,
-- priv->compose_buffer,
-- n_compose,
-- &compose_finish,
-- &compose_match,
-- output,
-- is_32bit)) {
-+ if (ibus_compose_table_check (compose_table,
-+ priv->compose_buffer,
-+ n_compose,
-+ &compose_finish,
-+ &compose_match,
-+ output,
-+ is_32bit)) {
- success = TRUE;
- break;
- }
- is_32bit = TRUE;
-- if (ibus_compose_table_check (
-- (IBusComposeTableEx *)tmp_list->data,
-- priv->compose_buffer,
-- n_compose,
-- &compose_finish,
-- &compose_match,
-- output,
-- is_32bit)) {
-+ if (ibus_compose_table_check (compose_table,
-+ priv->compose_buffer,
-+ n_compose,
-+ &compose_finish,
-+ &compose_match,
-+ output,
-+ is_32bit)) {
- success = TRUE;
- break;
- }
-@@ -1134,7 +1173,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- /* invalid hex sequence */
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -1159,7 +1199,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- /* invalid hex sequence */
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -1210,7 +1251,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- /* invalid hex sequence */
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- g_string_set_size (priv->tentative_match, 0);
- g_clear_pointer (&priv->tentative_emoji, g_free);
- priv->in_hex_sequence = FALSE;
-@@ -1311,7 +1353,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- if (n_compose > 0) {
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
-@@ -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,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- return TRUE;
- }
- } else if (priv->in_emoji_sequence) {
-@@ -1439,7 +1483,8 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- /* invalid hex sequence */
- ibus_engine_simple_send_message_with_code (
- simple,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- g_string_set_size (priv->tentative_match, 0);
- priv->in_hex_sequence = FALSE;
- priv->compose_buffer[0] = 0;
-@@ -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,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- }
- ibus_engine_simple_update_preedit_text (simple);
-
-@@ -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,
-- IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE);
-+ IBUS_ENGINE_MSG_CODE_INVALID_COMPOSE_SEQUENCE,
-+ NULL);
- backup_char = priv->compose_buffer[n_compose];
- priv->compose_buffer[n_compose] = 0;
- if (ibus_engine_simple_check_all_compose_table (simple, n_compose))
-@@ -1742,9 +1789,19 @@ gboolean
- ibus_engine_simple_add_compose_file (IBusEngineSimple *simple,
- const gchar *compose_file)
- {
-- g_return_val_if_fail (IBUS_IS_ENGINE_SIMPLE (simple), TRUE);
-+ GError *error = NULL;
-+
-+ g_return_val_if_fail (IBUS_IS_ENGINE_SIMPLE (simple), FALSE);
-
- global_tables = ibus_compose_table_list_add_file (global_tables,
-- compose_file);
-+ compose_file,
-+ &error);
-+ if (error) {
-+ g_warning ("\n%s\n", error->message);
-+ ibus_engine_simple_send_message_with_code (simple,
-+ error->code,
-+ error);
-+ g_error_free (error);
-+ }
- return TRUE;
- }
-diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index c01d2eb1..c3f92920 100644
---- a/src/ibusenginesimpleprivate.h
-+++ b/src/ibusenginesimpleprivate.h
-@@ -26,6 +26,15 @@
-
- G_BEGIN_DECLS
-
-+/**
-+ * IBUS_COMPOSE_ERROR:
-+ *
-+ * The `GQuark` used for `IBusComposeTableEx` errors.
-+ *
-+ * Since: 1.5.33
-+ */
-+#define IBUS_COMPOSE_ERROR (ibus_compose_error_quark ())
-+
- /* Checks if a keysym is a dead key. Dead key keysym values are defined in
- * ibuskeysyms.h and the first is GDK_KEY_dead_grave.
- */
-@@ -42,6 +51,13 @@ struct _IBusComposeTablePrivate
- };
-
-
-+/**
-+ * ibus_compose_error_quark:
-+ *
-+ * Since: 1.5.33
-+ * Stability: Unstable
-+ */
-+GQuark ibus_compose_error_quark (void);
- guint ibus_compose_key_flag (guint key);
- gboolean ibus_check_algorithmically (const guint *compose_buffer,
- int n_compose,
-@@ -54,7 +70,8 @@ GVariant *
- IBusComposeTableEx *
- ibus_compose_table_deserialize
- (const char *contents,
-- gsize length);
-+ gsize length,
-+ guint16 *saved_version);
- gboolean ibus_compose_table_check (const IBusComposeTableEx *table,
- guint *compose_buffer,
- int n_compose,
-diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c
-index 326d3b90..c07c02c4 100644
---- a/src/tests/ibus-compose.c
-+++ b/src/tests/ibus-compose.c
-@@ -241,9 +241,13 @@ create_engine_cb (IBusFactory *factory,
- else
- compose_path = get_compose_path ();
- if (compose_path != NULL) {
-+ guint16 saved_version = 0;
- ibus_engine_simple_add_compose_file (IBUS_ENGINE_SIMPLE (m_engine),
- compose_path);
-- m_compose_table = ibus_compose_table_load_cache (compose_path);
-+ m_compose_table = ibus_compose_table_load_cache (compose_path,
-+ &saved_version);
-+ if (m_compose_table)
-+ g_assert (saved_version);
- }
- g_free (compose_path);
- return m_engine;
---
-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
-
-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
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : 8f31308236e71b333e91495ddbdddf1e69401b59
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-03-19T13:51:50+09:00
Stats : +0/-542 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/8f31308236e71b333e91495ddbdddf1e69401b59?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index eada3fc..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,542 +0,0 @@
-From 646cf459902c35268901a8713cd7cd88a4cf7cf9 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 5 Mar 2025 08:41:34 +0900
-Subject: [PATCH] client/gtk2: Revert "Add a pad to the cursor height in Wayland"
-
-Fix the regression in gnome-shell.
-
-BUG=https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8228
-Fixes: https://github.com/ibus/ibus/commit/c38d82f
----
- client/gtk2/ibusimcontext.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index a45aae92..266fa6fe 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -1693,14 +1693,12 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
- #endif
-
- if (GDK_IS_WAYLAND_DISPLAY (display)) {
-- area.y += area.height / 2;
- ibus_input_context_set_cursor_location_relative (
- ibusimcontext->ibuscontext,
- area.x,
- area.y,
- area.width,
- area.height);
--
- } else {
- #endif
- ibus_input_context_set_cursor_location (ibusimcontext->ibuscontext,
---
-2.47.0
-
-From da4d7c19e474d0e69c6e35116c625765cc377c7d Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 9 Mar 2025 10:08:44 +0900
-Subject: [PATCH] bus: Send FocusIn signal again after delayed FocusId property
-
-The FocusId D-Bus property is checked after both bus/EngineProxy
-and src/IBusEngine is generated with an idle then the first
-FocusIn D-Bus signal is sent without checking the FocusId property
-when ibus-daemon runs.
-The solution is to send the FocusIn signal again in case the
-FocusId property is TRUE.
-
-BUG=https://github.com/ibus/ibus/pull/2717
----
- bus/engineproxy.c | 26 ++++++++++++++++++++++++--
- 1 file changed, 24 insertions(+), 2 deletions(-)
-
-diff --git a/bus/engineproxy.c b/bus/engineproxy.c
-index 20f89cef..fa15d2e7 100644
---- a/bus/engineproxy.c
-+++ b/bus/engineproxy.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -61,6 +61,8 @@ struct _BusEngineProxy {
- IBusPropList *prop_list;
- gboolean has_focus_id;
- gboolean has_active_surrounding_text;
-+ gchar *object_path;
-+ gchar *client;
- };
-
- struct _BusEngineProxyClass {
-@@ -1391,6 +1393,8 @@ _get_has_focus_id_cb (GObject *object,
- hash_table,
- (gpointer)ibus_engine_desc_get_name (engine->desc),
- value);
-+ if (engine->has_focus)
-+ g_signal_emit (engine, engine_signals[REQUIRE_SURROUNDING_TEXT], 0);
- }
- g_hash_table_unref (hash_table);
- }
-@@ -1436,6 +1440,18 @@ _get_active_surrounding_text_cb (GObject *object,
- hash_table,
- (gpointer)ibus_engine_desc_get_name (engine->desc),
- value);
-+ if (engine->has_focus_id && engine->object_path) {
-+ gchar *object_path = g_strdup (engine->object_path);
-+ gchar *client = g_strdup (engine->client);
-+
-+ engine->has_focus = FALSE;
-+ /* Send the FocusIn D-Bus signal again after the delayed FocusId
-+ * D-Bus property.
-+ */
-+ bus_engine_proxy_focus_in (engine, object_path, client);
-+ g_free (object_path);
-+ g_free (client);
-+ }
- }
- g_hash_table_unref (hash_table);
- }
-@@ -1479,9 +1495,13 @@ bus_engine_proxy_focus_in (BusEngineProxy *engine,
- const gchar *client)
- {
- g_assert (BUS_IS_ENGINE_PROXY (engine));
-- if (engine->has_focus)
-+ if (engine->has_focus && !g_strcmp0 (object_path, engine->object_path))
- return;
- engine->has_focus = TRUE;
-+ g_free (engine->object_path);
-+ g_free (engine->client);
-+ engine->object_path = g_strdup (object_path);
-+ engine->client = g_strdup (client);
- if (engine->has_active_surrounding_text)
- g_signal_emit (engine, engine_signals[REQUIRE_SURROUNDING_TEXT], 0);
- if (engine->has_focus_id) {
-@@ -1513,6 +1533,8 @@ bus_engine_proxy_focus_out (BusEngineProxy *engine,
- if (!engine->has_focus)
- return;
- engine->has_focus = FALSE;
-+ g_clear_pointer (&engine->object_path, g_free);
-+ g_clear_pointer (&engine->client, g_free);
- if (engine->has_focus_id) {
- g_dbus_proxy_call ((GDBusProxy *)engine,
- "FocusOutId",
---
-2.47.0
-
-From 5797150892317a30e37756ee62ae4fd644700dfc Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 14 Mar 2025 21:00:38 +0900
-Subject: [PATCH] ui/gtk3: Fix time lag of CandidatePanel in X11
-
-The timed `set_lookup_table()` is a workaround with the Wayland
-input-method protocol under the construction to stop the many D-Bus
-methods but it should not affect Xorg UI at least.
-
-Now `m_is_wayland flag` is inherited to the CandidatePanel and Switcher
-and add `m_first_set_lookup_table` flag newly to enhance the lag
-with the Wayland input-method protocol.
-
-Also fix compile warnings with `valac` in `xkblayout.vala`.
-
-Fixes: https://github.com/ibus/ibus/commit/d5e6e71
-BUG=https://github.com/ibus/ibus/issues/2740
----
- ui/gtk3/candidatepanel.vala | 63 ++++++++++++++++++++++++++++++++-----
- ui/gtk3/panel.vala | 5 +--
- ui/gtk3/switcher.vala | 25 ++++++++-------
- ui/gtk3/xkblayout.vala | 34 ++++++++++----------
- 4 files changed, 90 insertions(+), 37 deletions(-)
-
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index f2447703..5ba8cf36 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -36,9 +36,10 @@ public class CandidatePanel : Gtk.Box{
-
- private Pango.Attribute m_language_attribute;
- private uint m_update_id;
-+ private bool m_is_wayland;
-+ private bool m_no_wayland_panel;
-
- #if USE_GDK_WAYLAND
-- private bool m_no_wayland_panel;
- private bool m_hide_after_show;
- private uint m_prev_page_size;
- private uint m_prev_ncandidates;
-@@ -48,6 +49,7 @@ public class CandidatePanel : Gtk.Box{
- private uint m_set_preedit_text_id;
- private uint m_set_auxiliary_text_id;
- private uint m_set_lookup_table_id;
-+ private bool m_first_set_lookup_table;
- #endif
-
- public signal void cursor_up();
-@@ -64,7 +66,8 @@ public class CandidatePanel : Gtk.Box{
- public signal void realize_surface(void *surface);
- #endif
-
-- public CandidatePanel(bool no_wayland_panel) {
-+ public CandidatePanel(bool is_wayland,
-+ bool no_wayland_panel) {
- // Call base class constructor
- GLib.Object(
- name : "IBusCandidate",
-@@ -72,9 +75,8 @@ public class CandidatePanel : Gtk.Box{
- visible: true
- );
-
--#if USE_GDK_WAYLAND
-+ m_is_wayland = is_wayland;
- m_no_wayland_panel = no_wayland_panel;
--#endif
- m_toplevel = new Gtk.Window(Gtk.WindowType.POPUP);
- m_toplevel.add_events(Gdk.EventMask.BUTTON_PRESS_MASK);
- m_toplevel.button_press_event.connect((w, e) => {
-@@ -87,7 +89,7 @@ public class CandidatePanel : Gtk.Box{
- adjust_window_position(w);
- });
- #if USE_GDK_WAYLAND
-- if (!BindingCommon.default_is_xdisplay()) {
-+ if (m_is_wayland) {
- m_toplevel.realize.connect((w) => {
- realize_window(true);
- });
-@@ -201,6 +203,10 @@ public class CandidatePanel : Gtk.Box{
- }
-
- public void set_preedit_text(IBus.Text? text, uint cursor) {
-+ if (!m_is_wayland) {
-+ set_preedit_text_real(text, cursor);
-+ return;
-+ }
- #if USE_GDK_WAYLAND
- if (m_set_preedit_text_id > 0)
- GLib.Source.remove(m_set_preedit_text_id);
-@@ -238,6 +244,10 @@ public class CandidatePanel : Gtk.Box{
- }
-
- public void set_auxiliary_text(IBus.Text? text) {
-+ if (!m_is_wayland) {
-+ set_auxiliary_text_real(text);
-+ return;
-+ }
- #if USE_GDK_WAYLAND
- if (m_set_auxiliary_text_id > 0)
- GLib.Source.remove(m_set_auxiliary_text_id);
-@@ -269,6 +279,10 @@ public class CandidatePanel : Gtk.Box{
- }
-
- public void set_lookup_table(IBus.LookupTable? table) {
-+ if (!m_is_wayland) {
-+ set_lookup_table_real(table);
-+ return;
-+ }
- #if USE_GDK_WAYLAND
- if (m_set_lookup_table_id > 0) {
- if (table == null ||
-@@ -282,14 +296,25 @@ public class CandidatePanel : Gtk.Box{
- }
- }
- if (table != null) {
-+ if (m_prev_ncandidates == 0)
-+ m_first_set_lookup_table = true;
- m_prev_page_size = table.get_page_size();
- m_prev_ncandidates = table.get_number_of_candidates();
- m_prev_cursor = table.get_cursor_pos();
- m_prev_cursor_in_page = table.get_cursor_in_page();
- m_prev_show_cursor = table.is_cursor_visible();
-+ } else {
-+ m_prev_page_size = m_prev_ncandidates = m_prev_cursor =
-+ m_prev_cursor_in_page = 0;
-+ m_prev_show_cursor = false;
- }
- // FIXME: Too many PreeditText D-Bus signal happens in Wayland.
- m_set_lookup_table_id = Timeout.add(100,
-+ // FIXME: If m_set_lookup_table_id
-+ // == 0, delete the queued timed
-+ // callbacks to avoid the last
-+ // reverse cursor move after the
-+ // key release.
- () => {
- m_set_lookup_table_id = 0;
- set_lookup_table_real(table);
-@@ -353,9 +378,33 @@ public class CandidatePanel : Gtk.Box{
- }
-
- private void update() {
-+ if (!m_is_wayland) {
-+ update_real();
-+ return;
-+ }
-+#if USE_GDK_WAYLAND
-+ // Show the first lookup table immediately with the Wayland
-+ // input-method protocol because keeping pressing the space key
-+ // causes many update() and the timed update_real() is not called
-+ // until the space key is released.
-+ if (m_first_set_lookup_table) {
-+ m_first_set_lookup_table = false;
-+ if (m_update_id > 0) {
-+ GLib.Source.remove(m_update_id);
-+ m_update_id = 0;
-+ }
-+ update_real();
-+ return;
-+ }
-+#endif
- if (m_update_id > 0)
- GLib.Source.remove(m_update_id);
-- // set_lookup_table() and set_preedit_text() happens sequentially.
-+ // - set_lookup_table() and set_preedit_text() happens sequentially.
-+ // - Hide CandidatePanel after a candidate is committed with Emojier
-+ // and xterm without the Wayland panel in the Wayland input-method V2.
-+ // - Don't show the hidden lookup table unexpectedly again after
-+ // a candidate is committed with the Wayland applications in the
-+ // Wayland input-method V2.
- m_update_id = Timeout.add(100,
- () => {
- m_update_id = 0;
-@@ -436,7 +485,7 @@ public class CandidatePanel : Gtk.Box{
-
- public new void hide() {
- #if USE_GDK_WAYLAND
-- if (!BindingCommon.default_is_xdisplay())
-+ if (m_is_wayland)
- realize_surface(null);
- #endif
- m_toplevel.hide();
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 186b3ac9..e42a166e 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -173,7 +173,8 @@ class Panel : IBus.PanelService {
- }
-
- private CandidatePanel candidate_panel_new(bool no_wayland_panel) {
-- CandidatePanel candidate_panel = new CandidatePanel(no_wayland_panel);
-+ CandidatePanel candidate_panel = new CandidatePanel(m_is_wayland,
-+ no_wayland_panel);
- candidate_panel.page_up.connect((w) => this.page_up());
- candidate_panel.page_down.connect((w) => this.page_down());
- candidate_panel.cursor_up.connect((w) => this.cursor_up());
-@@ -190,7 +191,7 @@ class Panel : IBus.PanelService {
- }
-
- private Switcher switcher_new(bool no_wayland_panel) {
-- Switcher switcher = new Switcher(no_wayland_panel);
-+ Switcher switcher = new Switcher(m_is_wayland, no_wayland_panel);
- #if USE_GDK_WAYLAND
- switcher.realize_surface.connect(
- (w, s) => this.realize_surface(s));
-diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
-index 13eeb481..99a2fa0b 100644
---- a/ui/gtk3/switcher.vala
-+++ b/ui/gtk3/switcher.vala
-@@ -96,6 +96,7 @@ class Switcher : Gtk.Window {
- private double m_mouse_init_x;
- private double m_mouse_init_y;
- private bool m_mouse_moved;
-+ private bool m_is_wayland;
- private bool m_no_wayland_panel;
- private GLib.HashTable<string, string> m_xkb_languages =
- new GLib.HashTable<string, string>(GLib.str_hash,
-@@ -106,16 +107,19 @@ class Switcher : Gtk.Window {
- public signal void realize_surface(void *surface);
- #endif
-
-- public Switcher(bool no_wayland_panel) {
-+ public Switcher(bool is_wayland,
-+ bool no_wayland_panel) {
- GLib.Object(
- type : Gtk.WindowType.POPUP,
-- events : Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK,
-+ events : Gdk.EventMask.KEY_PRESS_MASK |
-+ Gdk.EventMask.KEY_RELEASE_MASK,
- window_position : Gtk.WindowPosition.CENTER,
- accept_focus : true,
- decorated : false,
- modal : true,
- focus_visible : true
- );
-+ m_is_wayland = is_wayland;
- m_no_wayland_panel = no_wayland_panel;
- Gtk.Box vbox = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
- add(vbox);
-@@ -139,7 +143,7 @@ class Switcher : Gtk.Window {
- vbox.pack_end(m_label, false, false, 0);
-
- #if USE_GDK_WAYLAND
-- if (!BindingCommon.default_is_xdisplay()) {
-+ if (m_is_wayland) {
- this.realize.connect((w) => {
- realize_window(true);
- });
-@@ -381,12 +385,8 @@ class Switcher : Gtk.Window {
- return false;
- }
- m_mouse_moved = true;
--#if USE_GDK_WAYLAND
-- if (BindingCommon.default_is_xdisplay())
-+ if (!m_is_wayland)
- button.grab_focus();
--#else
-- button.grab_focus();
--#endif
- m_selected_engine = index;
- return false;
- });
-@@ -571,7 +571,7 @@ class Switcher : Gtk.Window {
- // if e.type == Gdk.EventType.KEY_RELEASE, m_loop is already null.
- // m_loop is always null in Wayland but this signal is not emitted
- // when the Wayland panel protocol is enabled.
-- if (m_loop == null && !m_no_wayland_panel)
-+ if (m_loop == null && !m_is_wayland)
- return Gdk.EVENT_PROPAGATE;
-
- if (m_popup_delay_time > 0) {
-@@ -582,9 +582,9 @@ class Switcher : Gtk.Window {
- }
-
- m_result = (int)m_selected_engine;
-- if (!m_no_wayland_panel) {
-+ if (!m_is_wayland) {
- m_loop.quit();
-- } else {
-+ } else if (m_no_wayland_panel) {
- // Switcher without the Wayland panel protocol can return
- // the m_result_engine immediately in Wayland without waiting
- // for the focus-in event due to a virtual input context in
-@@ -592,6 +592,9 @@ class Switcher : Gtk.Window {
- GLib.assert(m_result < m_engines.length);
- m_result_engine = m_engines[m_result];
- hide();
-+ } else {
-+ // Switcher should not get focus with the Wayland panel protocol.
-+ GLib.assert_not_reached();
- }
- return Gdk.EVENT_STOP;
- }
-diff --git a/ui/gtk3/xkblayout.vala b/ui/gtk3/xkblayout.vala
-index 874920ee..598431c3 100644
---- a/ui/gtk3/xkblayout.vala
-+++ b/ui/gtk3/xkblayout.vala
-@@ -48,6 +48,11 @@ class XKBLayout
- public void get_layout(out string layout,
- out string variant,
- out string option) {
-+ layout = "";
-+ variant = "";
-+ var o = Environment.get_variable("XKB_DEFAULT_OPTIONS");
-+ option = o != null ? o : "";
-+
- search_get_layout_program();
- if (m_get_layout_args[0] == null) {
- warning("Not found localectl or setxkbmap command in PATH");
-@@ -60,11 +65,6 @@ class XKBLayout
- string standard_error = null;
- int exit_status = 0;
-
-- layout = "";
-- variant = "";
-- var o = Environment.get_variable("XKB_DEFAULT_OPTIONS");
-- option = o != null ? o : "";
--
- try {
- GLib.Process.spawn_sync(null,
- exec_command,
-@@ -84,14 +84,14 @@ class XKBLayout
-
- if (exec_command[0] == "localectl") {
- parse_localectl_status_str(standard_output,
-- out layout,
-- out variant,
-- out option);
-+ ref layout,
-+ ref variant,
-+ ref option);
- } else if (exec_command[0] == XKB_COMMAND) {
- parse_xkbmap_query_str(standard_output,
-- out layout,
-- out variant,
-- out option);
-+ ref layout,
-+ ref variant,
-+ ref option);
- }
- }
-
-@@ -113,9 +113,9 @@ class XKBLayout
-
-
- private void parse_localectl_status_str(string standard_output,
-- out string layout,
-- out string variant,
-- out string option) {
-+ ref string layout,
-+ ref string variant,
-+ ref string option) {
- foreach (string line in standard_output.split("\n")) {
- const string[] elements = { "X11 Layout:", "X11 Variant:" };
- foreach (unowned string element in elements) {
-@@ -136,9 +136,9 @@ class XKBLayout
-
-
- private void parse_xkbmap_query_str(string standard_output,
-- out string layout,
-- out string variant,
-- out string option) {
-+ ref string layout,
-+ ref string variant,
-+ ref string option) {
- foreach (string line in standard_output.split("\n")) {
- const string[] elements = { "layout:", "variant:", "options:" };
- foreach (unowned string element in elements) {
---
-2.47.0
-
-From 1d56d77b19daf5c8d6f3ee87a0712ae5904293f4 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 14 Mar 2025 21:00:52 +0900
-Subject: [PATCH] client/wayland: Fix infinite Return key in xterm
-
-Currently the repeating key feature of IBus is disabled when the focus
-is changed but the feature of the Wayland compositor still happens in
-the Sway desktop session when invoke xterm by manual in foot.
-I think Sway should stop the repeating key feature when the focus is
-changed from the Wayland application to the non-Wayland application.
-
-I add a workaround to call `zwp_virtual_keyboard_v1_key()` with
-the `WL_KEYBOARD_KEY_STATE_RELEASED` flag to stop the feature of
-the Sway compositor after the IBus repeating key timeout.
----
- client/wayland/ibuswaylandim.c | 11 +++++++++++
- 1 file changed, 11 insertions(+)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index ba392c6b..356cec31 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -1332,6 +1332,17 @@ _process_key_event_repeat_delay_cb (gpointer user_data)
- /* The key release event was sent to non-Wayland apps likes xterm. */
- if (!priv->ibuscontext) {
- event->count_cb_id = 0;
-+ /* Stop the infinite Return keys in non-Wayland apps likes xterm in
-+ * the Sway desktop session.
-+ * But priv->context in NULL in the Wayland input-method V1 here.
-+ */
-+ if (priv->version != INPUT_METHOD_V1) {
-+ ibus_wayland_im_key(event->wlim,
-+ event->serial,
-+ event->time + priv->repeat_delay,
-+ event->key,
-+ WL_KEYBOARD_KEY_STATE_RELEASED);
-+ }
- return G_SOURCE_REMOVE;
- }
- /* The focus is changed. */
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : 78eaecf314e4f249366cec85438db15375420f98
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-02-27T23:53:50+09:00
Stats : +0/-82 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/78eaecf314e4f249366cec85438db15375420f98?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 37bda4d..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 338968012c3869bc5ce9eac6733f430a3fc69c79 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 14 Feb 2025 12:59:41 +0900
-Subject: [PATCH] tools: Fix ibus start with verbose typo
-
-Fixes: https://github.com/ibus/ibus/commit/c5748e6
-BUG=rhbz#2342280
----
- tools/main.vala | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/tools/main.vala b/tools/main.vala
-index 3c0ea648..5716247d 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -259,8 +259,9 @@ bool start_daemon_in_wayland(bool restart,
- string[] _argv) {
-
- check_wayland_protocols();
-- if (!is_wayland_session && verbose) {
-- stderr.printf("Cannot find the Wayland input-method protocol.\n");
-+ if (!is_wayland_session) {
-+ if (verbose)
-+ stderr.printf("Cannot find the Wayland input-method protocol.\n");
- return false;
- }
-
---
-2.47.0
-
-From fb4d7baf7e45c84a6d2b1d8701e24087c742c285 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 19 Feb 2025 01:18:39 +0900
-Subject: [PATCH] ui/gtk3: Fix SEGV in Xorg without IBusWaylandIM
-
----
- ui/gtk3/application.vala | 14 ++++++++------
- ui/gtk3/candidatepanel.vala | 3 ++-
- 2 files changed, 10 insertions(+), 7 deletions(-)
-
-diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala
-index 8f688920..82cc5397 100644
---- a/ui/gtk3/application.vala
-+++ b/ui/gtk3/application.vala
-@@ -101,12 +101,14 @@ class Application {
- if (m_log != null)
- m_panel.set_log(m_log, m_verbose);
- #if USE_GDK_WAYLAND
-- m_realize_surface_id = m_panel.realize_surface.connect(
-- (w, s) => this.set_wayland_surface(s));
-- m_ibus_focus_in_id = m_wayland_im.ibus_focus_in.connect(
-- (w, o) => m_panel.set_wayland_object_path(o));
-- m_ibus_focus_out_id = m_wayland_im.ibus_focus_out.connect(
-- (w, o) => m_panel.set_wayland_object_path(null));
-+ if (m_wayland_im != null) {
-+ m_realize_surface_id = m_panel.realize_surface.connect(
-+ (w, s) => this.set_wayland_surface(s));
-+ m_ibus_focus_in_id = m_wayland_im.ibus_focus_in.connect(
-+ (w, o) => m_panel.set_wayland_object_path(o));
-+ m_ibus_focus_out_id = m_wayland_im.ibus_focus_out.connect(
-+ (w, o) => m_panel.set_wayland_object_path(null));
-+ }
- #endif
- m_panel.load_settings();
- }
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index 092fdc82..f2447703 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -436,7 +436,8 @@ public class CandidatePanel : Gtk.Box{
-
- public new void hide() {
- #if USE_GDK_WAYLAND
-- realize_surface(null);
-+ if (!BindingCommon.default_is_xdisplay())
-+ realize_surface(null);
- #endif
- m_toplevel.hide();
- }
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : ec18df2f392f98aa112d868849c96e85e93aefc2
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2025-02-07T09:27:44+09:00
Stats : +0/-302 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/ec18df2f392f98aa112d868849c96e85e93aefc2?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 6c9f183..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,302 +0,0 @@
-From c5748e6257e7f203595784e9a10e144e86379a80 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 21 Jan 2025 20:37:20 +0900
-Subject: [PATCH] client/wayland: Fix repeating key between focus
-
----
- client/wayland/ibuswaylandim.c | 22 ++++++++++++++++++++++
- tools/main.vala | 4 +++-
- 2 files changed, 25 insertions(+), 1 deletion(-)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index 98efb1cb..066f7cbd 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -161,6 +161,7 @@ struct _IBusWaylandKeyEvent
- int count;
- guint count_cb_id;
- guint repeat_rate_id;
-+ char *ibus_object_path;
- gboolean retval;
- };
- typedef struct _IBusWaylandKeyEvent IBusWaylandKeyEvent;
-@@ -1312,6 +1313,12 @@ _process_key_event_repeat_rate_cb (gpointer user_data)
- event->repeat_rate_id = 0;
- return G_SOURCE_REMOVE;
- }
-+ if (g_strcmp0 (event->ibus_object_path,
-+ g_dbus_proxy_get_object_path (
-+ G_DBUS_PROXY (priv->ibuscontext)))) {
-+ event->repeat_rate_id = 0;
-+ return G_SOURCE_REMOVE;
-+ }
- switch (_use_sync_mode) {
- case 1:
- _process_key_event_sync (wlim, event);
-@@ -1349,6 +1356,14 @@ _process_key_event_repeat_delay_cb (gpointer user_data)
- event->count_cb_id = 0;
- return G_SOURCE_REMOVE;
- }
-+ /* The focus is changed. */
-+ if (g_strcmp0 (event->ibus_object_path,
-+ g_dbus_proxy_get_object_path (
-+ G_DBUS_PROXY (priv->ibuscontext)))) {
-+ event->count_cb_id = 0;
-+ g_clear_pointer (&event->ibus_object_path, g_free);
-+ return G_SOURCE_REMOVE;
-+ }
-
- if (event->count)
- return G_SOURCE_CONTINUE;
-@@ -1400,6 +1415,9 @@ key_event_check_repeat (IBusWaylandIM *wlim,
- g_source_remove (repeating_event.count_cb_id);
- repeating_event.count_cb_id = 0;
- }
-+ g_clear_pointer (&repeating_event.ibus_object_path, g_free);
-+ if (!priv->ibuscontext)
-+ return FALSE;
- source = g_timeout_source_new (priv->repeat_delay);
- g_source_attach (source, NULL);
- g_source_unref (source);
-@@ -1407,6 +1425,9 @@ key_event_check_repeat (IBusWaylandIM *wlim,
- memcpy (&repeating_event, event, sizeof (IBusWaylandKeyEvent));
- repeating_event.count_cb_id = g_source_get_id (source);
- repeating_event.count = 0;
-+ repeating_event.ibus_object_path =
-+ g_strdup (g_dbus_proxy_get_object_path (
-+ G_DBUS_PROXY (priv->ibuscontext)));
- g_source_set_callback (source, _process_key_event_repeat_delay_cb,
- &repeating_event, NULL);
- } else {
-@@ -1418,6 +1439,7 @@ key_event_check_repeat (IBusWaylandIM *wlim,
- g_source_remove (repeating_event.count_cb_id);
- repeating_event.count_cb_id = 0;
- }
-+ g_clear_pointer (&repeating_event.ibus_object_path, g_free);
- }
- return TRUE;
- }
-diff --git a/tools/main.vala b/tools/main.vala
-index fae3b9f1..3c0ea648 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -87,6 +87,7 @@ name_appeared_handler(GLib.DBusConnection connection,
- loop = null;
- }
-
-+
- private void
- kde_virtual_keyboard_avail_cb(GLib.DBusConnection connection,
- string? sender_name,
-@@ -258,7 +259,7 @@ bool start_daemon_in_wayland(bool restart,
- string[] _argv) {
-
- check_wayland_protocols();
-- if (!is_wayland_session) {
-+ if (!is_wayland_session && verbose) {
- stderr.printf("Cannot find the Wayland input-method protocol.\n");
- return false;
- }
-@@ -318,6 +319,7 @@ bool start_daemon_in_wayland(bool restart,
- }
- #endif
-
-+
- bool
- start_daemon_with_dbus_systemd(GLib.DBusConnection connection,
- bool restart,
---
-2.47.0
-
-From aac5446e8c98db934912b9b15a1ef92c3b7e4c8c Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 Jan 2025 09:40:31 +0900
-Subject: [PATCH 1/2] src: Fix declaration errors with GCC 15
-
-BUG=rhbz#2340629
----
- src/ibuscomposetable.c | 2 +-
- src/ibusenginesimple.c | 4 ++--
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index abf51244..cf865c37 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1362,7 +1362,7 @@ ibus_compose_table_new_with_list (GList *compose_list,
- gsize s_size_total, s_size_16bit, v_size_32bit, v_index_32bit;
- guint n = 0, m = 0;
- int i, j;
-- gpointer rawdata;
-+ gpointer rawdata = NULL;
- guint16 *ibus_compose_seqs = NULL;
- guint16 *ibus_compose_seqs_32bit_first = NULL;
- guint32 *ibus_compose_seqs_32bit_second = NULL;
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index a2715ab6..ec4a70ac 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -501,7 +501,7 @@ check_hex (IBusEngineSimple *simple,
- }
-
- static IBusEngineDict *
--load_emoji_dict ()
-+load_emoji_dict (void)
- {
- IBusEngineDict *emoji_dict;
- GList *keys;
-@@ -544,7 +544,7 @@ check_emoji_table (IBusEngineSimple *simple,
- g_object_ref_sink (priv->lookup_table);
- }
- if (emoji_dict == NULL)
-- emoji_dict = priv->emoji_dict = load_emoji_dict (simple);
-+ emoji_dict = priv->emoji_dict = load_emoji_dict ();
-
- if (emoji_dict == NULL || emoji_dict->dict == NULL)
- return FALSE;
---
-2.47.0
-
-From d039b95b1af14fd34167a4ca038938cef2ea41ca Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 Jan 2025 10:01:11 +0900
-Subject: [PATCH 2/2] util/IMdkit: Fix incompatible-pointer-types in TransportSW.checkAddr
-
-BUG=rhbz#2340629
----
- util/IMdkit/Xi18n.h | 18 ++++++++++--------
- util/IMdkit/i18nMethod.c | 3 ++-
- util/IMdkit/i18nOffsetCache.c | 10 ++++++----
- 3 files changed, 18 insertions(+), 13 deletions(-)
-
-diff --git a/util/IMdkit/Xi18n.h b/util/IMdkit/Xi18n.h
-index 79dd9619..09097bb6 100644
---- a/util/IMdkit/Xi18n.h
-+++ b/util/IMdkit/Xi18n.h
-@@ -3,7 +3,7 @@
- Copyright (C) 1994-1995 Sun Microsystems, Inc.
- Copyright (C) 1993-1994 Hewlett-Packard Company
- Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
-- Copyright (C) 2014 Red Hat, Inc.
-+ Copyright (C) 2014-2025 Red Hat, Inc.
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
-@@ -71,13 +71,6 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- #define I18N_SET 1
- #define I18N_GET 2
-
--typedef struct
--{
-- char *transportname;
-- int namelen;
-- Bool (*checkAddr) ();
--} TransportSW;
--
- typedef struct _XIMPending
- {
- unsigned char *p;
-@@ -172,6 +165,15 @@ typedef struct _Xi18nClient
-
- typedef struct _Xi18nCore *Xi18n;
-
-+typedef struct _TransportSW TransportSW;
-+
-+struct _TransportSW
-+{
-+ char *transportname;
-+ int namelen;
-+ Bool (*checkAddr) (Xi18n, TransportSW *, char *);
-+};
-+
- /*
- * Callback Struct for XIM Protocol
- */
-diff --git a/util/IMdkit/i18nMethod.c b/util/IMdkit/i18nMethod.c
-index 9c44e7fe..7f343d87 100644
---- a/util/IMdkit/i18nMethod.c
-+++ b/util/IMdkit/i18nMethod.c
-@@ -2,6 +2,7 @@
-
- Copyright 1994, 1995 by Sun Microsystems, Inc.
- Copyright 1993, 1994 by Hewlett-Packard Company
-+ Copyright (C) 2014-2025 Red Hat, Inc.
-
- Permission to use, copy, modify, distribute, and sell this software
- and its documentation for any purpose is hereby granted without fee,
-@@ -89,7 +90,7 @@ TransportSW _TransR[] =
- #ifdef DNETCONN
- {"decnet", 6, _Xi18nCheckTransAddress},
- #endif
-- {(char *) NULL, 0, (Bool (*) ()) NULL}
-+ {(char *) NULL, 0, (Bool (*) (Xi18n, TransportSW *, char *))NULL}
- };
-
- static Bool GetInputStyles (Xi18n i18n_core, XIMStyles **p_style)
-diff --git a/util/IMdkit/i18nOffsetCache.c b/util/IMdkit/i18nOffsetCache.c
-index e2fe8c6b..cab974c7 100644
---- a/util/IMdkit/i18nOffsetCache.c
-+++ b/util/IMdkit/i18nOffsetCache.c
-@@ -1,6 +1,6 @@
- /*
- * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2014 Red Hat, Inc.
-+ * Copyright (C) 2014-2025 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this
- * software and its documentation for any purpose is hereby granted
-@@ -83,10 +83,12 @@ void _Xi18nSetPropertyOffset (Xi18nOffsetCache *offset_cache, Atom key,
- }
-
- if (++offset_cache->size > offset_cache->capacity) {
-- offset_cache->capacity *= OFFSET_CACHE_GROWTH_FACTOR;
-- offset_cache->data = (Xi18nAtomOffsetPair *) realloc (data,
-+ Xi18nAtomOffsetPair *pair = (Xi18nAtomOffsetPair *) realloc (data,
- offset_cache->capacity * sizeof (Xi18nAtomOffsetPair));
-- if (offset_cache->data == NULL) {
-+ offset_cache->capacity *= OFFSET_CACHE_GROWTH_FACTOR;
-+ if (pair) {
-+ offset_cache->data = pair;
-+ } else {
- offset_cache->data = data;
- --offset_cache->size;
- }
---
-2.47.0
-
-From 4364c53e2f9f8c6207a0c0210a023394172c7909 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 Jan 2025 13:38:17 +0900
-Subject: [PATCH] src/ibuskeysyms: Fix typo IBUS_KEY_Ukranian_je
-
----
- src/ibuskeysyms.h | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/src/ibuskeysyms.h b/src/ibuskeysyms.h
-index 3c2e0d0e..0578f8b6 100644
---- a/src/ibuskeysyms.h
-+++ b/src/ibuskeysyms.h
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2013-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2024 Red Hat, Inc.
-+ * Copyright (C) 2013-2025 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2025 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
-@@ -916,7 +916,7 @@
- #define IBUS_KEY_Macedonia_gje 0x6a2
- #define IBUS_KEY_Cyrillic_io 0x6a3
- #define IBUS_KEY_Ukrainian_ie 0x6a4
--#define IBUS_KEY_Ukranian_ie 0x6a4 /* deprecated */
-+#define IBUS_KEY_Ukranian_je 0x6a4 /* deprecated */
- #define IBUS_KEY_Macedonia_dse 0x6a5
- #define IBUS_KEY_Ukrainian_i 0x6a6
- #define IBUS_KEY_Ukranian_i 0x6a6 /* deprecated */
---
-2.47.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : bf2314574e85b13e28485b75b4b46b7c43b6ce54
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2024-10-23T10:53:17+09:00
Stats : +0/-681 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/bf2314574e85b13e28485b75b4b46b7c43b6ce54?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index edb5adf..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,681 +0,0 @@
-From c13c54ec14ebdc8b39dda09b636daedee3ea6458 Mon Sep 17 00:00:00 2001
-From: Christian Hergert <chergert@redhat.com>
-Date: Thu, 26 Sep 2024 12:11:05 -0700
-Subject: [PATCH] bus: use va_marshaller to avoid GValue boxing
-
-Building your own marshaller list is most of the way there to get better
-signal performance, but you can go a bit further by having it generate
-va_marshallers and set those too.
-
-Not only do va_marshallers allow you to avoid the GValue boxing, it allows
-you to also get better profiling data at runtime.
-
-BUG=https://github.com/ibus/ibus/pull/2683
----
- bus/Makefile.am | 4 +--
- bus/dbusimpl.c | 9 ++++++
- bus/engineproxy.c | 60 +++++++++++++++++++++++++++++++++++++
- bus/inputcontext.c | 74 +++++++++++++++++++++++++++++++++++++++++++++-
- 4 files changed, 144 insertions(+), 3 deletions(-)
-
-diff --git a/bus/Makefile.am b/bus/Makefile.am
-index 99715a15..bd3481b9 100644
---- a/bus/Makefile.am
-+++ b/bus/Makefile.am
-@@ -99,12 +99,12 @@ BUILT_SOURCES = \
-
- # gen marshal
- marshalers.h: marshalers.list
-- $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=bus_marshal $(srcdir)/marshalers.list --header --internal > $@.tmp && \
-+ $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=bus_marshal $(srcdir)/marshalers.list --header --internal --valist-marshallers > $@.tmp && \
- mv $@.tmp $@
-
- marshalers.c: marshalers.h marshalers.list
- $(AM_V_GEN) (echo "#include \"marshalers.h\""; \
-- $(GLIB_GENMARSHAL) --prefix=bus_marshal $(srcdir)/marshalers.list --body --internal) > $@.tmp && \
-+ $(GLIB_GENMARSHAL) --prefix=bus_marshal $(srcdir)/marshalers.list --body --internal --valist-marshallers) > $@.tmp && \
- mv $@.tmp $@
-
- if ENABLE_EMOJI_DICT
-diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
-index 110d864a..fa8b860d 100644
---- a/bus/dbusimpl.c
-+++ b/bus/dbusimpl.c
-@@ -576,6 +576,9 @@ bus_dbus_impl_class_init (BusDBusImplClass *class)
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
-+ g_signal_set_va_marshaller (dbus_signals[NAME_OWNER_CHANGED],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_STRING_STRING_STRINGv);
-
- dbus_signals[NAME_LOST] =
- g_signal_new (I_("name-lost"),
-@@ -588,6 +591,9 @@ bus_dbus_impl_class_init (BusDBusImplClass *class)
- 2,
- BUS_TYPE_CONNECTION,
- G_TYPE_STRING);
-+ g_signal_set_va_marshaller (dbus_signals[NAME_LOST],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_STRINGv);
-
- dbus_signals[NAME_ACQUIRED] =
- g_signal_new (I_("name-acquired"),
-@@ -600,6 +606,9 @@ bus_dbus_impl_class_init (BusDBusImplClass *class)
- 2,
- BUS_TYPE_CONNECTION,
- G_TYPE_STRING);
-+ g_signal_set_va_marshaller (dbus_signals[NAME_ACQUIRED],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_STRINGv);
- }
-
- static void
-diff --git a/bus/engineproxy.c b/bus/engineproxy.c
-index b3e16066..20f89cef 100644
---- a/bus/engineproxy.c
-+++ b/bus/engineproxy.c
-@@ -189,6 +189,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_TEXT);
-+ g_signal_set_va_marshaller (engine_signals[COMMIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- engine_signals[FORWARD_KEY_EVENT] =
- g_signal_new (I_("forward-key-event"),
-@@ -202,6 +205,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_UINT,
- G_TYPE_UINT,
- G_TYPE_UINT);
-+ g_signal_set_va_marshaller (engine_signals[FORWARD_KEY_EVENT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__UINT_UINT_UINTv);
-
- engine_signals[DELETE_SURROUNDING_TEXT] =
- g_signal_new (I_("delete-surrounding-text"),
-@@ -214,6 +220,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- 2,
- G_TYPE_INT,
- G_TYPE_UINT);
-+ g_signal_set_va_marshaller (engine_signals[DELETE_SURROUNDING_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__INT_UINTv);
-
- engine_signals[REQUIRE_SURROUNDING_TEXT] =
- g_signal_new (I_("require-surrounding-text"),
-@@ -224,6 +233,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[REQUIRE_SURROUNDING_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[UPDATE_PREEDIT_TEXT] =
- g_signal_new (I_("update-preedit-text"),
-@@ -238,6 +250,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_UINT,
- G_TYPE_BOOLEAN,
- G_TYPE_UINT);
-+ g_signal_set_va_marshaller (engine_signals[UPDATE_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_UINT_BOOLEAN_UINTv);
-
- engine_signals[SHOW_PREEDIT_TEXT] =
- g_signal_new (I_("show-preedit-text"),
-@@ -248,6 +263,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[SHOW_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[HIDE_PREEDIT_TEXT] =
- g_signal_new (I_("hide-preedit-text"),
-@@ -258,6 +276,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[HIDE_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[UPDATE_AUXILIARY_TEXT] =
- g_signal_new (I_("update-auxiliary-text"),
-@@ -270,6 +291,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- 2,
- IBUS_TYPE_TEXT,
- G_TYPE_BOOLEAN);
-+ g_signal_set_va_marshaller (engine_signals[UPDATE_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_BOOLEANv);
-
- engine_signals[SHOW_AUXILIARY_TEXT] =
- g_signal_new (I_("show-auxiliary-text"),
-@@ -280,6 +304,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[SHOW_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[HIDE_AUXILIARY_TEXT] =
- g_signal_new (I_("hide-auxiliary-text"),
-@@ -290,6 +317,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[HIDE_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[UPDATE_LOOKUP_TABLE] =
- g_signal_new (I_("update-lookup-table"),
-@@ -302,6 +332,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- 2,
- IBUS_TYPE_LOOKUP_TABLE,
- G_TYPE_BOOLEAN);
-+ g_signal_set_va_marshaller (engine_signals[UPDATE_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_BOOLEANv);
-
- engine_signals[SHOW_LOOKUP_TABLE] =
- g_signal_new (I_("show-lookup-table"),
-@@ -312,6 +345,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[SHOW_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[HIDE_LOOKUP_TABLE] =
- g_signal_new (I_("hide-lookup-table"),
-@@ -322,6 +358,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[HIDE_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[PAGE_UP_LOOKUP_TABLE] =
- g_signal_new (I_("page-up-lookup-table"),
-@@ -332,6 +371,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[PAGE_UP_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[PAGE_DOWN_LOOKUP_TABLE] =
- g_signal_new (I_("page-down-lookup-table"),
-@@ -342,6 +384,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[PAGE_DOWN_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[CURSOR_UP_LOOKUP_TABLE] =
- g_signal_new (I_("cursor-up-lookup-table"),
-@@ -352,6 +397,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[CURSOR_UP_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[CURSOR_DOWN_LOOKUP_TABLE] =
- g_signal_new (I_("cursor-down-lookup-table"),
-@@ -362,6 +410,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (engine_signals[CURSOR_DOWN_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- engine_signals[REGISTER_PROPERTIES] =
- g_signal_new (I_("register-properties"),
-@@ -373,6 +424,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_PROP_LIST);
-+ g_signal_set_va_marshaller (engine_signals[REGISTER_PROPERTIES],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- engine_signals[UPDATE_PROPERTY] =
- g_signal_new (I_("update-property"),
-@@ -384,6 +438,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_PROPERTY);
-+ g_signal_set_va_marshaller (engine_signals[UPDATE_PROPERTY],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- engine_signals[PANEL_EXTENSION] =
- g_signal_new (I_("panel-extension"),
-@@ -395,6 +452,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_EXTENSION_EVENT);
-+ g_signal_set_va_marshaller (engine_signals[PANEL_EXTENSION],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- text_empty = ibus_text_new_from_static_string ("");
- g_object_ref_sink (text_empty);
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index 85358241..9a133c88 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -422,6 +422,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_UINT,
- G_TYPE_UINT,
- G_TYPE_UINT);
-+ g_signal_set_va_marshaller (context_signals[PROCESS_KEY_EVENT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_BOOLEAN__UINT_UINT_UINTv);
-
- context_signals[SET_CURSOR_LOCATION] =
- g_signal_new (I_("set-cursor-location"),
-@@ -436,6 +439,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_INT);
-+ g_signal_set_va_marshaller (context_signals[SET_CURSOR_LOCATION],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__INT_INT_INT_INTv);
-
- context_signals[SET_CURSOR_LOCATION_RELATIVE] =
- g_signal_new (I_("set-cursor-location-relative"),
-@@ -450,6 +456,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_INT);
-+ g_signal_set_va_marshaller (context_signals[SET_CURSOR_LOCATION_RELATIVE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__INT_INT_INT_INTv);
-
- context_signals[FOCUS_IN] =
- g_signal_new (I_("focus-in"),
-@@ -459,6 +468,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[FOCUS_IN],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[FOCUS_OUT] =
- g_signal_new (I_("focus-out"),
-@@ -468,6 +480,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[FOCUS_OUT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[UPDATE_PREEDIT_TEXT] =
- g_signal_new (I_("update-preedit-text"),
-@@ -481,6 +496,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- IBUS_TYPE_TEXT,
- G_TYPE_UINT,
- G_TYPE_BOOLEAN);
-+ g_signal_set_va_marshaller (context_signals[UPDATE_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_UINT_BOOLEANv);
-
- context_signals[SHOW_PREEDIT_TEXT] =
- g_signal_new (I_("show-preedit-text"),
-@@ -491,6 +509,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (context_signals[SHOW_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[HIDE_PREEDIT_TEXT] =
- g_signal_new (I_("hide-preedit-text"),
-@@ -501,6 +522,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (context_signals[HIDE_PREEDIT_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[UPDATE_AUXILIARY_TEXT] =
- g_signal_new (I_("update-auxiliary-text"),
-@@ -513,6 +537,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- 2,
- IBUS_TYPE_TEXT,
- G_TYPE_BOOLEAN);
-+ g_signal_set_va_marshaller (context_signals[UPDATE_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_BOOLEANv);
-
- context_signals[SHOW_AUXILIARY_TEXT] =
- g_signal_new (I_("show-auxiliary-text"),
-@@ -523,6 +550,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (context_signals[SHOW_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[HIDE_AUXILIARY_TEXT] =
- g_signal_new (I_("hide-auxiliary-text"),
-@@ -533,6 +563,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (context_signals[HIDE_AUXILIARY_TEXT],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[UPDATE_LOOKUP_TABLE] =
- g_signal_new (I_("update-lookup-table"),
-@@ -545,6 +578,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- 2,
- IBUS_TYPE_LOOKUP_TABLE,
- G_TYPE_BOOLEAN);
-+ g_signal_set_va_marshaller (context_signals[UPDATE_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECT_BOOLEANv);
-
- context_signals[SHOW_LOOKUP_TABLE] =
- g_signal_new (I_("show-lookup-table"),
-@@ -554,6 +590,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[SHOW_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[HIDE_LOOKUP_TABLE] =
- g_signal_new (I_("hide-lookup-table"),
-@@ -563,6 +602,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[HIDE_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[PAGE_UP_LOOKUP_TABLE] =
- g_signal_new (I_("page-up-lookup-table"),
-@@ -572,6 +614,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[PAGE_UP_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[PAGE_DOWN_LOOKUP_TABLE] =
- g_signal_new (I_("page-down-lookup-table"),
-@@ -581,6 +626,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[PAGE_DOWN_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[CURSOR_UP_LOOKUP_TABLE] =
- g_signal_new (I_("cursor-up-lookup-table"),
-@@ -590,6 +638,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[CURSOR_UP_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[CURSOR_DOWN_LOOKUP_TABLE] =
- g_signal_new (I_("cursor-down-lookup-table"),
-@@ -599,6 +650,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- NULL, NULL,
- bus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-+ g_signal_set_va_marshaller (context_signals[CURSOR_DOWN_LOOKUP_TABLE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- context_signals[REGISTER_PROPERTIES] =
- g_signal_new (I_("register-properties"),
-@@ -610,6 +664,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_PROP_LIST);
-+ g_signal_set_va_marshaller (context_signals[REGISTER_PROPERTIES],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- context_signals[UPDATE_PROPERTY] =
- g_signal_new (I_("update-property"),
-@@ -621,6 +678,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_PROPERTY);
-+ g_signal_set_va_marshaller (context_signals[UPDATE_PROPERTY],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- context_signals[ENGINE_CHANGED] =
- g_signal_new (I_("engine-changed"),
-@@ -631,6 +691,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
-+ g_signal_set_va_marshaller (context_signals[ENGINE_CHANGED],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__VOIDv);
-
- /* This signal is not for notifying an event on this object, but is for
- * requesting an engine as the name shows.
-@@ -646,7 +709,10 @@ bus_input_context_class_init (BusInputContextClass *class)
- bus_marshal_OBJECT__STRING,
- IBUS_TYPE_ENGINE_DESC,
- 1,
-- G_TYPE_STRING);
-+ G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
-+ g_signal_set_va_marshaller (context_signals[REQUEST_ENGINE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__STRINGv);
-
- context_signals[SET_CONTENT_TYPE] =
- g_signal_new (I_("set-content-type"),
-@@ -659,6 +725,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- 2,
- G_TYPE_UINT,
- G_TYPE_UINT);
-+ g_signal_set_va_marshaller (context_signals[SET_CONTENT_TYPE],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__UINT_UINTv);
-
- context_signals[PANEL_EXTENSION] =
- g_signal_new (I_("panel-extension"),
-@@ -670,6 +739,9 @@ bus_input_context_class_init (BusInputContextClass *class)
- G_TYPE_NONE,
- 1,
- IBUS_TYPE_EXTENSION_EVENT);
-+ g_signal_set_va_marshaller (context_signals[PANEL_EXTENSION],
-+ G_TYPE_FROM_CLASS (class),
-+ bus_marshal_VOID__OBJECTv);
-
- text_empty = ibus_text_new_from_string ("");
- g_object_ref_sink (text_empty);
---
-2.46.1
-
-From c0b27e50fbfff50fcbdae4cb33afd889b1dde6d8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 24 Sep 2024 19:13:46 +0900
-Subject: [PATCH] ui/gtk3: Wait for hide-preedit-text signal for Emoji category
-
-IBusEngineSimple calls HidePreeditText D-Bus signal with focus-out
-signal so Emojier should wait for it before launch the dialog.
-
-BUG=rhbz#2310892
----
- ui/gtk3/panelbinding.vala | 28 +++++++++++++++++++++++++---
- 1 file changed, 25 insertions(+), 3 deletions(-)
-
-diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
-index caad1b0b..10d09d75 100644
---- a/ui/gtk3/panelbinding.vala
-+++ b/ui/gtk3/panelbinding.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2018-2021 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2018-2024 Takao Fujwiara <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
-@@ -217,6 +217,7 @@ class PanelBinding : IBus.PanelService {
- private IBusEmojier? m_emojier;
- private uint m_emojier_set_emoji_lang_id;
- private uint m_emojier_focus_commit_text_id;
-+ private uint m_emojier_focus_emoji_category_id;
- private string[] m_emojier_favorites = {};
- private Gtk.CssProvider m_css_provider;
- private const uint PRELOAD_ENGINES_DELAY_TIME = 30000;
-@@ -912,8 +913,14 @@ class PanelBinding : IBus.PanelService {
- true);
- string params = event.get_params();
- if (params == "category-list") {
-- key_press_space();
-- show_preedit_and_candidate(true);
-+ if (m_emojier_focus_emoji_category_id > 0)
-+ return;
-+ m_emojier_focus_emoji_category_id =
-+ GLib.Timeout.add_seconds(1, () => {
-+ info("Timeout to show Emoji category list.");
-+ show_category_list_real();
-+ return false;
-+ });
- }
- }
-
-@@ -962,6 +969,15 @@ class PanelBinding : IBus.PanelService {
- if (m_is_wayland && m_preedit.get_text() == "")
- return;
- show_preedit_and_candidate(false);
-+
-+ /* Clicking on "Emoji Choice" will call ibus_engine_simple_focus_out()
-+ * -> PanelBinding.hide_preedit_text() with IBusEngineSimple but not
-+ * other engines.
-+ */
-+ if (m_emojier_focus_emoji_category_id > 0) {
-+ GLib.Source.remove(m_emojier_focus_emoji_category_id);
-+ show_category_list_real();
-+ }
- }
-
-
-@@ -1128,6 +1144,12 @@ class PanelBinding : IBus.PanelService {
- show_preedit_and_candidate(show_candidate);
- }
-
-+ private void show_category_list_real() {
-+ key_press_space();
-+ show_preedit_and_candidate(true);
-+ m_emojier_focus_emoji_category_id = 0;
-+ }
-+
- private void candidate_clicked_lookup_table_real(uint index,
- uint button,
- uint state,
---
-2.46.0
-
-From eb92f6f1a3401ad8b1b884c1ceab5dbdc4942403 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 4 Oct 2024 21:34:02 +0900
-Subject: [PATCH] configure: Add --with-python-overrides-dir option
-
-The default GI directory is /usr in Flatpak but the directory is readonly
-with `flatpak-builder` and the Flatpak specific GI files are installed in
-/app GI directory.
-
-Fixes: https://github.com/ibus/ibus/commit/20b29c1
----
- configure.ac | 28 +++++++++++++++------------
- test/org.test.IBus.Fedoraproject.json | 4 ++--
- test/org.test.IBus.Freedesktop.json | 4 ++--
- test/org.test.IBus.GNOME.json | 4 ++--
- 4 files changed, 22 insertions(+), 18 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index ec392a81..453c83ba 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -512,24 +512,27 @@ AM_CONDITIONAL([ENABLE_DAEMON], [true])
-
- PYGOBJECT_REQUIRED=3.0.0
-
-+# Define Python overrides dir.
- # When IBus is built with the Json files in test directory, the build
--# tries to install IBus.py file into pyoverridesdir
--# but the directory is readonly with `flatpak-builder`
--AC_ARG_ENABLE(pygobject,
-- AS_HELP_STRING([--disable-pygobject],
-- [Disable pygobject.]),
-- [enable_pygobject=$enableval],
-- [enable_pygobject=yes]
-+# tries to install IBus.py file into pyoverridesdir.
-+# The default GI directory is /usr in Flatpak but the directory is readonly
-+# with `flatpak-builder` and the Flatpak specific GI files are installed in
-+# /app GI directory.
-+AC_ARG_WITH(python-overrides-dir,
-+ AS_HELP_STRING([--with-python-overrides-dir[=DIR]],
-+ [Select Python overrides dir]),
-+ pyoverridesdir=$with_python_overrides_dir
- )
-
--if test "x$enable_pygobject" = "xyes"; then
-- PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
-- [enable_pygobject=yes], [enable_pygobject=no])
--fi
-+PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
-+ [enable_pygobject=yes], [enable_pygobject=no])
-+
- if test "x$enable_pygobject" = "xyes"; then
- PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
-
-- pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
-+ if test x"$pyoverridesdir" = x""; then
-+ pyoverridesdir=`$PYTHON -c "import gi; print(gi._overridesdir)"`
-+ fi
- AC_SUBST(pyoverridesdir)
-
- if test x"$enable_python2" = x"yes"; then
-@@ -935,6 +938,7 @@ Build options:
- CFLAGS $CFLAGS
- PYTHON $PYTHON
- PYTHON2 $PYTHON2
-+ Python overrides dir $pyoverridesdir
- Enable python2 $enable_python2
- Gtk2 immodule dir $GTK2_IM_MODULEDIR
- Gtk3 immodule dir $GTK3_IM_MODULEDIR
---
-2.46.1
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : a9da27f5f0f7ad429e337ac81b0f79a3d4c1b050
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2024-07-12T23:06:27+09:00
Stats : +0/-1590 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/a9da27f5f0f7ad429e337ac81b0f79a3d4c1b050?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-1.5.30.tar.gz.sum b/ibus-1.5.30.tar.gz.sum
deleted file mode 100644
index 7aa32da..0000000
--- a/ibus-1.5.30.tar.gz.sum
+++ /dev/null
@@ -1,4 +0,0 @@
-cksum 4283112382 4124084 ibus-1.5.30.tar.gz
-sha1sum cda03c8622d5817e1a968b38bd05240e2102928d ibus-1.5.30.tar.gz
-sha256sum 05b84d4a45139face161596e5ade8e6c5da55cfaf6f194861da66516190f5b96 ibus-1.5.30.tar.gz
-sha512sum cbed37bf62e8d8593c838f8ef7fe0b22bf8f4a661b887fc7be2f2768dda912075abdf3070c22b9699def90e7002aaaf7394f5fc590e12ef6ebb2bb5161cc29a0 ibus-1.5.30.tar.gz
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 12f7e19..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,1586 +0,0 @@
-From 4059b9f43f4505c855677abde1b59fc13241ca58 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 2 Apr 2024 23:34:07 +0900
-Subject: [PATCH 1/6] Makefile: Add check sum file
-
----
- Makefile.am | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/Makefile.am b/Makefile.am
-index 16548d25..88fdbd48 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -138,6 +138,14 @@ srpm: dist @PACKAGE_NAME@.spec
- --define "_specdir `pwd`/rpm" \
- @PACKAGE_NAME@.spec
-
-+@PACKAGE_NAME@-@PACKAGE_VERSION@.%.sum: @PACKAGE_NAME@-@PACKAGE_VERSION@.%
-+ f=`basename $@ .sum`; \
-+ printf "cksum %s %s %s\n" `cksum $$f` > $@; \
-+ printf "sha1sum %s %s\n" `sha1sum $$f` >> $@; \
-+ printf "sha256sum %s %s\n" `sha256sum $$f` >> $@; \
-+ printf "sha512sum %s %s\n" `sha512sum $$f` >> $@; \
-+ $(NULL)
-+
- clean-rpm:
- -$(RM) -r "`uname -i`"
-
---
-2.45.0
-
-From e39345af20c1dd9b18cdb6ccb5039b03e4135f73 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 May 2024 13:18:42 +0900
-Subject: [PATCH 2/6] src/tests: Fix ibus-daemon in ibus-desktop-testing-runner
-
-Some distributions do not need the IBus panel and gnome-shell also
-does not need it.
-Add --verbose option to get ibus-daemon error messages.
-
-Add vala check in autogen.sh since valac changes the source codes.
----
- autogen.sh | 2 +-
- src/tests/ibus-desktop-testing-runner.in | 17 ++++++++++++++---
- 2 files changed, 15 insertions(+), 4 deletions(-)
-
-diff --git a/autogen.sh b/autogen.sh
-index d6f8f983..90e126ec 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -14,7 +14,7 @@ GCC_VERSION=$(gcc --version | head -1 | awk '{print $3}')
- GCC_MAJOR_VERSION=$(echo "$GCC_VERSION" | awk -F. '{print $1}')
- FEDORA_PKG1='autoconf automake libtool gettext-devel'
- FEDORA_PKG2='glib2-devel gtk2-devel gtk3-devel
-- wayland-devel'
-+ wayland-devel vala'
- FEDORA_PKG3='cldr-emoji-annotation iso-codes-devel unicode-emoji unicode-ucd
- xkeyboard-config-devel'
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 6b208345..1ac2dfc8 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -45,6 +45,7 @@ TEST_LOG_STDOUT=0
- RESULT_LOG=""
- SCREEN_LOG=""
- HAVE_GRAPHICS=1
-+VERBOSE=0
- DESKTOP_COMMAND="dbus-launch --exit-with-session gnome-session"
- PID_XORG=0
- PID_GNOME_SESSION=0
-@@ -83,6 +84,7 @@ usage()
- "-b, --builddir=BUILDDIR Set the BUILDDIR\n" \
- "-s, --srcdir=SOURCEDIR Set the SOURCEDIR\n" \
- "-c, --no-graphics Use Xvfb instead of Xorg\n" \
-+"-V, --verbose Verbose log for ibus-daemon\n" \
- "-d, --desktop=DESKTOP Run DESTKTOP. The default is gnome-session.\n" \
- " Suffix '-with-dbus' can run DESKTOP with dbus session." \
- " E.g. --desktop=mutter-with-dbus" \
-@@ -101,8 +103,8 @@ usage()
- parse_args()
- {
- # This is GNU getopt. "sudo port getopt" in BSD?
-- ARGS=`getopt -o hvb:s:cd:t:r:T:o:O:S: --long \
-- help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:,screendump:\
-+ ARGS=`getopt -o hvb:s:cVd:t:r:T:o:O:S: --long \
-+ help,version,builddir:,srcdir:,no-graphics,verbose,desktop:,tests:,runner:,timeout:,output:,result:,screendump:\
- -- "$@"`;
- eval set -- "$ARGS"
- while [ 1 ] ; do
-@@ -112,6 +114,7 @@ parse_args()
- -b | --builddir ) BUILDDIR="$2"; shift 2;;
- -s | --srcdir ) SRCDIR="$2"; shift 2;;
- -c | --no-graphics ) HAVE_GRAPHICS=0; shift;;
-+ -V | --verbose ) VERBOSE=1; shift;;
- -d | --desktop ) DESKTOP_COMMAND="$2"; shift 2;;
- -t | --tests ) TESTS="$2"; shift 2;;
- -r | --runner ) TESTING_RUNNER="$2"; shift 2;;
-@@ -286,6 +289,7 @@ run_desktop()
- PID_GNOME_SESSION=$!
- sleep 30
-
-+ IBUS_ARGS="--verbose --panel disable"
- # gnome-shell 42 checks if org.freedesktop.IBus.session.GNOME.service
- # systemd file is available with org.freedesktop.systemd1.Manager.GetUnit
- # D-Bus method, which is provided by IBus 1.5.26, and if the file
-@@ -302,8 +306,15 @@ run_desktop()
- # with gnome-session.target systemd file.
- # But `systemctl start gdm` terminates the parent script forcibly
- # and the script cannot get the CI result.
-- ibus-daemon --daemonize --verbose
-+ if test $VERBOSE -eq 1 ; then
-+ ibus-daemon $IBUS_ARGS &
-+ else
-+ ibus-daemon $IBUS_ARGS --daemonize
-+ fi
- sleep 3
-+ if test $VERBOSE -eq 1 ; then
-+ ps -ef | grep ibus
-+ fi
- }
-
-
---
-2.45.0
-
-From f190da19b53c267ca1c9730e18f1b53c089c0247 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 May 2024 15:37:00 +0900
-Subject: [PATCH 3/6] ui/gtk3: Configure initial keymaps with localectl in
- Wayland
-
-`setxkbmap -query` returns US layout with Xwayland and it does not
-correspond to the session keymaps so ibus-panel now uses
-`localectl status` in Wayland but it does not provide the session
-XKB options against `setxkbmap` command in Xorg.
-Need to think how to load or set the XKB options in Wayland later.
-
-BUG=rhbz#2267615
-BUG=https://github.com/ibus/ibus/pull/2624
----
- src/tests/ibus-keypress.c | 40 +++++++++----
- ui/gtk3/panel.vala | 2 +-
- ui/gtk3/xkblayout.vala | 123 ++++++++++++++++++++++++++++----------
- 3 files changed, 119 insertions(+), 46 deletions(-)
-
-diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c
-index bab05398..d44f39b2 100644
---- a/src/tests/ibus-keypress.c
-+++ b/src/tests/ibus-keypress.c
-@@ -5,6 +5,14 @@
- #include <X11/Xlib.h>
- #include <X11/extensions/XTest.h>
-
-+#ifdef GDK_WINDOWING_WAYLAND
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+#include <gdk/wayland/gdkwayland.h>
-+#else
-+#include <gdk/gdkwayland.h>
-+#endif
-+#endif
-+
- #define GREEN "\033[0;32m"
- #define RED "\033[0;31m"
- #define NC "\033[0m"
-@@ -186,15 +194,8 @@ set_engine_cb (GObject *object,
- }
-
- display = gtk_widget_get_display (entry);
-- if (GDK_IS_X11_DISPLAY (display)) {
-- xdisplay = gdk_x11_display_get_xdisplay (display);
-- } else {
--#if 0
-- xdisplay = XOpenDisplay (NULL);
--#else
-- g_critical ("No idea to simulate key events in Wayland\n");
--#endif
-- }
-+ g_assert (GDK_IS_X11_DISPLAY (display));
-+ xdisplay = gdk_x11_display_get_xdisplay (display);
- g_return_if_fail (xdisplay);
-
- for (i = 0; test_cases[i][0].keyval; i++) {
-@@ -272,12 +273,18 @@ create_window ()
- static void
- test_keypress (void)
- {
-+ gchar *path;
- int status = 0;
- GError *error = NULL;
-
-- g_spawn_command_line_sync ("setxkbmap -layout us",
-- NULL, NULL,
-- &status, &error);
-+ /* localectl does not change the session keymap. */
-+ path = g_find_program_in_path ("setxkbmap");
-+ if (path) {
-+ g_spawn_command_line_sync ("setxkbmap -layout us",
-+ NULL, NULL,
-+ &status, &error);
-+ }
-+ g_free (path);
- g_assert (register_ibus_engine ());
-
- create_window ();
-@@ -295,6 +302,15 @@ main (int argc, char *argv[])
- g_message ("Failed setenv NO_AT_BRIDGE\n");
- g_test_init (&argc, &argv, NULL);
- gtk_init (&argc, &argv);
-+#ifdef GDK_WINDOWING_WAYLAND
-+ {
-+ GdkDisplay *display = gdk_display_get_default ();
-+ if (GDK_IS_WAYLAND_DISPLAY (display)) {
-+ g_print ("setxkbmap and XTEST do not work in Wayland.\n");
-+ return 0;
-+ }
-+ }
-+#endif
-
- g_test_add_func ("/ibus/keyrepss", test_keypress);
-
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 678b51f0..d907458e 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -510,7 +510,7 @@ class Panel : IBus.PanelService {
- string layouts;
- string variants;
- string option;
-- XKBLayout.get_layout(out layouts, out variants, out option);
-+ m_xkblayout.get_layout(out layouts, out variants, out option);
-
- GLib.List<IBus.EngineDesc> xkb_engines =
- new GLib.List<IBus.EngineDesc>();
-diff --git a/ui/gtk3/xkblayout.vala b/ui/gtk3/xkblayout.vala
-index 729b48ce..7812c4bb 100644
---- a/ui/gtk3/xkblayout.vala
-+++ b/ui/gtk3/xkblayout.vala
-@@ -4,7 +4,7 @@
- *
- * Copyright(c) 2014 Red Hat, Inc.
- * Copyright(c) 2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2014 Takao Fujiwara <tfujiwar@redhat.com>
-+ * Copyright(c) 2014-2024 Takao Fujiwara <tfujiwar@redhat.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
-@@ -25,11 +25,11 @@
- class XKBLayout
- {
- private const string XKB_COMMAND = "setxkbmap";
-- private const string XKB_QUERY_ARG = "-query";
- private const string XKB_LAYOUT_ARG = "-layout";
- private const string XMODMAP_COMMAND = "xmodmap";
- private const string[] XMODMAP_KNOWN_FILES = {".xmodmap", ".xmodmaprc",
- ".Xmodmap", ".Xmodmaprc"};
-+ private string[] m_get_layout_args = {};
- private string[] m_xkb_latin_layouts = {};
- private string m_default_layout = "";
- private string m_default_variant = "";
-@@ -39,16 +39,23 @@ class XKBLayout
- public XKBLayout() {
- }
-
-+
- public void set_latin_layouts(string[] xkb_latin_layouts) {
- m_xkb_latin_layouts = xkb_latin_layouts;
- }
-
-- public static void get_layout(out string layout,
-- out string variant,
-- out string option) {
-+
-+ public void get_layout(out string layout,
-+ out string variant,
-+ out string option) {
-+ search_get_layout_program();
-+ if (m_get_layout_args[0] == null) {
-+ warning("Not found localectl or setxkbmap command in PATH");
-+ return;
-+ }
- string[] exec_command = {};
-- exec_command += XKB_COMMAND;
-- exec_command += XKB_QUERY_ARG;
-+ foreach (unowned string arg in m_get_layout_args)
-+ exec_command += arg;
- string standard_output = null;
- string standard_error = null;
- int exit_status = 0;
-@@ -69,46 +76,94 @@ class XKBLayout
- } catch (GLib.SpawnError err) {
- stderr.printf("IBUS_ERROR: %s\n", err.message);
- }
-- if (exit_status != 0) {
-+ if (exit_status != 0)
- stderr.printf("IBUS_ERROR: %s\n", standard_error ?? "");
-- }
-- if (standard_output == null) {
-+ if (standard_output == null)
- return;
-+
-+ if (exec_command[0] == "localectl") {
-+ parse_localectl_status_str(standard_output,
-+ out layout,
-+ out variant,
-+ out option);
-+ } else if (exec_command[0] == XKB_COMMAND) {
-+ parse_xkbmap_query_str(standard_output,
-+ out layout,
-+ out variant,
-+ out option);
- }
-+ }
-+
-
-+ private void search_get_layout_program() {
-+ if (m_get_layout_args[0] != null)
-+ return;
-+ string get_layout_command = null;
-+ // setxkbmap can get the session XKB options in Xorg.
-+ if (BindingCommon.default_is_xdisplay())
-+ get_layout_command = "setxkbmap -query";
-+ else if (GLib.Environment.find_program_in_path("localectl") != null)
-+ get_layout_command = "localectl status";
-+ else if (GLib.Environment.find_program_in_path("setxkbmap") != null)
-+ get_layout_command = "setxkbmap -query";
-+ if (get_layout_command != null)
-+ m_get_layout_args = get_layout_command.split(" ");
-+ }
-+
-+
-+ private void parse_localectl_status_str(string standard_output,
-+ out string layout,
-+ out string variant,
-+ out string option) {
-+ layout = "";
-+ variant = "";
-+ option = "";
- foreach (string line in standard_output.split("\n")) {
-- string element = "layout:";
-- string retval = "";
-- if (line.has_prefix(element)) {
-- retval = line[element.length:line.length];
-- if (retval != null) {
-- retval = retval.strip();
-+ const string[] elements = { "X11 Layout:", "X11 Variant:" };
-+ foreach (unowned string element in elements) {
-+ string retval = "";
-+ int index = line.index_of(element);
-+ if (index >= 0) {
-+ retval = line[index + element.length:line.length];
-+ if (retval != null)
-+ retval = retval.strip();
-+ if (element == elements[0])
-+ layout = retval;
-+ else if (element == elements[1])
-+ variant = retval;
- }
-- layout = retval;
- }
-+ }
-+ }
-
-- element = "variant:";
-- retval = "";
-- if (line.has_prefix(element)) {
-- retval = line[element.length:line.length];
-- if (retval != null) {
-- retval = retval.strip();
-- }
-- variant = retval;
-- }
-
-- element = "options:";
-- retval = "";
-- if (line.has_prefix(element)) {
-- retval = line[element.length:line.length];
-- if (retval != null) {
-- retval = retval.strip();
-+ private void parse_xkbmap_query_str(string standard_output,
-+ out string layout,
-+ out string variant,
-+ out string option) {
-+ layout = "";
-+ variant = "";
-+ option = "";
-+ foreach (string line in standard_output.split("\n")) {
-+ const string[] elements = { "layout:", "variant:", "options:" };
-+ foreach (unowned string element in elements) {
-+ string retval = "";
-+ if (line.has_prefix(element)) {
-+ retval = line[element.length:line.length];
-+ if (retval != null)
-+ retval = retval.strip();
-+ if (element == elements[0])
-+ layout = retval;
-+ else if (element == elements[1])
-+ variant = retval;
-+ else if (element == elements[2])
-+ option = retval;
- }
-- option = retval;
- }
- }
- }
-
-+
- public void set_layout(IBus.EngineDesc engine) {
- string layout = engine.get_layout();
- string variant = engine.get_layout_variant();
-@@ -206,6 +261,7 @@ class XKBLayout
- run_xmodmap();
- }
-
-+
- public void run_xmodmap() {
- if (!m_use_xmodmap) {
- return;
-@@ -246,6 +302,7 @@ class XKBLayout
- }
- }
-
-+
- public void set_use_xmodmap(bool use_xmodmap) {
- m_use_xmodmap = use_xmodmap;
- }
---
-2.45.0
-
-From 48c4a9c900421b9e77be399a4792974f25a80be6 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 May 2024 16:17:58 +0900
-Subject: [PATCH 4/6] src/ibusenginesimple: Ignore Super modifier for compose
- keys
-
-Now IBus receives key events prior to the window manager and needs
-to ignore Super modifier since Super key has been already ignored
-for compose keys.
-
-BUG=https://gitlab.gnome.org/GNOME/mutter/-/issues/3128
----
- src/ibusenginesimple.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 4bee8cb3..76dd9eb5 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2014-2017 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -1017,7 +1017,9 @@ ibus_engine_simple_process_key_event (IBusEngine *engine,
- !is_hex_start && !is_hex_end && !is_escape && !is_backspace) ||
- (priv->in_emoji_sequence && !printable_keyval &&
- !is_emoji_start && !is_hex_end && !is_escape && !is_backspace)) {
-- if (modifiers & (IBUS_MOD1_MASK | IBUS_CONTROL_MASK) ||
-+ guint no_text_input_mask = IBUS_MOD1_MASK | IBUS_MOD4_MASK \
-+ | IBUS_CONTROL_MASK | IBUS_SUPER_MASK;
-+ if (modifiers & no_text_input_mask ||
- ((priv->in_hex_sequence || priv->in_emoji_sequence) &&
- priv->modifiers_dropped &&
- (keyval == IBUS_KEY_Return ||
---
-2.45.0
-
-From a3a5a20a30f2a8ecee4dc2aaa4fd48c62c91d768 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 May 2024 16:18:03 +0900
-Subject: [PATCH 5/6] src/ibusenginesimple: Do not update zero length preedit
- text
-
-Several engines can inherit IBusEngieSimple for the compose key support
-likes Anthy, Hangul, M17n and it could have the duplicated preedit text
-between the engine and the parent IBusEngineSimple and it could update
-the preedit text mutually by mistake.
-
-Then the preedit text should not be hidden for zero length at least.
-This update might not be enough but hope to fix the cursor position
-reset with hiding the preedit text against the reported issue with
-`m17n:sa:itrans` engine.
-
-BUG=https://github.com/ibus/ibus/issues/2536
----
- src/ibusenginesimple.c | 41 +++++++++++++++++++++++++++++++++++------
- 1 file changed, 35 insertions(+), 6 deletions(-)
-
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 76dd9eb5..ac478855 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -83,11 +83,13 @@ struct _IBusEngineSimplePrivate {
- IBusEngineDict *emoji_dict;
- IBusLookupTable *lookup_table;
- gboolean lookup_table_visible;
-+ IBusText *updated_preedit;
- };
-
- guint COMPOSE_BUFFER_SIZE = 20;
- G_LOCK_DEFINE_STATIC (global_tables);
- static GSList *global_tables;
-+static IBusText *updated_preedit_empty;
-
- /* functions prototype */
- static void ibus_engine_simple_destroy (IBusEngineSimple *simple);
-@@ -135,24 +137,29 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- engine_class->page_up = ibus_engine_simple_page_up;
- engine_class->candidate_clicked
- = ibus_engine_simple_candidate_clicked;
-+ updated_preedit_empty = ibus_text_new_from_string ("");
-+ g_object_ref_sink (updated_preedit_empty);
- }
-
- static void
- ibus_engine_simple_init (IBusEngineSimple *simple)
- {
-+ IBusEngineSimplePrivate *priv;
- GBytes *data;
- GError *error = NULL;
- const char *contents;
- gsize length = 0;
- IBusComposeTableEx *en_compose_table;
-
-- simple->priv = IBUS_ENGINE_SIMPLE_GET_PRIVATE (simple);
-- simple->priv->compose_buffer = g_new0 (guint, COMPOSE_BUFFER_SIZE + 1);
-- simple->priv->hex_mode_enabled =
-+ priv = simple->priv = IBUS_ENGINE_SIMPLE_GET_PRIVATE (simple);
-+ priv->compose_buffer = g_new0 (guint, COMPOSE_BUFFER_SIZE + 1);
-+ priv->hex_mode_enabled =
- g_getenv("IBUS_ENABLE_CTRL_SHIFT_U") != NULL ||
- g_getenv("IBUS_ENABLE_CONTROL_SHIFT_U") != NULL;
-- simple->priv->tentative_match = g_string_new ("");
-- simple->priv->tentative_match_len = 0;
-+ priv->tentative_match = g_string_new ("");
-+ priv->tentative_match_len = 0;
-+ priv->updated_preedit =
-+ (IBusText *)g_object_ref_sink (updated_preedit_empty);
- data = g_resources_lookup_data ("/org/freedesktop/ibus/compose/sequences",
- G_RESOURCE_LOOKUP_FLAGS_NONE,
- &error);
-@@ -190,6 +197,7 @@ ibus_engine_simple_destroy (IBusEngineSimple *simple)
- g_string_free (priv->tentative_match, TRUE);
- priv->tentative_match = NULL;
- priv->tentative_match_len = 0;
-+ g_clear_object (&priv->updated_preedit);
-
- IBUS_OBJECT_CLASS(ibus_engine_simple_parent_class)->destroy (
- IBUS_OBJECT (simple));
-@@ -228,6 +236,9 @@ ibus_engine_simple_reset (IBusEngine *engine)
- priv->tentative_match_len = 0;
- }
- ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-+ g_object_unref (priv->updated_preedit);
-+ priv->updated_preedit =
-+ (IBusText *)g_object_ref_sink (updated_preedit_empty);
- }
-
- static void
-@@ -318,7 +329,10 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- int len = strlen (priv->tentative_emoji);
- ibus_text_append_attribute (text,
- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
-+ g_object_ref_sink (text);
- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
-+ g_object_unref (priv->updated_preedit);
-+ priv->updated_preedit = text;
- g_string_free (s, TRUE);
- return;
- } else if (priv->in_compose_sequence) {
-@@ -370,7 +384,19 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- }
-
- if (s->len == 0) {
-- ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-+ /* #2536 IBusEngine can inherit IBusEngineSimple for comopse keys.
-+ * If the previous preedit is zero, the current preedit does not
-+ * need to be hidden here at least because ibus-daemon could have
-+ * another preedit for the child IBusEnigne likes m17n and caclling
-+ * ibus_engine_hide_preedit_text() here could cause a reset of
-+ * the cursor position in ibus-daemon.
-+ */
-+ if (strlen (priv->updated_preedit->text)) {
-+ ibus_engine_hide_preedit_text ((IBusEngine *)simple);
-+ g_object_unref (priv->updated_preedit);
-+ priv->updated_preedit =
-+ (IBusText *)g_object_ref_sink (updated_preedit_empty);
-+ }
- } else if (s->len >= G_MAXINT) {
- g_warning ("%s is too long compose length: %lu", s->str, s->len);
- } else {
-@@ -378,7 +404,10 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
- IBusText *text = ibus_text_new_from_string (s->str);
- ibus_text_append_attribute (text,
- IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
-+ g_object_ref_sink (text);
- ibus_engine_update_preedit_text ((IBusEngine *)simple, text, len, TRUE);
-+ g_object_unref (priv->updated_preedit);
-+ priv->updated_preedit = text;
- }
- g_string_free (s, TRUE);
- }
---
-2.45.0
-
-From 627e7cc37d3bea4c288c932773f69fcee9ac773e Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 24 May 2024 16:28:40 +0900
-Subject: [PATCH 6/6] ui/gtk3: Fix to unref GdkDisplay in Wayland
-
-Panel does not need to allocate the X11 display in Wayland but the check
-only. Vala codes need to set the unowned parameter.
-Also fixed a memory leak in the update preedit in daemon.
-
-BUG=rhbz#2252227
-BUG=https://github.com/ibus/ibus/issues/2642
-BUG=https://github.com/ibus/ibus/issues/2644
----
- bus/inputcontext.c | 1 +
- ui/gtk3/application.vala | 2 +
- ui/gtk3/bindingcommon.vala | 6 +-
- ui/gtk3/handle.vala | 2 +
- ui/gtk3/panel.vala | 18 ++++-
- 6 files changed, 96 insertions(+), 78 deletions(-)
-
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index c914fbd2..7666f057 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -3306,6 +3306,7 @@ bus_input_context_update_preedit_text (BusInputContext *context,
- pre_data.key = 'm';
- if (bus_input_context_make_post_process_key_event (context,
- &pre_data)) {
-+ g_variant_unref (variant);
- return;
- } else if (context->client_commit_preedit) {
- bus_input_context_emit_signal (
-diff --git a/ui/gtk3/application.vala b/ui/gtk3/application.vala
-index ae67624f..31517c79 100644
---- a/ui/gtk3/application.vala
-+++ b/ui/gtk3/application.vala
-@@ -228,6 +228,8 @@ class Application {
- }
-
- private static void make_wayland_im() {
-+ if (BindingCommon.default_is_xdisplay())
-+ return;
- assert (open_log());
- void *wl_display = null;
- ulong i = 0;
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index e32db178..7e6443c5 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -259,11 +259,11 @@ class BindingCommon {
-
- public static bool default_is_xdisplay() {
- if (m_xdisplay == null)
-- get_xdisplay();
-+ get_xdisplay(true);
- return m_default_is_xdisplay;
- }
-
-- public static Gdk.X11.Display? get_xdisplay() {
-+ public static Gdk.X11.Display? get_xdisplay(bool check_only=false) {
- if (m_xdisplay != null)
- return m_xdisplay;
- var display = Gdk.Display.get_default();
-@@ -277,6 +277,8 @@ class BindingCommon {
- m_xdisplay = (Gdk.X11.Display)display;
- return m_xdisplay;
- }
-+ if (check_only)
-+ return null;
- Gdk.set_allowed_backends("x11");
- // Call _gdk_display_manager_add_display() internally.
- m_xdisplay =
-diff --git a/ui/gtk3/handle.vala b/ui/gtk3/handle.vala
-index 65635439..1d0eefe9 100644
---- a/ui/gtk3/handle.vala
-+++ b/ui/gtk3/handle.vala
-@@ -62,6 +62,8 @@ class Handle : Gtk.EventBox {
- }
-
- public override bool button_press_event(Gdk.EventButton event) {
-+ if (!BindingCommon.default_is_xdisplay())
-+ return false;
- if (event.button != 1)
- return false;
- m_workarea = Gdk.Rectangle(){
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index d907458e..534a9d37 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -166,6 +166,9 @@ class Panel : IBus.PanelService {
- property_activate(k, s);
- });
-
-+ set_version();
-+ check_wayland();
-+
- state_changed();
- }
-
-@@ -443,6 +446,8 @@ class Panel : IBus.PanelService {
- }
-
- private void bind_switch_shortcut() {
-+ if (m_is_wayland_im)
-+ return;
- string[] accelerators = m_settings_hotkey.get_strv("triggers");
-
- var keybinding_manager = KeybindingManager.get_instance();
-@@ -874,6 +879,16 @@ class Panel : IBus.PanelService {
- message = format.printf(Environment.get_prgname());
- }
- }
-+ if (!m_is_wayland && m_is_wayland_im) {
-+ var format =
-+ _("Seems you run %s with '--enable-wayland-im' " +
-+ "option but your display server is Xorg so the Wayland " +
-+ "feature is disabled. You would be better off running " +
-+ "ibus-daemon directly instead or %s without that " +
-+ "option.");
-+ unowned string prgname = Environment.get_prgname();
-+ message = format.printf(prgname, prgname);
-+ }
- if (message == null)
- return;
- #if ENABLE_LIBNOTIFY
-@@ -908,9 +923,6 @@ class Panel : IBus.PanelService {
-
-
- public void load_settings() {
-- set_version();
-- check_wayland();
--
- init_engines_order();
-
- // Update m_use_system_keyboard_layout before update_engines()
---
-2.45.0
-
-From aea035a96261f9c3a36f5cd9c30b84b1d7609103 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 8 Jun 2024 10:23:31 +0900
-Subject: [PATCH] ui/gtk3: Fix Super-space in Wayland
-
-ibus_bus_set_global_shortcut_keys_async() was not called in Plasma
-Wayland after "Fix to unref GdkDisplay in Wayland" patch is applied.
-Now it's called correctly and the event handler is disabled instead.
-
-BUG=rhbz#2290842
-BUG=https://github.com/ibus/ibus/issues/2644
-Fixes: https://github.com/ibus/ibus/commit/627e7cc
----
- ui/gtk3/keybindingmanager.vala | 9 +++++----
- ui/gtk3/panel.vala | 5 ++---
- 2 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/ui/gtk3/keybindingmanager.vala b/ui/gtk3/keybindingmanager.vala
-index 71b4acb2..d4c7636a 100644
---- a/ui/gtk3/keybindingmanager.vala
-+++ b/ui/gtk3/keybindingmanager.vala
-@@ -60,8 +60,9 @@ public class KeybindingManager : GLib.Object {
- public delegate void KeybindingHandlerFunc(Gdk.Event event);
-
-
-- private KeybindingManager() {
-- Gdk.Event.handler_set(event_handler);
-+ private KeybindingManager(bool is_wayland_im) {
-+ if (!is_wayland_im)
-+ Gdk.Event.handler_set(event_handler);
- }
-
- /**
-@@ -107,9 +108,9 @@ public class KeybindingManager : GLib.Object {
- m_bindings.remove (binding);
- }
-
-- public static KeybindingManager get_instance () {
-+ public static KeybindingManager get_instance (bool is_wayland_im=false) {
- if (m_instance == null)
-- m_instance = new KeybindingManager ();
-+ m_instance = new KeybindingManager (is_wayland_im);
- return m_instance;
- }
-
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 534a9d37..b24c23ac 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -446,11 +446,10 @@ class Panel : IBus.PanelService {
- }
-
- private void bind_switch_shortcut() {
-- if (m_is_wayland_im)
-- return;
- string[] accelerators = m_settings_hotkey.get_strv("triggers");
-
-- var keybinding_manager = KeybindingManager.get_instance();
-+ var keybinding_manager =
-+ KeybindingManager.get_instance(m_is_wayland_im);
-
- BindingCommon.KeyEventFuncType ftype =
- BindingCommon.KeyEventFuncType.IME_SWITCHER;
---
-2.45.0
-
-From be94b8ddb4c37fe83646860a08c600b98e67fe84 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 25 May 2024 18:10:36 +0900
-Subject: [PATCH] src/ibusengine: Hide preedit text with PanelExtensionReceived
- signal
-
-IBusEngineSimple no longer calls to hide the preedit with the zero
-length to fix the slurring cursor position but the emoji preedit
-becomes not to be hidden with the preedit commit or escape events
-as a side effect.
-To fix the issue, IBusEngine needs to decide to clear or keep
-the preedit when the emoji mode is finished.
-
-BUG=https://github.com/ibus/ibus/issues/2536
-Fixes: https://github.com/ibus/ibus/commit/a3a5a20a
----
- src/ibusengine.c | 11 +++++++++++
- src/ibusenginesimple.c | 2 +-
- 2 files changed, 12 insertions(+), 1 deletion(-)
-
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index eff4992c..0352fd49 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -1326,6 +1326,17 @@ ibus_engine_service_method_call (IBusService *service,
- return;
- }
- priv->enable_extension = ibus_extension_event_is_enabled (event);
-+ /* IBusEngineSimple no longer calls to hide the preedit with the zero
-+ * lenght and this sends the null preedit here when the emojier
-+ * commits or escapes the emoji preedit text.
-+ * TODO: Do we need a signal for the parent engines to inform this
-+ * information because some engines don't wish to hide their preedit
-+ * with hiding the emoji preedit?
-+ */
-+ if (!priv->enable_extension) {
-+ IBusText *text = ibus_text_new_from_static_string ("");
-+ ibus_engine_update_preedit_text (engine, text, 0, FALSE);
-+ }
- g_dbus_method_invocation_return_value (invocation, NULL);
- return;
- }
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index ac478855..e2f96a37 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -385,7 +385,7 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
-
- if (s->len == 0) {
- /* #2536 IBusEngine can inherit IBusEngineSimple for comopse keys.
-- * If the previous preedit is zero, the current preedit does not
-+ * If the previous preedit is zero, the current preedit does not
- * need to be hidden here at least because ibus-daemon could have
- * another preedit for the child IBusEnigne likes m17n and caclling
- * ibus_engine_hide_preedit_text() here could cause a reset of
---
-2.45.0
-
-From 759105df1d83ae25d9eea801a7c91e67dca43cb8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 25 May 2024 19:23:23 +0900
-Subject: [PATCH 1/6] bus: Change IBus unique name to :1.0 from IBUS_SERVICE_IBUS
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-According to the D-Bus specification,
-`org.freedesktop.DBus.GetNameOwner()` must return a unique name (i.e.
-one of the form `:1.23`). The only unique name which is allowed to not
-be in this form is `org.freedesktop.DBus`.
-
-The change in GLib 2.80.1 was to validate that the sender of every
-message is either a unique name (according to `g_dbus_is_unique_name()`),
-or the special name `org.freedesktop.DBus` to meet the specification.
-
-In the long term, it might be more robust to rework the code so that the
-mapping from `org.freedesktop.IBus` → a unique name is stored in
-`dbus->names` (in `dbusimpl.c`) like all the other requested names.
-However, handling for the `org.freedesktop.IBus` well-known name is
-hardcoded throughout `dbusimpl.c`, so porting this single bit of it to
-create a `BusNameService` would probably cause more problems.
-
-BUG=https://github.com/ibus/ibus/issues/2639
-BUG=https://gitlab.gnome.org/GNOME/glib/-/issues/3268
-BUG=https://github.com/advisories/GHSA-f632-c3rh-r2v2
----
- bus/connection.h | 3 +++
- bus/dbusimpl.c | 29 +++++++++++++++--------------
- bus/ibusimpl.c | 13 +++++++------
- bus/inputcontext.c | 2 +-
- bus/matchrule.c | 10 +++++++++-
- bus/matchrule.h | 4 +++-
- 6 files changed, 38 insertions(+), 23 deletions(-)
-
-diff --git a/bus/connection.h b/bus/connection.h
-index 440faf1e..8264980e 100644
---- a/bus/connection.h
-+++ b/bus/connection.h
-@@ -42,6 +42,9 @@
- #define BUS_CONNECTION_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), BUS_TYPE_CONNECTION, BusConnectionClass))
-
-+/* bus_dbus_impl_hello() sets the client unique names ":1.1" or later. */
-+#define IBUS_NAME_OWNER_NAME ":1.0"
-+
- G_BEGIN_DECLS
-
- typedef struct _BusConnection BusConnection;
-diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
-index 59787a80..52092e58 100644
---- a/bus/dbusimpl.c
-+++ b/bus/dbusimpl.c
-@@ -710,7 +710,8 @@ bus_dbus_impl_list_names (BusDBusImpl *dbus,
-
- /* FIXME should add them? */
- g_variant_builder_add (&builder, "s", "org.freedesktop.DBus");
-- g_variant_builder_add (&builder, "s", "org.freedesktop.IBus");
-+ g_variant_builder_add (&builder, "s", IBUS_SERVICE_IBUS);
-+ g_variant_builder_add (&builder, "s", IBUS_NAME_OWNER_NAME);
-
- /* append well-known names */
- GList *names, *name;
-@@ -785,11 +786,11 @@ bus_dbus_impl_get_name_owner (BusDBusImpl *dbus,
- const gchar *name = NULL;
- g_variant_get (parameters, "(&s)", &name);
-
-- if (g_strcmp0 (name, "org.freedesktop.DBus") == 0 ||
-- g_strcmp0 (name, "org.freedesktop.IBus") == 0) {
-+ if (!g_strcmp0 (name, "org.freedesktop.DBus")) {
- name_owner = name;
-- }
-- else {
-+ } else if (!g_strcmp0 (name, IBUS_SERVICE_IBUS)) {
-+ name_owner = IBUS_NAME_OWNER_NAME;
-+ } else {
- BusConnection *owner = bus_dbus_impl_get_connection_by_name (dbus, name);
- if (owner != NULL) {
- name_owner = bus_connection_get_unique_name (owner);
-@@ -800,8 +801,7 @@ bus_dbus_impl_get_name_owner (BusDBusImpl *dbus,
- g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER,
- "Can not get name owner of '%s': no such name", name);
-- }
-- else {
-+ } else {
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(s)", name_owner));
- }
-@@ -932,6 +932,9 @@ bus_dbus_impl_add_match (BusDBusImpl *dbus,
- "Parse match rule [%s] failed", rule_text);
- return;
- }
-+ /* ibus_bus_watch_ibus_signal() supports IBUS_SERVICE_IBUS sender. */
-+ if (!g_strcmp0 (bus_match_rule_get_sender (rule), IBUS_SERVICE_IBUS))
-+ bus_match_rule_set_sender (rule, IBUS_NAME_OWNER_NAME);
-
- g_dbus_method_invocation_return_value (invocation, NULL);
- GList *p;
-@@ -1510,7 +1513,8 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
- /* connection unique name as sender of the message*/
- g_dbus_message_set_sender (message, bus_connection_get_unique_name (connection));
-
-- if (g_strcmp0 (destination, "org.freedesktop.IBus") == 0) {
-+ if (!g_strcmp0 (destination, IBUS_SERVICE_IBUS) ||
-+ !g_strcmp0 (destination, IBUS_NAME_OWNER_NAME)) {
- /* the message is sent to IBus service. messages from ibusbus and ibuscontext may fall into this category. */
- switch (message_type) {
- case G_DBUS_MESSAGE_TYPE_METHOD_CALL:
-@@ -1528,8 +1532,7 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
- g_object_unref (message);
- g_return_val_if_reached (NULL); /* return NULL since the service does not handle signals. */
- }
-- }
-- else if (g_strcmp0 (destination, "org.freedesktop.DBus") == 0) {
-+ } else if (!g_strcmp0 (destination, "org.freedesktop.DBus")) {
- /* the message is sent to DBus service. messages from ibusbus may fall into this category. */
- switch (message_type) {
- case G_DBUS_MESSAGE_TYPE_METHOD_CALL:
-@@ -1547,8 +1550,7 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
- g_object_unref (message);
- g_return_val_if_reached (NULL); /* return NULL since the service does not handle signals. */
- }
-- }
-- else if (destination == NULL) {
-+ } else if (destination == NULL) {
- /* the message is sent to the current connection. communications between ibus-daemon and panel/engines may fall into this
- * category since the panel/engine proxies created by ibus-daemon does not set bus name. */
- switch (message_type) {
-@@ -1570,8 +1572,7 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection,
- g_object_unref (message);
- g_return_val_if_reached (NULL); /* return NULL since the service does not handle messages. */
- }
-- }
-- else {
-+ } else {
- /* The message is sent to an other service. Forward it.
- * For example, the config proxy class in src/ibusconfig.c sets its "g-name" property (i.e. destination) to IBUS_SERVICE_CONFIG. */
- bus_dbus_impl_forward_message (dbus, connection, message);
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 875cd550..8681c78b 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -2388,19 +2388,20 @@ bus_ibus_impl_property_changed (BusIBusImpl *service,
- GVariant *value)
- {
- GDBusMessage *message =
-- g_dbus_message_new_signal ("/org/freedesktop/IBus",
-+ g_dbus_message_new_signal (IBUS_PATH_IBUS,
- "org.freedesktop.DBus.Properties",
- "PropertiesChanged");
-
- /* set a non-zero serial to make libdbus happy */
- g_dbus_message_set_serial (message, 1);
-- g_dbus_message_set_sender (message, "org.freedesktop.IBus");
-+ g_dbus_message_set_sender (message, IBUS_NAME_OWNER_NAME);
-+
-
- GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE_ARRAY);
- g_variant_builder_add (builder, "{sv}", property_name, value);
- g_dbus_message_set_body (message,
- g_variant_new ("(sa{sv}as)",
-- "org.freedesktop.IBus",
-+ IBUS_SERVICE_IBUS,
- builder,
- NULL));
- g_variant_builder_unref (builder);
-@@ -2419,12 +2420,12 @@ bus_ibus_impl_emit_signal (BusIBusImpl *ibus,
- const gchar *signal_name,
- GVariant *parameters)
- {
-- GDBusMessage *message = g_dbus_message_new_signal ("/org/freedesktop/IBus",
-- "org.freedesktop.IBus",
-+ GDBusMessage *message = g_dbus_message_new_signal (IBUS_PATH_IBUS,
-+ IBUS_INTERFACE_IBUS,
- signal_name);
- /* set a non-zero serial to make libdbus happy */
- g_dbus_message_set_serial (message, 1);
-- g_dbus_message_set_sender (message, "org.freedesktop.IBus");
-+ g_dbus_message_set_sender (message, IBUS_NAME_OWNER_NAME);
- if (parameters)
- g_dbus_message_set_body (message, parameters);
- bus_dbus_impl_dispatch_message_by_rule (BUS_DEFAULT_DBUS, message, NULL);
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index 7666f057..e0ad0742 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -755,7 +755,7 @@ bus_input_context_send_signal (BusInputContext *context,
- ibus_service_get_object_path ((IBusService *)context),
- interface_name,
- signal_name);
-- g_dbus_message_set_sender (message, "org.freedesktop.IBus");
-+ g_dbus_message_set_sender (message, IBUS_NAME_OWNER_NAME);
- g_dbus_message_set_destination (
- message,
- bus_connection_get_unique_name (context->connection));
-diff --git a/bus/matchrule.c b/bus/matchrule.c
-index 4fb1d902..2381ca9e 100644
---- a/bus/matchrule.c
-+++ b/bus/matchrule.c
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2024 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
-@@ -407,6 +408,13 @@ bus_match_rule_set_message_type (BusMatchRule *rule,
- return TRUE;
- }
-
-+const gchar *
-+bus_match_rule_get_sender (BusMatchRule *rule)
-+{
-+ g_return_val_if_fail (rule != NULL, NULL);
-+ return rule->sender;
-+}
-+
- gboolean
- bus_match_rule_set_sender (BusMatchRule *rule,
- const gchar *sender)
-diff --git a/bus/matchrule.h b/bus/matchrule.h
-index 1dd304cd..37b6347b 100644
---- a/bus/matchrule.h
-+++ b/bus/matchrule.h
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2024 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2024 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
-@@ -57,6 +58,7 @@ void bus_match_rule_free (BusMatchRule *rule);
- gboolean bus_match_rule_set_message_type
- (BusMatchRule *rule,
- gint type);
-+const gchar * bus_match_rule_get_sender (BusMatchRule *rule);
- gboolean bus_match_rule_set_sender (BusMatchRule *rule,
- const gchar *sender);
- gboolean bus_match_rule_set_interface
---
-2.45.0
-
-From a4d58cb859cad4a0c12e2c2a34f440f77cd73bae Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 1 Jun 2024 20:20:19 +0900
-Subject: [PATCH 2/6] portal: Let Flatpak application accept new IBus unique name
-
-ibus-portal can accept the connection from IBUS_SERVICE_IBUS only
-but now the IBus unique name is changed to IBUS_NAME_OWNER_NAME
-as the D-Bus name owner and probably I think the name check is
-not needed and just delete it.
-
-BUG=https://github.com/ibus/ibus/issues/2639
-Fixes: https://github.com/ibus/ibus/commit/759105d
----
- portal/portal.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-diff --git a/portal/portal.c b/portal/portal.c
-index c2e4fc7f..34da9679 100644
---- a/portal/portal.c
-+++ b/portal/portal.c
-@@ -400,9 +400,6 @@ portal_context_g_signal (GDBusProxy *proxy,
- GError *error = NULL;
- GDBusConnection *connection;
-
-- if (g_strcmp0 (sender_name, IBUS_SERVICE_IBUS) != 0)
-- return;
--
- connection = g_dbus_interface_skeleton_get_connection (
- G_DBUS_INTERFACE_SKELETON (portal_context));
- if (!g_dbus_connection_emit_signal (connection,
---
-2.45.0
-
-From 02632ccdd430fdc3d1a58025d31c5ec72d9a7989 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 1 Jun 2024 20:32:29 +0900
-Subject: [PATCH 3/6] portal: Support new sync ibus_input_context_process_key_event()
-
-IBus clients have been enhanced with the new synchronous
-"ProcessKeyEvent" to fix the long-standing issues and ibus-portal
-also needs to support it.
-
-Fixes: https://github.com/ibus/ibus/commit/38f09c6
----
- portal/org.freedesktop.IBus.Portal.xml | 7 +++-
- portal/portal.c | 54 ++++++++++++++++++++++++--
- 2 files changed, 56 insertions(+), 5 deletions(-)
-
-diff --git a/portal/org.freedesktop.IBus.Portal.xml b/portal/org.freedesktop.IBus.Portal.xml
-index 376ad424..0b3f6864 100644
---- a/portal/org.freedesktop.IBus.Portal.xml
-+++ b/portal/org.freedesktop.IBus.Portal.xml
-@@ -1,6 +1,6 @@
- <?xml version="1.0"?>
- <!--
-- Copyright (C) 2017-2019 Red Hat, Inc.
-+ Copyright (C) 2017-2024 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
-@@ -128,8 +128,13 @@
- <arg type='v' name='prop' />
- </signal>
-
-+ <property name='PostProcessKeyEvent' type='(a(yv))' access='read'>
-+ </property>
- <property name='ContentType' type='(uu)' access='write' />
- <property name='ClientCommitPreedit' type='(b)' access='write' />
-+ <property name='EffectivePostProcessKeyEvent' type='(b)' access='write'>
-+ </property>
-+
- </interface>
-
- <interface name='org.freedesktop.IBus.Service'>
-diff --git a/portal/portal.c b/portal/portal.c
-index 34da9679..5cd38779 100644
---- a/portal/portal.c
-+++ b/portal/portal.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2017-2021 Red Hat, Inc.
-+ * Copyright (C) 2017-2024 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
-@@ -66,8 +66,10 @@ struct _IBusPortalClass
-
- enum
- {
-- PROP_CONTENT_TYPE = 1,
-+ PROP_POST_PROCESS_KEY_EVENT = 1,
-+ PROP_CONTENT_TYPE,
- PROP_CLIENT_COMMIT_PREEDIT,
-+ PROP_EFFECTIVE_POST_PROCESS_KEY_EVENT,
- N_PROPERTIES
- };
-
-@@ -330,6 +332,23 @@ ibus_portal_context_set_property (IBusPortalContext *portal_context,
- NULL /* user_data */
- );
- break;
-+ case PROP_EFFECTIVE_POST_PROCESS_KEY_EVENT:
-+ g_dbus_proxy_call (G_DBUS_PROXY (portal_context->context),
-+ "org.freedesktop.DBus.Properties.Set",
-+ g_variant_new ("(ssv)",
-+ IBUS_INTERFACE_INPUT_CONTEXT,
-+ "EffectivePostProcessKeyEvent",
-+ g_value_get_variant (value)),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL, /* cancellable */
-+ NULL, /* callback */
-+ NULL /* user_data */
-+ );
-+ break;
-+ case PROP_POST_PROCESS_KEY_EVENT:
-+ g_warning ("No support for setting content type");
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (portal_context, prop_id, pspec);
- }
-@@ -341,10 +360,37 @@ ibus_portal_context_get_property (IBusPortalContext *portal_context,
- GValue *value,
- GParamSpec *pspec)
- {
-+ GVariant *result;
-+ GVariant *variant = NULL;
-+ GError *error = NULL;
- switch (prop_id) {
-+ case PROP_POST_PROCESS_KEY_EVENT:
-+ result = g_dbus_proxy_call_sync (G_DBUS_PROXY (portal_context->context),
-+ "org.freedesktop.DBus.Properties.Get",
-+ g_variant_new (
-+ "(ss)",
-+ IBUS_INTERFACE_INPUT_CONTEXT,
-+ "PostProcessKeyEvent"),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL, /* cancellable */
-+ &error);
-+ if (error) {
-+ g_warning ("Error PostProcessKeyEvent: %s", error->message);
-+ g_error_free (error);
-+ break;
-+ }
-+ g_variant_get (result, "(v)", &variant);
-+ if (!variant) {
-+ g_warning ("No child in PostProcessKeyEvent");
-+ break;
-+ }
-+ g_value_set_variant (value, variant);
-+ break;
- case PROP_CONTENT_TYPE:
- case PROP_CLIENT_COMMIT_PREEDIT:
-- g_warning ("No support for setting content type");
-+ case PROP_EFFECTIVE_POST_PROCESS_KEY_EVENT:
-+ g_warning ("No support for getting content type");
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (portal_context, prop_id, pspec);
-@@ -387,7 +433,7 @@ ibus_portal_context_class_init (IBusPortalContextClass *klass)
- skeleton_class->g_authorize_method = ibus_portal_context_g_authorize_method;
-
- ibus_dbus_input_context_override_properties (gobject_class,
-- PROP_CONTENT_TYPE);
-+ PROP_POST_PROCESS_KEY_EVENT);
- }
-
- static void
---
-2.45.0
-
-From 871c8312aa4bd6b785d7d9c779a1f9f51b709802 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 1 Jun 2024 21:27:38 +0900
-Subject: [PATCH 5/6] Fix Flatpak build for dnf and pyoverridesdir
-
-`dnf` is not available during Flatpak builds with `flatpak-builder` and
-the steps are omitted in autogen.sh to check FLATPAK_ID environment
-variable.
-
-When IBus is built with the Json files in test directory, the build
-tries to install IBus.py file into pyoverridesdir likes
-/usr/lib*/python3.12/site-packages/gi/overrides
-
-But the directory is readonly with `flatpak-builder` and could be
-failed.
-Now `--disable-pygobject` option is added to `configure`.
-
-IBus modules are embedded in Flatpak platforms likes GNOME, Freedesktop
-and this issue might not happen in the platform builds since
-the pyoverridesdir does not exist yet so this might fix the build
-issues with Json files only in test directory.
----
- autogen.sh | 2 +-
- configure.ac | 15 +++++++++++++--
- 4 files changed, 40 insertions(+), 9 deletions(-)
-
-diff --git a/autogen.sh b/autogen.sh
-index 90e126ec..cde8aaef 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -42,7 +42,7 @@ cd "$srcdir"
- touch ChangeLog
- }
-
--(test "x$DISABLE_INSTALL_PKGS" = "x") && {
-+(test "x$DISABLE_INSTALL_PKGS" = "x") && (test "x$FLATPAK_ID" = "x" ) && {
- (test -f /etc/fedora-release ) && {
- rpm -q $FEDORA_PKG1 || exit 1
- rpm -q $FEDORA_PKG2 || exit 1
-diff --git a/configure.ac b/configure.ac
-index a5210004..fd1d15f7 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -509,9 +509,20 @@ AM_CONDITIONAL([ENABLE_DAEMON], [true])
-
- PYGOBJECT_REQUIRED=3.0.0
-
--PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
-- [enable_pygobject=yes], [enable_pygobject=no])
-+# When IBus is built with the Json files in test directory, the build
-+# tries to install IBus.py file into pyoverridesdir
-+# but the directory is readonly with `flatpak-builder`
-+AC_ARG_ENABLE(pygobject,
-+ AS_HELP_STRING([--disable-pygobject],
-+ [Disable pygobject.]),
-+ [enable_pygobject=$enableval],
-+ [enable_pygobject=yes]
-+)
-
-+if test "x$enable_pygobject" = "xyes"; then
-+ PKG_CHECK_EXISTS([pygobject-3.0 >= $PYGOBJECT_REQUIRED],
-+ [enable_pygobject=yes], [enable_pygobject=no])
-+fi
- if test "x$enable_pygobject" = "xyes"; then
- PKG_CHECK_MODULES(PYTHON, [pygobject-3.0 >= $PYGOBJECT_REQUIRED])
-
---
-2.45.0
-
-From 8d314d749f5ab83eb6de189faba184108fbccd61 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 8 Jun 2024 11:46:57 +0900
-Subject: [PATCH 1/2] src/ibuscomposetable: Fix UFDD5 key for compose seq with fr(bepo_afnor)
-
-AltGr-t with fr(bepo_afnor) keymap has no keysym name but can be
-used in the compose key sequences.
-Most Unicode format (UXXXX) should be supported in the compose sequences
-in case they are not used in XKB options except for 'Pointer_*' XKB option
-names.
-Also refactor compose sequences with each range beyond U10000.
-Also update ibus_keyval_name() can output keysym names beyond U10000.
-
-BUG=https://github.com/ibus/ibus/issues/2646
-Fixes: https://github.com/ibus/ibus/commit/ad883dc
----
- src/ibuscomposetable.c | 35 +++++++++++++++++++++++++++++------
- src/ibusenginesimpleprivate.h | 1 +
- src/ibuskeynames.c | 7 +------
- src/tests/ibus-compose.basic | 10 ++++++++++
- 4 files changed, 41 insertions(+), 12 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 9d4377a9..2c97fd3b 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* ibus - The Input Bus
- * Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2013-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013-2024 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
-@@ -222,6 +222,12 @@ parse_compose_sequence (IBusComposeData *compose_data,
- compose_data->sequence[n] = codepoint;
- }
-
-+ if (codepoint >= 0x10000) {
-+ if (!ibus_compose_key_flag (0xffff & codepoint)) {
-+ g_warning ("The keysym %s > 0xffff is not supported: %s",
-+ match, line);
-+ }
-+ }
- if (codepoint == IBUS_KEY_VoidSymbol) {
- g_warning ("Could not get code point of keysym %s: %s",
- match, line);
-@@ -603,6 +609,7 @@ ibus_compose_list_check_duplicated (GList *compose_list,
-
- /*
- * Actual typed keysyms have a flag against the definition.
-+ * https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/master/include/X11/keysymdef.h?ref_type=heads#L82
- * https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/nls/en_US.UTF-8/Compose.pre#L4559
- */
- guint
-@@ -611,11 +618,27 @@ ibus_compose_key_flag (guint key)
- const char *name;
- if (key <= 0xff)
- return 0;
-+ switch (key) {
-+ /* <Aogonek> is not used in UTF-8 compose sequences but <ohorn> in EN
-+ * compose file and vn keymap is assumed instead.
-+ */
-+ case 0x1a1:
-+ /* <Zabovedot> is not used in UTF-8 compose sequences but <Uhorn> in EN
-+ * compose file and vn keymap s assumed instead.
-+ */
-+ case 0x1af:
-+ /* <caron> is not used in UTF-8 compose sequences but <EZH> in EN compose
-+ * file and fr(nodeadkeys) keymap is assumed instead.
-+ */
-+ case 0x1b7:
-+ return 0x1000000;
-+ default:;
-+ }
- name = ibus_keyval_name (key);
- /* If name is null, the key sequence is expressed as "<Uxxxx>" format in
- * the Compose file and the typed keysym has the flag.
- */
-- if (!name)
-+ if (!name || g_str_has_prefix (name, "0x"))
- return 0x1000000;
- /* "<Pointer_EnableKeys>" is not described in the Compose file but <UFEF9>
- * in the file.
-@@ -648,8 +671,8 @@ ibus_compose_data_compare (gpointer a,
- gunichar code_a = compose_data_a->sequence[i];
- gunichar code_b = compose_data_b->sequence[i];
-
-- code_a += ibus_compose_key_flag (code_a);
-- code_b += ibus_compose_key_flag (code_b);
-+ code_a &= 0xffff;
-+ code_b &= 0xffff;
- if (code_a != code_b)
- return code_a - code_b;
- if (code_a == 0 && code_b == 0)
-@@ -1581,9 +1604,9 @@ compare_seq (const void *key, const void *value)
- guint saved_key = (guint)seq[i];
- guint flag = ibus_compose_key_flag (saved_key);
- if (typed_key < (saved_key + flag))
-- return -1;
-+ return (0xffff & typed_key) - saved_key;
- else if (typed_key > (saved_key + flag))
-- return 1;
-+ return (0xffff & typed_key) - saved_key;
-
- i++;
- }
-diff --git a/src/ibusenginesimpleprivate.h b/src/ibusenginesimpleprivate.h
-index fd600853..ae42342b 100644
---- a/src/ibusenginesimpleprivate.h
-+++ b/src/ibusenginesimpleprivate.h
-@@ -42,6 +42,7 @@ struct _IBusComposeTablePrivate
- };
-
-
-+guint ibus_compose_key_flag (guint key);
- gboolean ibus_check_algorithmically (const guint *compose_buffer,
- int n_compose,
- gunichar *output);
-diff --git a/src/ibuskeynames.c b/src/ibuskeynames.c
-index 544c6ade..2925bdec 100644
---- a/src/ibuskeynames.c
-+++ b/src/ibuskeynames.c
-@@ -47,12 +47,7 @@ ibus_keyval_name (guint keyval)
- static gchar buf[100];
- gdk_key *found;
-
-- /* Check for directly encoded 24-bit UCS characters: */
-- if ((keyval & 0xff000000) == 0x01000000)
-- {
-- g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
-- return buf;
-- }
-+ /* <ohorn> with 0x01000000 is supported in gdk_keys_by_keyval */
-
- found = bsearch (&keyval, gdk_keys_by_keyval,
- IBUS_NUM_KEYS, sizeof (gdk_key),
-diff --git a/src/tests/ibus-compose.basic b/src/tests/ibus-compose.basic
-index 0735d4ea..4e8cb9ab 100644
---- a/src/tests/ibus-compose.basic
-+++ b/src/tests/ibus-compose.basic
-@@ -8,6 +8,13 @@
- <dead_macron> <U0227> : "ǟ" U01DE
- <Multi_key> <macron> <U0227> : "ǟ" U01DE
- <Multi_key> <underscore> <U0227> : "ǟ" U01DE
-+# AltGr-t, Shift-asterisk with fr(bepo_afnor) keymap outputs
-+# <UFDD5> <0>
-+# Support Unicode keysyms in case they are not used in XKB options except
-+# for 'Pointer_*' XKB option names.
-+<UFDD5> <0> : "⁰" U2070
-+#
-+### Multibyte chars tests
- # Khmer digraphs
- # This case swaps U17fe and U17ff in en-US
- <U17fe> : "ាំ"
-@@ -22,3 +29,6 @@
- # This case swaps c_h and C_h in en-US
- <c_h> : "C’h"
- <C_h> : "c’h"
-+# Some <U10000> are supported for musical composer in en-US
-+<Multi_key> <U1D157> <U1D165> : "𝇒" U1D1D2 # MUSICAL SYMBOL SQUARE B
-+
---
-2.45.0
-
-From 909dff4fd50d86492fb7f42a09bbd04625fa60f4 Mon Sep 17 00:00:00 2001
-From: Wismill <dev@wismill.eu>
-Date: Sat, 8 Jun 2024 11:47:01 +0900
-Subject: [PATCH 2/2] src/tests/ibus-compose: Add some Unicode boundary tests
-
-BUG=https://github.com/ibus/ibus/pull/2649
----
- src/tests/ibus-compose.basic | 8 +++++++-
- src/tests/ibus-compose.emoji | 4 ++++
- 2 files changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/src/tests/ibus-compose.basic b/src/tests/ibus-compose.basic
-index 4e8cb9ab..d904dbb4 100644
---- a/src/tests/ibus-compose.basic
-+++ b/src/tests/ibus-compose.basic
-@@ -3,7 +3,9 @@
- <Multi_key> <quotedbl> <Cyrillic_zhe> : "Ӝ" U04DC
- <Multi_key> <quotedbl> <Cyrillic_ZHE> : "ӝ" U04DD
- #
--# Unicode tests of Uxxxx
-+# A Unicode keysym <Uxxxx> has a real value 0x01000000 + xxxx.
-+# https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/master/include/X11/keysymdef.h?ref_type=heads#L82
-+#
- # en-US is "ǡ" U01E1 but this case is "ǟ" U01DE
- <dead_macron> <U0227> : "ǟ" U01DE
- <Multi_key> <macron> <U0227> : "ǟ" U01DE
-@@ -13,6 +15,10 @@
- # Support Unicode keysyms in case they are not used in XKB options except
- # for 'Pointer_*' XKB option names.
- <UFDD5> <0> : "⁰" U2070
-+# ohorn, grave with vn keymap
-+# IBus does not distingish ohorn and Aogonek
-+<ohorn> <grave> : "Ờ" U1EDC
-+<U01A1> <grave> : "Ờ" U1EDC
- #
- ### Multibyte chars tests
- # Khmer digraphs
-diff --git a/src/tests/ibus-compose.emoji b/src/tests/ibus-compose.emoji
-index 7fbf82cf..fdd560f8 100644
---- a/src/tests/ibus-compose.emoji
-+++ b/src/tests/ibus-compose.emoji
-@@ -1,3 +1,4 @@
-+# Emoji tests
- <Multi_key> <Multi_key> <l> <e> <o> : "♌" U264C # LEO
- <Multi_key> <Multi_key> <v> <i> <r> <g> <o> : "♍" U264D # VIRGO
- <Multi_key> <Multi_key> <I> <n> <t> : "∫"
-@@ -9,3 +10,6 @@
- <Multi_key> <Multi_key> <o> <I> <n> <t> : "∮"
- <Multi_key> <Multi_key> <o> <I> <I> <n> <t> : "∯"
- <Multi_key> <Multi_key> <o> <I> <I> <I> <n> <t> : "∰"
-+# Unicode boundary tests
-+<U2800> <0> : "a"
-+<braille_blank> <0> : "a"
---
-2.45.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete Upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : b3ac342af1264e939142eb684e0cde74847670e2
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2024-04-02T22:05:05+09:00
Stats : +0/-89 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/b3ac342af1264e939142eb684e0cde74847670e2?branch=autotool
Log:
Delete Upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index c1ca02e..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,89 +0,0 @@
-From 7f3bde01636213605e3b9c62d91b8f9b5635b9a6 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 23 Mar 2024 13:09:26 +0900
-Subject: [PATCH] src/ibusengine: Identify SUPER_MASK in GTK4 with MOD4_MASK
-
-Fix the regression not to save the changed modifiers.
-
-Fixes: https://github.com/ibus/ibus/commit/e4eaeb7
-BUG=https://github.com/ibus/ibus/issues/2607
----
- src/ibusengine.c | 22 ++++++++++++++++------
- 1 file changed, 16 insertions(+), 6 deletions(-)
-
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index 9cdf6479..eff4992c 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -317,7 +317,11 @@ static const guint IBUS_MODIFIER_FILTER =
- IBUS_BUTTON2_MASK |
- IBUS_BUTTON3_MASK |
- IBUS_BUTTON4_MASK |
-- IBUS_BUTTON5_MASK);
-+ IBUS_BUTTON5_MASK |
-+ IBUS_SUPER_MASK |
-+ IBUS_HYPER_MASK |
-+ IBUS_META_MASK);
-+
-
- static void
- ibus_engine_class_init (IBusEngineClass *class)
-@@ -1112,7 +1116,17 @@ ibus_engine_filter_key_event (IBusEngine *engine,
- g_return_val_if_fail (IBUS_IS_ENGINE (engine), FALSE);
-
- priv = engine->priv;
-- modifiers = state & IBUS_MODIFIER_FILTER;
-+ modifiers = state;
-+ /*
-+ * GTK3 has both IBUS_SUPER_MASK & IBUS_MOD4_MASK.
-+ * GTK4 has IBUS_SUPER_MASK.
-+ * Qt5 has IBUS_MOD4_MASK.
-+ */
-+ if (modifiers & IBUS_SUPER_MASK) {
-+ modifiers &= ~IBUS_SUPER_MASK;
-+ modifiers |= IBUS_MOD4_MASK;
-+ }
-+ modifiers = modifiers & IBUS_MODIFIER_FILTER;
- if (keyval >= IBUS_KEY_A && keyval <= IBUS_KEY_Z &&
- (modifiers & IBUS_SHIFT_MASK) != 0) {
- keyval = keyval - IBUS_KEY_A + IBUS_KEY_a;
-@@ -1130,10 +1144,6 @@ ibus_engine_filter_key_event (IBusEngine *engine,
- for (; keys; keys++) {
- if (keys->keyval == 0 && keys->keycode == 0 && keys->state == 0)
- break;
-- if ((keys->state != modifiers) && (keys->state & IBUS_MOD4_MASK)) {
-- keys->state &= ~IBUS_MOD4_MASK;
-- keys->state |= IBUS_SUPER_MASK;
-- }
- if (keys->keyval == keyval &&
- keys->state == modifiers &&
- (keys->keycode == 0 || keys->keycode == keycode)) {
---
-2.43.0
-
-From 707832954e1aaaae9a695d9771e84a21844be605 Mon Sep 17 00:00:00 2001
-From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
-Date: Mon, 25 Mar 2024 14:40:12 +0900
-Subject: [PATCH] configure: Fix bash '=' operator for BSD
-
-BUG=https://github.com/ibus/ibus/pull/2626
----
- configure.ac | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0bb8e4a1..15cb02cd 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -356,7 +356,7 @@ if test x"$cross_compiling" != xyes; then
- X11_LOCALEDATADIR="$X11_PREFIX/lib/X11/locale",
- X11_LOCALEDATADIR="$(datadir)/X11/locale")])
- else
-- if test x"$X11_LOCALEDATADIR" == x; then
-+ if test x"$X11_LOCALEDATADIR" = x; then
- X11_LOCALEDATADIR="$X11_PREFIX/share/X11/locale"
- fi
- AC_MSG_RESULT([Skipping X11 locale directory check when cross compiling. Using: $X11_LOCALEDATADIR])
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : 17419044c733f313f4e90e7200d6d0c8a56ccbc2
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2024-02-13T21:24:46+09:00
Stats : +0/-1695 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/17419044c733f313f4e90e7200d6d0c8a56ccbc2?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index c8e4a54..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,1695 +0,0 @@
-From 59944ddbfe915f195e757c509246b597048116cf Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 25 Nov 2023 13:42:31 +0900
-Subject: [PATCH] client/wayland: Implement preedit color in Plasma Wayland
-
-Wayland input-method protocol version 1 supports the preedit style
-with text-input protocol version 1 in Plasma Wayland.
-GNOME Wayland uses text-input version 3 which deletes the preedit style.
-
-Now IBus supports the preedit color for anthy, hangul, table,
-typing-booster.
-
-This change now also supports
-ibus_engine_update_preedit_text_with_mode()
-
-Rf. https://github.com/ibus/ibus/wiki/Wayland-Colors
-
-BUG=rhbz#2237486
----
- client/wayland/Makefile.am | 1 +
- client/wayland/ibuswaylandim.c | 204 ++++-
- .../text-input-unstable-v1-client-protocol.h | 847 ++++++++++++++++++
- src/ibusattribute.h | 52 +-
- 4 files changed, 1101 insertions(+), 3 deletions(-)
- create mode 100644 client/wayland/text-input-unstable-v1-client-protocol.h
-
-diff --git a/client/wayland/Makefile.am b/client/wayland/Makefile.am
-index 7e8d18af..94e357b4 100644
---- a/client/wayland/Makefile.am
-+++ b/client/wayland/Makefile.am
-@@ -31,6 +31,7 @@ DISTCLEANFILES =
- protocol_sources = \
- input-method-unstable-v1-client-protocol.h \
- input-method-unstable-v1-protocol.c \
-+ text-input-unstable-v1-client-protocol.h \
- $(NULL)
-
- ibus_wayland_SOURCES = \
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index 8f938288..9e8f651e 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -32,6 +32,7 @@
- #include <xkbcommon/xkbcommon.h>
-
- #include "input-method-unstable-v1-client-protocol.h"
-+#include "text-input-unstable-v1-client-protocol.h"
- #include "ibuswaylandim.h"
-
- enum {
-@@ -58,6 +59,7 @@ struct _IBusWaylandIMPrivate
- IBusInputContext *ibuscontext;
- IBusText *preedit_text;
- guint preedit_cursor_pos;
-+ guint preedit_mode;
- IBusModifierType modifiers;
-
- struct xkb_context *xkb_context;
-@@ -266,12 +268,204 @@ _context_forward_key_event_cb (IBusInputContext *context,
- }
-
-
-+/**
-+ * ibus_wayland_im_update_preedit_style:
-+ * @wlim: An #IBusWaylandIM
-+ *
-+ * Convert RGB values to IBusAttrPreedit at first.
-+ * Convert IBusAttrPreedit to zwp_text_input_v1_preedit_style at second.
-+ *
-+ * RF. https://github.com/ibus/ibus/wiki/Wayland-Colors
-+ */
-+static void
-+ibus_wayland_im_update_preedit_style (IBusWaylandIM *wlim)
-+{
-+ IBusWaylandIMPrivate *priv;
-+ IBusAttrList *attrs;
-+ guint i;
-+ const char *str;
-+ uint32_t whole_wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT;
-+ uint32_t prev_start = 0;
-+ uint32_t prev_end = 0;
-+
-+ g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
-+ priv = ibus_wayland_im_get_instance_private (wlim);
-+ if (!priv->preedit_text)
-+ return;
-+ attrs = priv->preedit_text->attrs;
-+ if (!attrs)
-+ return;
-+ for (i = 0; ; i++) {
-+ IBusAttribute *attr = ibus_attr_list_get (attrs, i);
-+ IBusAttrPreedit istyle = IBUS_ATTR_PREEDIT_DEFAULT;
-+ uint32_t wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT;
-+ uint32_t start, end;
-+ if (attr == NULL)
-+ break;
-+ switch (attr->type) {
-+ case IBUS_ATTR_TYPE_UNDERLINE:
-+ istyle = IBUS_ATTR_PREEDIT_WHOLE;
-+ break;
-+ case IBUS_ATTR_TYPE_FOREGROUND:
-+ switch (attr->value) {
-+ case 0x7F7F7F: /* typing-booster */
-+ istyle = IBUS_ATTR_PREEDIT_PREDICTION;
-+ break;
-+ case 0xF90F0F: /* table */
-+ istyle = IBUS_ATTR_PREEDIT_PREFIX;
-+ break;
-+ case 0x1EDC1A: /* table */
-+ istyle = IBUS_ATTR_PREEDIT_SUFFIX;
-+ break;
-+ case 0xA40000: /* typing-booster, table */
-+ istyle = IBUS_ATTR_PREEDIT_ERROR_SPELLING;
-+ break;
-+ case 0xFF00FF: /* typing-booster */
-+ istyle = IBUS_ATTR_PREEDIT_ERROR_COMPOSE;
-+ break;
-+ case 0x0: /* Japanese */
-+ case 0xFF000000:
-+ break;
-+ case 0xFFFFFF: /* hangul */
-+ case 0xFFFFFFFF:
-+ istyle = IBUS_ATTR_PREEDIT_SELECTION;
-+ break;
-+ default: /* Custom */
-+ istyle = IBUS_ATTR_PREEDIT_NONE;
-+ }
-+ break;
-+ case IBUS_ATTR_TYPE_BACKGROUND:
-+ switch (attr->value) {
-+ case 0xC8C8F0: /* Japanese */
-+ case 0xFFC8C8F0:
-+ istyle = IBUS_ATTR_PREEDIT_SELECTION;
-+ break;
-+ default:; /* Custom */
-+ }
-+ break;
-+ default:
-+ istyle = IBUS_ATTR_PREEDIT_NONE;
-+ }
-+ switch (istyle) {
-+ case IBUS_ATTR_PREEDIT_NONE:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_NONE;
-+ break;
-+ case IBUS_ATTR_PREEDIT_WHOLE:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_UNDERLINE;
-+ break;
-+ case IBUS_ATTR_PREEDIT_SELECTION:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_SELECTION;
-+ break;
-+ case IBUS_ATTR_PREEDIT_PREDICTION:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INACTIVE;
-+ break;
-+ case IBUS_ATTR_PREEDIT_PREFIX:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT;
-+ break;
-+ case IBUS_ATTR_PREEDIT_SUFFIX:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INACTIVE;
-+ break;
-+ case IBUS_ATTR_PREEDIT_ERROR_SPELLING:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INCORRECT;
-+ break;
-+ case IBUS_ATTR_PREEDIT_ERROR_COMPOSE:
-+ wstyle = ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INCORRECT;
-+ break;
-+ default:;
-+ }
-+ if (wstyle == ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT)
-+ continue;
-+ str = priv->preedit_text->text;
-+ start = g_utf8_offset_to_pointer (str, attr->start_index) - str;
-+ end = g_utf8_offset_to_pointer (str, attr->end_index) - str;
-+ /* Double styles cannot be applied likes the underline and
-+ * preedit color. */
-+ if (start == 0 && strlen (str) == end &&
-+ (i > 0 || ibus_attr_list_get (attrs, i + 1))) {
-+ whole_wstyle = wstyle;
-+ continue;
-+ }
-+ if (end < prev_start) {
-+ if (priv->log) {
-+ fprintf (priv->log,
-+ "Reverse order is not supported in end %d for %s "
-+ "against start %d.\n", end, str, prev_start);
-+ fflush (priv->log);
-+ }
-+ continue;
-+ }
-+ if (prev_end > end) {
-+ if (priv->log) {
-+ fprintf (priv->log,
-+ "Nested styles are not supported in end %d for %s "
-+ "against end %d.\n", end, str, prev_end);
-+ fflush (priv->log);
-+ }
-+ continue;
-+ }
-+ if (prev_end > start && prev_start >= start)
-+ start = prev_end;
-+ if (start >= end) {
-+ if (priv->log) {
-+ fprintf (priv->log, "Wrong start %d and end %d for %s.\n",
-+ start, end, str);
-+ fflush (priv->log);
-+ }
-+ return;
-+ }
-+ zwp_input_method_context_v1_preedit_styling (priv->context,
-+ start,
-+ end - start,
-+ wstyle);
-+ prev_start = start;
-+ prev_end = end;
-+ }
-+ if (whole_wstyle != ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT) {
-+ uint32_t whole_start = 0;
-+ uint32_t whole_end = strlen (str);
-+ uint32_t start, end;
-+ for (i = 0; ; i++) {
-+ IBusAttribute *attr = ibus_attr_list_get (attrs, i);
-+ if (!attr)
-+ break;
-+ start = g_utf8_offset_to_pointer (str, attr->start_index) - str;
-+ end = g_utf8_offset_to_pointer (str, attr->end_index) - str;
-+ if (start == 0 && strlen (str) == end)
-+ continue;
-+ if (start == 0) {
-+ whole_start = end;
-+ } else if (strlen (str) == end) {
-+ whole_end = start;
-+ } else {
-+ whole_end = start;
-+ if (whole_start < whole_end) {
-+ zwp_input_method_context_v1_preedit_styling (
-+ priv->context,
-+ whole_start,
-+ whole_end - whole_start,
-+ whole_wstyle);
-+ }
-+ whole_start = end;
-+ whole_end = strlen (str);
-+ }
-+ }
-+ if (whole_start < whole_end) {
-+ zwp_input_method_context_v1_preedit_styling (
-+ priv->context,
-+ whole_start,
-+ whole_end - whole_start,
-+ whole_wstyle);
-+ }
-+ }
-+}
-+
- static void
- _context_show_preedit_text_cb (IBusInputContext *context,
- IBusWaylandIM *wlim)
- {
- IBusWaylandIMPrivate *priv;
- uint32_t cursor;
-+ const char *commit = "";
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
- /* CURSOR is byte offset. */
-@@ -282,10 +476,13 @@ _context_show_preedit_text_cb (IBusInputContext *context,
-
- zwp_input_method_context_v1_preedit_cursor (priv->context,
- cursor);
-+ ibus_wayland_im_update_preedit_style (wlim);
-+ if (priv->preedit_mode == IBUS_ENGINE_PREEDIT_COMMIT)
-+ commit = priv->preedit_text->text;
- zwp_input_method_context_v1_preedit_string (priv->context,
- priv->serial,
- priv->preedit_text->text,
-- priv->preedit_text->text);
-+ commit);
- }
-
-
-@@ -308,6 +505,7 @@ _context_update_preedit_text_cb (IBusInputContext *context,
- IBusText *text,
- gint cursor_pos,
- gboolean visible,
-+ guint mode,
- IBusWaylandIM *wlim)
- {
- IBusWaylandIMPrivate *priv;
-@@ -317,6 +515,7 @@ _context_update_preedit_text_cb (IBusInputContext *context,
- g_object_unref (priv->preedit_text);
- priv->preedit_text = g_object_ref_sink (text);
- priv->preedit_cursor_pos = cursor_pos;
-+ priv->preedit_mode = mode;
-
- if (visible)
- _context_show_preedit_text_cb (context, wlim);
-@@ -971,7 +1170,7 @@ _create_input_context_done (GObject *object,
- G_CALLBACK (_context_forward_key_event_cb),
- wlim);
-
-- g_signal_connect (priv->ibuscontext, "update-preedit-text",
-+ g_signal_connect (priv->ibuscontext, "update-preedit-text-with-mode",
- G_CALLBACK (_context_update_preedit_text_cb),
- wlim);
- g_signal_connect (priv->ibuscontext, "show-preedit-text",
-@@ -988,6 +1187,7 @@ _create_input_context_done (GObject *object,
- capabilities |= IBUS_CAP_SYNC_PROCESS_KEY_V2;
- ibus_input_context_set_capabilities (priv->ibuscontext,
- capabilities);
-+ ibus_input_context_set_client_commit_preedit (priv->ibuscontext, TRUE);
- if (_use_sync_mode == 1) {
- ibus_input_context_set_post_process_key_event (priv->ibuscontext,
- TRUE);
-diff --git a/client/wayland/text-input-unstable-v1-client-protocol.h b/client/wayland/text-input-unstable-v1-client-protocol.h
-new file mode 100644
-index 00000000..71069ec7
---- /dev/null
-+++ b/client/wayland/text-input-unstable-v1-client-protocol.h
-@@ -0,0 +1,847 @@
-+/* Generated by wayland-scanner 1.22.0 */
-+
-+#ifndef TEXT_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
-+#define TEXT_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
-+
-+#include <stdint.h>
-+#include <stddef.h>
-+#include "wayland-client.h"
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+/**
-+ * @page page_text_input_unstable_v1 The text_input_unstable_v1 protocol
-+ * @section page_ifaces_text_input_unstable_v1 Interfaces
-+ * - @subpage page_iface_zwp_text_input_v1 - text input
-+ * - @subpage page_iface_zwp_text_input_manager_v1 - text input manager
-+ * @section page_copyright_text_input_unstable_v1 Copyright
-+ * <pre>
-+ *
-+ * Copyright © 2012, 2013 Intel Corporation
-+ *
-+ * Permission is hereby granted, free of charge, to any person obtaining a
-+ * copy of this software and associated documentation files (the "Software"),
-+ * to deal in the Software without restriction, including without limitation
-+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-+ * and/or sell copies of the Software, and to permit persons to whom the
-+ * Software is furnished to do so, subject to the following conditions:
-+ *
-+ * The above copyright notice and this permission notice (including the next
-+ * paragraph) shall be included in all copies or substantial portions of the
-+ * Software.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-+ * DEALINGS IN THE SOFTWARE.
-+ * </pre>
-+ */
-+struct wl_seat;
-+struct wl_surface;
-+struct zwp_text_input_manager_v1;
-+struct zwp_text_input_v1;
-+
-+#ifndef ZWP_TEXT_INPUT_V1_INTERFACE
-+#define ZWP_TEXT_INPUT_V1_INTERFACE
-+/**
-+ * @page page_iface_zwp_text_input_v1 zwp_text_input_v1
-+ * @section page_iface_zwp_text_input_v1_desc Description
-+ *
-+ * An object used for text input. Adds support for text input and input
-+ * methods to applications. A text_input object is created from a
-+ * wl_text_input_manager and corresponds typically to a text entry in an
-+ * application.
-+ *
-+ * Requests are used to activate/deactivate the text_input object and set
-+ * state information like surrounding and selected text or the content type.
-+ * The information about entered text is sent to the text_input object via
-+ * the pre-edit and commit events. Using this interface removes the need
-+ * for applications to directly process hardware key events and compose text
-+ * out of them.
-+ *
-+ * Text is generally UTF-8 encoded, indices and lengths are in bytes.
-+ *
-+ * Serials are used to synchronize the state between the text input and
-+ * an input method. New serials are sent by the text input in the
-+ * commit_state request and are used by the input method to indicate
-+ * the known text input state in events like preedit_string, commit_string,
-+ * and keysym. The text input can then ignore events from the input method
-+ * which are based on an outdated state (for example after a reset).
-+ *
-+ * Warning! The protocol described in this file is experimental and
-+ * backward incompatible changes may be made. Backward compatible changes
-+ * may be added together with the corresponding interface version bump.
-+ * Backward incompatible changes are done by bumping the version number in
-+ * the protocol and interface names and resetting the interface version.
-+ * Once the protocol is to be declared stable, the 'z' prefix and the
-+ * version number in the protocol and interface names are removed and the
-+ * interface version number is reset.
-+ * @section page_iface_zwp_text_input_v1_api API
-+ * See @ref iface_zwp_text_input_v1.
-+ */
-+/**
-+ * @defgroup iface_zwp_text_input_v1 The zwp_text_input_v1 interface
-+ *
-+ * An object used for text input. Adds support for text input and input
-+ * methods to applications. A text_input object is created from a
-+ * wl_text_input_manager and corresponds typically to a text entry in an
-+ * application.
-+ *
-+ * Requests are used to activate/deactivate the text_input object and set
-+ * state information like surrounding and selected text or the content type.
-+ * The information about entered text is sent to the text_input object via
-+ * the pre-edit and commit events. Using this interface removes the need
-+ * for applications to directly process hardware key events and compose text
-+ * out of them.
-+ *
-+ * Text is generally UTF-8 encoded, indices and lengths are in bytes.
-+ *
-+ * Serials are used to synchronize the state between the text input and
-+ * an input method. New serials are sent by the text input in the
-+ * commit_state request and are used by the input method to indicate
-+ * the known text input state in events like preedit_string, commit_string,
-+ * and keysym. The text input can then ignore events from the input method
-+ * which are based on an outdated state (for example after a reset).
-+ *
-+ * Warning! The protocol described in this file is experimental and
-+ * backward incompatible changes may be made. Backward compatible changes
-+ * may be added together with the corresponding interface version bump.
-+ * Backward incompatible changes are done by bumping the version number in
-+ * the protocol and interface names and resetting the interface version.
-+ * Once the protocol is to be declared stable, the 'z' prefix and the
-+ * version number in the protocol and interface names are removed and the
-+ * interface version number is reset.
-+ */
-+extern const struct wl_interface zwp_text_input_v1_interface;
-+#endif
-+#ifndef ZWP_TEXT_INPUT_MANAGER_V1_INTERFACE
-+#define ZWP_TEXT_INPUT_MANAGER_V1_INTERFACE
-+/**
-+ * @page page_iface_zwp_text_input_manager_v1 zwp_text_input_manager_v1
-+ * @section page_iface_zwp_text_input_manager_v1_desc Description
-+ *
-+ * A factory for text_input objects. This object is a global singleton.
-+ * @section page_iface_zwp_text_input_manager_v1_api API
-+ * See @ref iface_zwp_text_input_manager_v1.
-+ */
-+/**
-+ * @defgroup iface_zwp_text_input_manager_v1 The zwp_text_input_manager_v1 interface
-+ *
-+ * A factory for text_input objects. This object is a global singleton.
-+ */
-+extern const struct wl_interface zwp_text_input_manager_v1_interface;
-+#endif
-+
-+#ifndef ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM
-+#define ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ * content hint
-+ *
-+ * Content hint is a bitmask to allow to modify the behavior of the text
-+ * input.
-+ */
-+enum zwp_text_input_v1_content_hint {
-+ /**
-+ * no special behaviour
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_NONE = 0x0,
-+ /**
-+ * auto completion, correction and capitalization
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_DEFAULT = 0x7,
-+ /**
-+ * hidden and sensitive text
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD = 0xc0,
-+ /**
-+ * suggest word completions
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION = 0x1,
-+ /**
-+ * suggest word corrections
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CORRECTION = 0x2,
-+ /**
-+ * switch to uppercase letters at the start of a sentence
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
-+ /**
-+ * prefer lowercase letters
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE = 0x8,
-+ /**
-+ * prefer uppercase letters
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE = 0x10,
-+ /**
-+ * prefer casing for titles and headings (can be language dependent)
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_TITLECASE = 0x20,
-+ /**
-+ * characters should be hidden
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_HIDDEN_TEXT = 0x40,
-+ /**
-+ * typed text should not be stored
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA = 0x80,
-+ /**
-+ * just latin characters should be entered
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN = 0x100,
-+ /**
-+ * the text input is multiline
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE = 0x200,
-+};
-+#endif /* ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM */
-+
-+#ifndef ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM
-+#define ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ * content purpose
-+ *
-+ * The content purpose allows to specify the primary purpose of a text
-+ * input.
-+ *
-+ * This allows an input method to show special purpose input panels with
-+ * extra characters or to disallow some characters.
-+ */
-+enum zwp_text_input_v1_content_purpose {
-+ /**
-+ * default input, allowing all characters
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL = 0,
-+ /**
-+ * allow only alphabetic characters
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ALPHA = 1,
-+ /**
-+ * allow only digits
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS = 2,
-+ /**
-+ * input a number (including decimal separator and sign)
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER = 3,
-+ /**
-+ * input a phone number
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PHONE = 4,
-+ /**
-+ * input an URL
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_URL = 5,
-+ /**
-+ * input an email address
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_EMAIL = 6,
-+ /**
-+ * input a name of a person
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NAME = 7,
-+ /**
-+ * input a password (combine with password or sensitive_data hint)
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PASSWORD = 8,
-+ /**
-+ * input a date
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATE = 9,
-+ /**
-+ * input a time
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TIME = 10,
-+ /**
-+ * input a date and time
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATETIME = 11,
-+ /**
-+ * input for a terminal
-+ */
-+ ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TERMINAL = 12,
-+};
-+#endif /* ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM */
-+
-+#ifndef ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM
-+#define ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM
-+enum zwp_text_input_v1_preedit_style {
-+ /**
-+ * default style for composing text
-+ */
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT = 0,
-+ /**
-+ * style should be the same as in non-composing text
-+ */
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_NONE = 1,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ACTIVE = 2,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INACTIVE = 3,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT = 4,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_UNDERLINE = 5,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_SELECTION = 6,
-+ ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INCORRECT = 7,
-+};
-+#endif /* ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM */
-+
-+#ifndef ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM
-+#define ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM
-+enum zwp_text_input_v1_text_direction {
-+ /**
-+ * automatic text direction based on text and language
-+ */
-+ ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_AUTO = 0,
-+ /**
-+ * left-to-right
-+ */
-+ ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_LTR = 1,
-+ /**
-+ * right-to-left
-+ */
-+ ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_RTL = 2,
-+};
-+#endif /* ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM */
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ * @struct zwp_text_input_v1_listener
-+ */
-+struct zwp_text_input_v1_listener {
-+ /**
-+ * enter event
-+ *
-+ * Notify the text_input object when it received focus. Typically
-+ * in response to an activate request.
-+ */
-+ void (*enter)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ struct wl_surface *surface);
-+ /**
-+ * leave event
-+ *
-+ * Notify the text_input object when it lost focus. Either in
-+ * response to a deactivate request or when the assigned surface
-+ * lost focus or was destroyed.
-+ */
-+ void (*leave)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1);
-+ /**
-+ * modifiers map
-+ *
-+ * Transfer an array of 0-terminated modifier names. The position
-+ * in the array is the index of the modifier as used in the
-+ * modifiers bitmask in the keysym event.
-+ */
-+ void (*modifiers_map)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ struct wl_array *map);
-+ /**
-+ * state of the input panel
-+ *
-+ * Notify when the visibility state of the input panel changed.
-+ */
-+ void (*input_panel_state)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t state);
-+ /**
-+ * pre-edit
-+ *
-+ * Notify when a new composing text (pre-edit) should be set
-+ * around the current cursor position. Any previously set composing
-+ * text should be removed.
-+ *
-+ * The commit text can be used to replace the preedit text on reset
-+ * (for example on unfocus).
-+ *
-+ * The text input should also handle all preedit_style and
-+ * preedit_cursor events occurring directly before preedit_string.
-+ * @param serial serial of the latest known text input state
-+ */
-+ void (*preedit_string)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t serial,
-+ const char *text,
-+ const char *commit);
-+ /**
-+ * pre-edit styling
-+ *
-+ * Sets styling information on composing text. The style is
-+ * applied for length bytes from index relative to the beginning of
-+ * the composing text (as byte offset). Multiple styles can be
-+ * applied to a composing text by sending multiple preedit_styling
-+ * events.
-+ *
-+ * This event is handled as part of a following preedit_string
-+ * event.
-+ */
-+ void (*preedit_styling)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t index,
-+ uint32_t length,
-+ uint32_t style);
-+ /**
-+ * pre-edit cursor
-+ *
-+ * Sets the cursor position inside the composing text (as byte
-+ * offset) relative to the start of the composing text. When index
-+ * is a negative number no cursor is shown.
-+ *
-+ * This event is handled as part of a following preedit_string
-+ * event.
-+ */
-+ void (*preedit_cursor)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ int32_t index);
-+ /**
-+ * commit
-+ *
-+ * Notify when text should be inserted into the editor widget.
-+ * The text to commit could be either just a single character after
-+ * a key press or the result of some composing (pre-edit). It could
-+ * also be an empty text when some text should be removed (see
-+ * delete_surrounding_text) or when the input cursor should be
-+ * moved (see cursor_position).
-+ *
-+ * Any previously set composing text should be removed.
-+ * @param serial serial of the latest known text input state
-+ */
-+ void (*commit_string)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t serial,
-+ const char *text);
-+ /**
-+ * set cursor to new position
-+ *
-+ * Notify when the cursor or anchor position should be modified.
-+ *
-+ * This event should be handled as part of a following
-+ * commit_string event.
-+ */
-+ void (*cursor_position)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ int32_t index,
-+ int32_t anchor);
-+ /**
-+ * delete surrounding text
-+ *
-+ * Notify when the text around the current cursor position should
-+ * be deleted.
-+ *
-+ * Index is relative to the current cursor (in bytes). Length is
-+ * the length of deleted text (in bytes).
-+ *
-+ * This event should be handled as part of a following
-+ * commit_string event.
-+ */
-+ void (*delete_surrounding_text)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ int32_t index,
-+ uint32_t length);
-+ /**
-+ * keysym
-+ *
-+ * Notify when a key event was sent. Key events should not be
-+ * used for normal text input operations, which should be done with
-+ * commit_string, delete_surrounding_text, etc. The key event
-+ * follows the wl_keyboard key event convention. Sym is an XKB
-+ * keysym, state a wl_keyboard key_state. Modifiers are a mask for
-+ * effective modifiers (where the modifier indices are set by the
-+ * modifiers_map event)
-+ * @param serial serial of the latest known text input state
-+ */
-+ void (*keysym)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t serial,
-+ uint32_t time,
-+ uint32_t sym,
-+ uint32_t state,
-+ uint32_t modifiers);
-+ /**
-+ * language
-+ *
-+ * Sets the language of the input text. The "language" argument
-+ * is an RFC-3066 format language tag.
-+ * @param serial serial of the latest known text input state
-+ */
-+ void (*language)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t serial,
-+ const char *language);
-+ /**
-+ * text direction
-+ *
-+ * Sets the text direction of input text.
-+ *
-+ * It is mainly needed for showing an input cursor on the correct
-+ * side of the editor when there is no input done yet and making
-+ * sure neutral direction text is laid out properly.
-+ * @param serial serial of the latest known text input state
-+ */
-+ void (*text_direction)(void *data,
-+ struct zwp_text_input_v1 *zwp_text_input_v1,
-+ uint32_t serial,
-+ uint32_t direction);
-+};
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+static inline int
-+zwp_text_input_v1_add_listener(struct zwp_text_input_v1 *zwp_text_input_v1,
-+ const struct zwp_text_input_v1_listener *listener, void *data)
-+{
-+ return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v1,
-+ (void (**)(void)) listener, data);
-+}
-+
-+#define ZWP_TEXT_INPUT_V1_ACTIVATE 0
-+#define ZWP_TEXT_INPUT_V1_DEACTIVATE 1
-+#define ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL 2
-+#define ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL 3
-+#define ZWP_TEXT_INPUT_V1_RESET 4
-+#define ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT 5
-+#define ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE 6
-+#define ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE 7
-+#define ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE 8
-+#define ZWP_TEXT_INPUT_V1_COMMIT_STATE 9
-+#define ZWP_TEXT_INPUT_V1_INVOKE_ACTION 10
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_ENTER_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_LEAVE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_MODIFIERS_MAP_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_INPUT_PANEL_STATE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_PREEDIT_STRING_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_PREEDIT_STYLING_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_PREEDIT_CURSOR_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_COMMIT_STRING_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_CURSOR_POSITION_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_KEYSYM_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_LANGUAGE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_SINCE_VERSION 1
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_ACTIVATE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_DEACTIVATE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_RESET_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_COMMIT_STATE_SINCE_VERSION 1
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+#define ZWP_TEXT_INPUT_V1_INVOKE_ACTION_SINCE_VERSION 1
-+
-+/** @ingroup iface_zwp_text_input_v1 */
-+static inline void
-+zwp_text_input_v1_set_user_data(struct zwp_text_input_v1 *zwp_text_input_v1, void *user_data)
-+{
-+ wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v1, user_data);
-+}
-+
-+/** @ingroup iface_zwp_text_input_v1 */
-+static inline void *
-+zwp_text_input_v1_get_user_data(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v1);
-+}
-+
-+static inline uint32_t
-+zwp_text_input_v1_get_version(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1);
-+}
-+
-+/** @ingroup iface_zwp_text_input_v1 */
-+static inline void
-+zwp_text_input_v1_destroy(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ wl_proxy_destroy((struct wl_proxy *) zwp_text_input_v1);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Requests the text_input object to be activated (typically when the
-+ * text entry gets focus).
-+ *
-+ * The seat argument is a wl_seat which maintains the focus for this
-+ * activation. The surface argument is a wl_surface assigned to the
-+ * text_input object and tracked for focus lost. The enter event
-+ * is emitted on successful activation.
-+ */
-+static inline void
-+zwp_text_input_v1_activate(struct zwp_text_input_v1 *zwp_text_input_v1, struct wl_seat *seat, struct wl_surface *surface)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, seat, surface);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Requests the text_input object to be deactivated (typically when the
-+ * text entry lost focus). The seat argument is a wl_seat which was used
-+ * for activation.
-+ */
-+static inline void
-+zwp_text_input_v1_deactivate(struct zwp_text_input_v1 *zwp_text_input_v1, struct wl_seat *seat)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_DEACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, seat);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Requests input panels (virtual keyboard) to show.
-+ */
-+static inline void
-+zwp_text_input_v1_show_input_panel(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Requests input panels (virtual keyboard) to hide.
-+ */
-+static inline void
-+zwp_text_input_v1_hide_input_panel(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Should be called by an editor widget when the input state should be
-+ * reset, for example after the text was changed outside of the normal
-+ * input method flow.
-+ */
-+static inline void
-+zwp_text_input_v1_reset(struct zwp_text_input_v1 *zwp_text_input_v1)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_RESET, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Sets the plain surrounding text around the input position. Text is
-+ * UTF-8 encoded. Cursor is the byte offset within the
-+ * surrounding text. Anchor is the byte offset of the
-+ * selection anchor within the surrounding text. If there is no selected
-+ * text anchor, then it is the same as cursor.
-+ */
-+static inline void
-+zwp_text_input_v1_set_surrounding_text(struct zwp_text_input_v1 *zwp_text_input_v1, const char *text, uint32_t cursor, uint32_t anchor)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, text, cursor, anchor);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Sets the content purpose and content hint. While the purpose is the
-+ * basic purpose of an input field, the hint flags allow to modify some
-+ * of the behavior.
-+ *
-+ * When no content type is explicitly set, a normal content purpose with
-+ * default hints (auto completion, auto correction, auto capitalization)
-+ * should be assumed.
-+ */
-+static inline void
-+zwp_text_input_v1_set_content_type(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t hint, uint32_t purpose)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, hint, purpose);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+static inline void
-+zwp_text_input_v1_set_cursor_rectangle(struct zwp_text_input_v1 *zwp_text_input_v1, int32_t x, int32_t y, int32_t width, int32_t height)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, x, y, width, height);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ *
-+ * Sets a specific language. This allows for example a virtual keyboard to
-+ * show a language specific layout. The "language" argument is an RFC-3066
-+ * format language tag.
-+ *
-+ * It could be used for example in a word processor to indicate the
-+ * language of the currently edited document or in an instant message
-+ * application which tracks languages of contacts.
-+ */
-+static inline void
-+zwp_text_input_v1_set_preferred_language(struct zwp_text_input_v1 *zwp_text_input_v1, const char *language)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, language);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+static inline void
-+zwp_text_input_v1_commit_state(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t serial)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_COMMIT_STATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, serial);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_v1
-+ */
-+static inline void
-+zwp_text_input_v1_invoke_action(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t button, uint32_t index)
-+{
-+ wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
-+ ZWP_TEXT_INPUT_V1_INVOKE_ACTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, button, index);
-+}
-+
-+#define ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT 0
-+
-+
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v1
-+ */
-+#define ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT_SINCE_VERSION 1
-+
-+/** @ingroup iface_zwp_text_input_manager_v1 */
-+static inline void
-+zwp_text_input_manager_v1_set_user_data(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1, void *user_data)
-+{
-+ wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v1, user_data);
-+}
-+
-+/** @ingroup iface_zwp_text_input_manager_v1 */
-+static inline void *
-+zwp_text_input_manager_v1_get_user_data(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
-+{
-+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v1);
-+}
-+
-+static inline uint32_t
-+zwp_text_input_manager_v1_get_version(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
-+{
-+ return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v1);
-+}
-+
-+/** @ingroup iface_zwp_text_input_manager_v1 */
-+static inline void
-+zwp_text_input_manager_v1_destroy(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
-+{
-+ wl_proxy_destroy((struct wl_proxy *) zwp_text_input_manager_v1);
-+}
-+
-+/**
-+ * @ingroup iface_zwp_text_input_manager_v1
-+ *
-+ * Creates a new text_input object.
-+ */
-+static inline struct zwp_text_input_v1 *
-+zwp_text_input_manager_v1_create_text_input(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
-+{
-+ struct wl_proxy *id;
-+
-+ id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v1,
-+ ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT, &zwp_text_input_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v1), 0, NULL);
-+
-+ return (struct zwp_text_input_v1 *) id;
-+}
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif
-diff --git a/src/ibusattribute.h b/src/ibusattribute.h
-index fe4cab45..10190921 100644
---- a/src/ibusattribute.h
-+++ b/src/ibusattribute.h
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2011-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2023 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
-@@ -91,6 +92,55 @@ typedef enum {
- IBUS_ATTR_UNDERLINE_ERROR = 4,
- } IBusAttrUnderline;
-
-+
-+/**
-+ * IBusAttrPreedit:
-+ * @IBUS_ATTR_PREEDIT_DEFAULT: Default style for composing text.
-+ * @IBUS_ATTR_PREEDIT_NONE: Style should be the same as in non-composing text.
-+ * @IBUS_ATTR_PREEDIT_WHOLE: Most language engines wish to draw underline in
-+ * the typed whole preedit string except for the
-+ * prediction string. (Chinese, Japanese,
-+ * Typing-booster)
-+ * @IBUS_ATTR_PREEDIT_SELECTION: Modifying an active segment is distinguished
-+ * against whole the preedit text. (Hangul,
-+ * Japanese)
-+ * @IBUS_ATTR_PREEDIT_PREDICTION: A prediction string can be appended after the
-+ * typed string. (Typing-booster)
-+ * @IBUS_ATTR_PREEDIT_PREFIX: A prefix string can be an informative color.
-+ * (Table)
-+ * @IBUS_ATTR_PREEDIT_SUFFIX: A suffix string can be an informative color.
-+ * (Table)
-+ * @IBUS_ATTR_PREEDIT_ERROR_SPELLING: An detected typo could be an error color
-+ * with a spelling check or the word could
-+ * not be found in a dictionary. The
-+ * underline color also might be more
-+ * visible. (Typing-booster, Table)
-+ * @IBUS_ATTR_PREEDIT_ERROR_COMPOSE: A wrong compose key could be an error
-+ * color. (Typing-booster)
-+ *
-+ * Type of Pre-edit style as the semantic name.
-+ * The Wayland specs prefers to express the semantic values rather than RGB
-+ * values and text-input protocol version 1 defines some values:
-+ * https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/unstable/text-input/text-input-unstable-v1.xml?ref_type=heads#L251
-+ *
-+ * IBus compiled the values for major input method engines:
-+ * https://github.com/ibus/ibus/wiki/Wayland-Colors
-+ *
-+ * Since: 1.5.29
-+ * Stability: Unstable
-+ */
-+typedef enum {
-+ IBUS_ATTR_PREEDIT_DEFAULT = 0,
-+ IBUS_ATTR_PREEDIT_NONE,
-+ IBUS_ATTR_PREEDIT_WHOLE,
-+ IBUS_ATTR_PREEDIT_SELECTION,
-+ IBUS_ATTR_PREEDIT_PREDICTION,
-+ IBUS_ATTR_PREEDIT_PREFIX,
-+ IBUS_ATTR_PREEDIT_SUFFIX,
-+ IBUS_ATTR_PREEDIT_ERROR_SPELLING,
-+ IBUS_ATTR_PREEDIT_ERROR_COMPOSE,
-+} IBusAttrPreedit;
-+
- typedef struct _IBusAttribute IBusAttribute;
- typedef struct _IBusAttributeClass IBusAttributeClass;
-
---
-2.41.0
-
-From 1be3e2f79b384a374b2a69a31c88a4f36e1dd868 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 15 Nov 2023 17:19:02 +0900
-Subject: [PATCH] client/gtk2: Call strdup() after g_return_if_fail()
-
----
- client/gtk2/ibusimcontext.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index b5a44da0..cfc08c20 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -2417,7 +2417,7 @@ _create_input_context_done (IBusBus *bus,
- static void
- _create_input_context (IBusIMContext *ibusimcontext)
- {
-- gchar *prgname = g_strdup (g_get_prgname());
-+ gchar *prgname;
- gchar *client_name;
- IDEBUG ("%s", __FUNCTION__);
-
-@@ -2425,6 +2425,7 @@ _create_input_context (IBusIMContext *ibusimcontext)
-
- g_return_if_fail (ibusimcontext->cancellable == NULL);
-
-+ prgname = g_strdup (g_get_prgname());
- ibusimcontext->cancellable = g_cancellable_new ();
-
- if (!prgname)
---
-2.41.0
-
-From 0a7a4d1dfa580dfcc65d76a697f40094085e55a2 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sat, 25 Nov 2023 13:42:07 +0900
-Subject: [PATCH] ui/gtk3: Error handling with display == null
-
-BUG=rhbz#2188800
----
- ui/gtk3/bindingcommon.vala | 6 +++++-
- ui/gtk3/panel.vala | 14 ++++++++++----
- 2 files changed, 15 insertions(+), 5 deletions(-)
-
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index da324f70..588be17a 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -263,10 +263,14 @@ class BindingCommon {
- return m_default_is_xdisplay;
- }
-
-- public static Gdk.X11.Display get_xdisplay() {
-+ public static Gdk.X11.Display? get_xdisplay() {
- if (m_xdisplay != null)
- return m_xdisplay;
- var display = Gdk.Display.get_default();
-+ if (display == null) {
-+ error("You should open a display for IBus panel.");
-+ return null;
-+ }
- Type instance_type = display.get_type();
- Type x11_type = typeof(Gdk.X11.Display);
- if (instance_type.is_a(x11_type)) {
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index f1bbd720..783ec842 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -1422,9 +1422,12 @@ class Panel : IBus.PanelService {
-
- Gdk.Display display_backup = null;
- if (use_x11 && !BindingCommon.default_is_xdisplay()) {
-+ var display = BindingCommon.get_xdisplay();
- display_backup = Gdk.Display.get_default();
-- Gdk.DisplayManager.get().set_default_display(
-- (Gdk.Display)BindingCommon.get_xdisplay());
-+ if (display != null) {
-+ Gdk.DisplayManager.get().set_default_display(
-+ (Gdk.Display)display);
-+ }
- }
-
- // Show system menu
-@@ -1476,9 +1479,12 @@ class Panel : IBus.PanelService {
- private Gtk.Menu create_activate_menu(bool use_x11 = false) {
- Gdk.Display display_backup = null;
- if (use_x11 && !BindingCommon.default_is_xdisplay()) {
-+ var display = BindingCommon.get_xdisplay();
- display_backup = Gdk.Display.get_default();
-- Gdk.DisplayManager.get().set_default_display(
-- (Gdk.Display)BindingCommon.get_xdisplay());
-+ if (display != null) {
-+ Gdk.DisplayManager.get().set_default_display(
-+ (Gdk.Display)display);
-+ }
- }
- m_ime_menu = new Gtk.Menu();
-
---
-2.41.0
-
-From 719792d300579c1bfdf43251a83c6ed4e5594c07 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 5 Dec 2023 23:13:25 +0900
-Subject: [PATCH] src: Complete preedit signals for PostProcessKeyEvent
-
-I forgot to implement show-preedit-text and hide-preedit-text signals
-with PostProcessKeyEvent D-Bus signal in the client side.
-
-Fixes: https://github.com/ibus/ibus/commit/e059536
-
-BUG=https://github.com/ibus/ibus/issues/2585
----
- src/ibusinputcontext.c | 33 ++++++++++++++++++++++++++-------
- 1 file changed, 26 insertions(+), 7 deletions(-)
-
-diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
-index 1b62f656..600526e5 100644
---- a/src/ibusinputcontext.c
-+++ b/src/ibusinputcontext.c
-@@ -1463,6 +1463,22 @@ ibus_input_context_fwd_text_to_delete_surrounding (IBusInputContext *context,
- }
-
-
-+static void
-+ibus_input_context_fwd_text_to_hide_preedit (IBusInputContext *context,
-+ IBusText *text)
-+{
-+ g_signal_emit (context, context_signals[HIDE_PREEDIT_TEXT], 0, text);
-+}
-+
-+
-+static void
-+ibus_input_context_fwd_text_to_show_preedit (IBusInputContext *context,
-+ IBusText *text)
-+{
-+ g_signal_emit (context, context_signals[SHOW_PREEDIT_TEXT], 0, text);
-+}
-+
-+
- static void
- ibus_input_context_fwd_text_to_update_preedit (IBusInputContext *context,
- IBusText *text,
-@@ -1558,18 +1574,21 @@ ibus_input_context_post_process_key_event (IBusInputContext *context)
- case 'c':
- ibus_input_context_fwd_text_to_commit (context, text);
- break;
-- case 'f': {
-+ case 'd':
-+ ibus_input_context_fwd_text_to_delete_surrounding (context, text);
-+ break;
-+ case 'f':
- ibus_input_context_fwd_text_to_forward_key_event (context, text);
- break;
-- }
-- case 'r': {
-+ case 'h':
-+ ibus_input_context_fwd_text_to_hide_preedit (context, text);
-+ break;
-+ case 'r':
- ibus_input_context_fwd_text_to_require_surrounding (context, text);
- break;
-- }
-- case 'd': {
-- ibus_input_context_fwd_text_to_delete_surrounding (context, text);
-+ case 's':
-+ ibus_input_context_fwd_text_to_show_preedit (context, text);
- break;
-- }
- case 'u':
- case 'm': {
- IBusText *position;
---
-2.41.0
-
-From ac46d154e72fdc914e6d34ff1b251c8fcb70ce20 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Dec 2023 20:34:49 +0900
-Subject: [PATCH] Refactor object initialization
-
-- client/wayland: Make sure IBusWaylandIM->ibuscontext is NULL
- when IBusWaylandIM->context is NULL.
-
-- configure: Set some default help messages.
-
-- ui/gtk3: Make sure to call an error message if display is NULL.
----
- client/wayland/ibuswaylandim.c | 10 ++++++----
- configure.ac | 18 +++++++++---------
- ui/gtk3/panel.vala | 5 +----
- 3 files changed, 16 insertions(+), 17 deletions(-)
-
-diff --git a/client/wayland/ibuswaylandim.c b/client/wayland/ibuswaylandim.c
-index 9e8f651e..0430538f 100644
---- a/client/wayland/ibuswaylandim.c
-+++ b/client/wayland/ibuswaylandim.c
-@@ -115,6 +115,10 @@ struct wl_registry *_registry = NULL;
-
- static gboolean _use_sync_mode = 1;
-
-+static void input_method_deactivate
-+ (void *data,
-+ struct zwp_input_method_v1 *input_method,
-+ struct zwp_input_method_context_v1 *context);
- static GObject *ibus_wayland_im_constructor (GType type,
- guint n_params,
- GObjectConstructParam
-@@ -1207,10 +1211,8 @@ input_method_activate (void *data,
-
- g_return_if_fail (IBUS_IS_WAYLAND_IM (wlim));
- priv = ibus_wayland_im_get_instance_private (wlim);
-- if (priv->context) {
-- zwp_input_method_context_v1_destroy (priv->context);
-- priv->context = NULL;
-- }
-+ if (priv->context)
-+ input_method_deactivate (data, input_method, context);
-
- priv->serial = 0;
- priv->context = context;
-diff --git a/configure.ac b/configure.ac
-index 50b4a820..dc1410cc 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -233,7 +233,7 @@ AC_ARG_ENABLE(gtk4,
- AS_HELP_STRING([--enable-gtk4],
- [Build gtk4 im module]),
- [enable_gtk4=$enableval],
-- [enable_gtk4=no]
-+ [enable_gtk4=yes]
- )
- AM_CONDITIONAL([ENABLE_GTK4], [test x"$enable_gtk4" = x"yes"])
-
-@@ -276,8 +276,7 @@ if test x"$enable_gtk2" = x"yes"; then
-
- gtk2_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
- GTK2_IM_MODULEDIR="$libdir"/gtk-2.0/$gtk2_binary_version/immodules
--else
-- enable_gtk2="no (disabled, use --enable-gtk2 to enable)"
-+ enable_gtk2="yes (enabled, use --disable-gtk2 to disable)"
- fi
-
- if test x"$enable_gtk3" = x"yes"; then
-@@ -297,7 +296,6 @@ if test x"$enable_gtk3" = x"yes"; then
- gtk3_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`
- GTK3_IM_MODULEDIR="$libdir"/gtk-3.0/$gtk3_binary_version/immodules
- else
-- enable_gtk3="no (disabled, use --enable-gtk3 to enable)"
- enable_gdk3_wayland=no
- fi
- if test x"$enable_gdk3_wayland" != x"yes"; then
-@@ -313,8 +311,7 @@ if test x"$enable_gtk4" = x"yes"; then
-
- gtk4_binary_version=`$PKG_CONFIG --variable=gtk_binary_version gtk4`
- GTK4_IM_MODULEDIR="$libdir"/gtk-4.0/$gtk4_binary_version/immodules
--else
-- enable_gtk4="no (disabled, use --enable-gtk4 to enable)"
-+ enable_gtk4="yes (enabled, use --disable-gtk4 to disable)"
- fi
-
- if test x"$enable_xim" = x"yes"; then
-@@ -331,8 +328,10 @@ if test x"$enable_xim" = x"yes"; then
- gtk+-2.0
- ])
- fi
--else
-- enable_xim="no (disabled, use --enable-xim to enable)"
-+ enable_xim="yes (enabled, use --disable-xim to disable)"
-+fi
-+if test x"$enable_gtk3" = x"yes"; then
-+ enable_gtk3="yes (enabled, use --disable-gtk3 to disable)"
- fi
-
- if $PKG_CONFIG --exists x11; then
-@@ -363,8 +362,9 @@ if test x"$enable_wayland" = x"yes"; then
- AC_SUBST(WAYLAND_PRTCLS_SUBDIR)
- WAYLAND_SCANNER_RULES(['$(datadir)/$(WAYLAND_PRTCLS_SUBDIR)'])],
- [AC_SUBST(wayland_scanner_rules)])
-+ enable_wayland="yes (enabled, use --disable-wayland to disable)"
- else
-- enable_wayland="no (disabled, use --enable-wayland to enable)"
-+ wayland_scanner_rules="./wayland-scanner.mk"
- AC_SUBST(wayland_scanner_rules)
- fi
-
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 783ec842..233dd29c 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -111,10 +111,7 @@ class Panel : IBus.PanelService {
- m_is_wayland_im = is_wayland_im;
-
- #if USE_GDK_WAYLAND
-- var display = Gdk.Display.get_default();
-- Type instance_type = display.get_type();
-- Type wayland_type = typeof(GdkWayland.Display);
-- m_is_wayland = instance_type.is_a(wayland_type);
-+ m_is_wayland = !BindingCommon.default_is_xdisplay();
- #else
- m_is_wayland = false;
- warning("Checking Wayland is disabled");
---
-2.41.0
-
-From 8470873979e3435c29d98704f1ac7e1e47e9dc2f Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 14 Dec 2023 23:55:42 +0900
-Subject: [PATCH] ui/gtk3: Fix some warnings
-
-- Try to disable Vala warnings with gtk_menu_shell_insert() workaround.
-- Stop string_slice() warning with different language lengths.
----
- ui/gtk3/panel.vala | 17 ++++++++++-------
- ui/gtk3/switcher.vala | 4 +++-
- 2 files changed, 13 insertions(+), 8 deletions(-)
-
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 233dd29c..aa9e8664 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -1433,7 +1433,8 @@ class Panel : IBus.PanelService {
-
- item = new Gtk.MenuItem.with_label(_("Preferences"));
- item.activate.connect((i) => show_setup_dialog());
-- m_sys_menu.append(item);
-+ // https://gitlab.gnome.org/GNOME/gtk/-/issues/5870
-+ m_sys_menu.insert(item, -1);
-
- #if EMOJI_DICT
- item = new Gtk.MenuItem.with_label(_("Emoji Choice"));
-@@ -1448,22 +1449,23 @@ class Panel : IBus.PanelService {
- */
- panel_extension(event);
- });
-- m_sys_menu.append(item);
-+ // https://gitlab.gnome.org/GNOME/gtk/-/issues/5870
-+ m_sys_menu.insert(item, -1);
- #endif
-
- item = new Gtk.MenuItem.with_label(_("About"));
- item.activate.connect((i) => show_about_dialog());
-- m_sys_menu.append(item);
-+ m_sys_menu.insert(item, -1);
-
-- m_sys_menu.append(new Gtk.SeparatorMenuItem());
-+ m_sys_menu.insert(new Gtk.SeparatorMenuItem(), -1);
-
- item = new Gtk.MenuItem.with_label(_("Restart"));
- item.activate.connect((i) => m_bus.exit(true));
-- m_sys_menu.append(item);
-+ m_sys_menu.insert(item, -1);
-
- item = new Gtk.MenuItem.with_label(_("Quit"));
- item.activate.connect((i) => m_bus.exit(false));
-- m_sys_menu.append(item);
-+ m_sys_menu.insert(item, -1);
-
- m_sys_menu.show_all();
-
-@@ -1488,7 +1490,8 @@ class Panel : IBus.PanelService {
- // Show properties and IME switching menu
- m_property_manager.create_menu_items(m_ime_menu);
-
-- m_ime_menu.append(new Gtk.SeparatorMenuItem());
-+ // https://gitlab.gnome.org/GNOME/gtk/-/issues/5870
-+ m_ime_menu.insert(new Gtk.SeparatorMenuItem(), -1);
-
- // Append IMEs
- foreach (var engine in m_engines) {
-diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
-index e3fab8d9..26bded99 100644
---- a/ui/gtk3/switcher.vala
-+++ b/ui/gtk3/switcher.vala
-@@ -592,7 +592,9 @@ class Switcher : Gtk.Window {
- int index = 0;
-
- foreach (var saved_language in m_xkb_languages.get_values()) {
-- if (language == saved_language[0:length])
-+ // Duplicated langauge is EN, EN_2 for E.G.
-+ if (length <= saved_language.length &&
-+ language == saved_language[0:length])
- index++;
- }
-
---
-2.41.0
-
-From 4872c1fcdc8bbe146e967d004edf63f5994b21f8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 21 Dec 2023 08:26:48 +0900
-Subject: [PATCH] src/ibusenginesimple.c: Don't commit any characters
-
-Revert a part of the previous patch of #2495 because it explains
-"Super-space and space key can launch IBus Emojier." but I cannot
-remember what I tried to fix.
-
-IBus XKB engines should not commit any keysyms before the key event is
-sent to the application with IBUS_IGNORED_MASK flag even if the key
-is not an ASCII because any characters can be control characters
-by application.
-E.g. VIM cursor mode "hjkl" keys or game cursor keys with language
-layouts.
-
-Fixes: https://github.com/ibus/ibus/commit/ad883dc
-
-BUG=https://github.com/ibus/ibus/issues/2588
----
- client/gtk2/ibusimcontext.c | 6 ++++++
- src/ibusenginesimple.c | 15 ++++++++++-----
- 2 files changed, 16 insertions(+), 5 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index cfc08c20..ebc8d869 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -361,6 +361,12 @@ ibus_im_context_commit_event (IBusIMContext *ibusimcontext,
- keyval == GDK_KEY_KP_Enter) {
- return FALSE;
- }
-+ /* #2588 If IBus tries to commit a character, it should be forwarded to
-+ * the application at once with IBUS_IGNORED_MASK before the actual
-+ * commit because any characters can be control characters even if
-+ * they are not ASCII characters, e.g. game cursor keys with a
-+ * language keyboard layout likes VIM cursor mode "hjkl" keys.
-+ */
- ch = ibus_keyval_to_unicode (keyval);
- if (ch != 0 && !g_unichar_iscntrl (ch)) {
- IBusText *text = ibus_text_new_from_unichar (ch);
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index 31cb416c..4bee8cb3 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -647,12 +647,17 @@ no_sequence_matches (IBusEngineSimple *simple,
-
- ibus_engine_simple_update_preedit_text (simple);
- ch = ibus_keyval_to_unicode (keyval);
-- /* IBUS_CHANGE: RH#769133
-- * Since we use ibus xkb engines as the disable state,
-- * Super-space and space key can launch IBus Emojier.
-+ /* IBUS_CHANGE: RH#769133, #2588
-+ * Since we use ibus xkb engines as the disable IM mode,
-+ * do not commit the characters locally without in_hex_sequence.
-+ * If IBus tries to commit a character, it should be forwarded to
-+ * the application at once with IBUS_IGNORED_MASK before the actual
-+ * commit because any characters can be control characters even if
-+ * they are not ASCII characters, e.g. game cursor keys with a
-+ * language keyboard layout likes VIM cursor mode "hjkl" keys.
- */
-- if (ch != 0 && !g_unichar_iscntrl (ch) && ch > 0x7F) {
-- ibus_engine_simple_commit_char (simple, ch);
-+ if (ch != 0 && !g_unichar_iscntrl (ch) &&
-+ priv->in_hex_sequence) {
- return TRUE;
- } else {
- return FALSE;
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:08 Takao Fujiwara
0 siblings, 0 replies; 16+ messages 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 : 0e200ff463e6adbffe21ad7ed02d8eb091cd8048
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2023-08-22T19:37:19+09:00
Stats : +0/-240 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/0e200ff463e6adbffe21ad7ed02d8eb091cd8048?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 06a7e3b..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,240 +0,0 @@
-From f05c12dafef83cdd6b0f988d86e4411794c7e44f Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 9 Aug 2023 11:35:21 +0900
-Subject: [PATCH] github/workflows: Fix Fedora 39 DNF
-
-- Check latest gnome-shell-extension-no-overview
-- Add various configure options
----
- autogen.sh | 7 ++++---
- 1 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/autogen.sh b/autogen.sh
-index 4ea8d757..05682f47 100755
---- a/autogen.sh
-+++ b/autogen.sh
-@@ -47,9 +47,10 @@ cd "$srcdir"
- rpm -q $FEDORA_PKG1 || exit 1
- rpm -q $FEDORA_PKG2 || exit 1
- rpm -q $FEDORA_PKG3 || exit 1
-- dnf update --assumeno $FEDORA_PKG1 || exit 1
-- dnf update --assumeno $FEDORA_PKG2 || exit 1
-- dnf update --assumeno $FEDORA_PKG3 || exit 1
-+ (grep -qE '37|38' /etc/fedora-release) && DNF=dnf || DNF=dnf5
-+ $DNF update --assumeno $FEDORA_PKG1 || exit 1
-+ $DNF update --assumeno $FEDORA_PKG2 || exit 1
-+ $DNF update --assumeno $FEDORA_PKG3 || exit 1
- }
- }
-
---
-2.41.0
-
-From 86d9bb9a1cbd4ffbd6bc2a4de85cb76a43bc2ced Mon Sep 17 00:00:00 2001
-From: Peng Wu <pwu@redhat.com>
-Date: Mon, 24 Jul 2023 14:04:12 +0800
-Subject: [PATCH] client/gtk2: Update set_cursor_location function to use Gdk
- functions
-
-For ibus-gtk4, use the Gdk functions to get the inner cursor location.
-The inner cursor location is translated by XTranslateCoordinates
-for X Window.
-For ibus-gtk3, use gdk_window_get_root_coords function to translate the
-inner cursor location for X Window.
-In Wayland, the set_cursor_location_relative function is called.
-In X Window, the set_cursor_location function is called.
-
-Fixes: https://github.com/ibus/ibus/commit/d0a47c3
-Fixes: https://github.com/ibus/ibus/commit/a823161
-
-BUG=https://github.com/ibus/ibus/pull/2549
-BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/3024#note_987835
----
- client/gtk2/ibusimcontext.c | 141 +++++++++++++++---------------------
- 1 file changed, 58 insertions(+), 83 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index 7ccc129d..b5a44da0 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -27,6 +27,7 @@
-
- #include <string.h>
- #include <gtk/gtk.h>
-+#include <gdk/gdk.h>
- #include <gdk/gdkkeysyms.h>
- #include <ibus.h>
- #include "ibusimcontext.h"
-@@ -1612,8 +1613,13 @@ static gboolean
- _set_cursor_location_internal (IBusIMContext *ibusimcontext)
- {
- GdkRectangle area;
-+ GdkDisplay *display = NULL;
- #if GTK_CHECK_VERSION (3, 98, 4)
- GtkWidget *root;
-+ GtkNative *native;
-+ graphene_point_t p;
-+ int tx = 0, ty = 0;
-+ double nx = 0., ny = 0.;
- #endif
-
- if(ibusimcontext->client_window == NULL ||
-@@ -1623,103 +1629,72 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
-
- area = ibusimcontext->cursor_area;
-
--#ifdef GDK_WINDOWING_WAYLAND
- #if GTK_CHECK_VERSION (3, 98, 4)
- root = GTK_WIDGET (gtk_widget_get_root (ibusimcontext->client_window));
-- /* FIXME: GTK_STYLE_CLASS_TITLEBAR is available in GTK3 but not GTK4.
-- * gtk_css_boxes_get_content_rect() is available in GTK4 but it's an
-- * internal API and calculate the window edge 32 in GTK3.
-- */
-- area.y += 32;
-- area.width = 50; /* FIXME: Why 50 meets the cursor position? */
-- area.height = gtk_widget_get_height (root);
-- area.height += 32;
-- if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) {
-- ibus_input_context_set_cursor_location_relative (
-- ibusimcontext->ibuscontext,
-- area.x,
-- area.y,
-- area.width,
-- area.height);
-- return FALSE;
-- }
--#else
-- if (GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) {
-- gdouble px, py;
-- GdkWindow *parent;
-- GdkWindow *window = ibusimcontext->client_window;
--
-- while ((parent = gdk_window_get_effective_parent (window)) != NULL) {
-- gdk_window_coords_to_parent (window, area.x, area.y, &px, &py);
-- area.x = px;
-- area.y = py;
-- window = parent;
-- }
--
-- _set_rect_scale_factor_with_window (&area,
-- ibusimcontext->client_window);
-- ibus_input_context_set_cursor_location_relative (
-- ibusimcontext->ibuscontext,
-- area.x,
-- area.y,
-- area.width,
-- area.height);
-- return FALSE;
-+ /* Translates the given point in client_window coordinates to coordinates
-+ relative to root coordinate system. */
-+ if (!gtk_widget_compute_point (ibusimcontext->client_window,
-+ root,
-+ &GRAPHENE_POINT_INIT (area.x, area.y),
-+ &p)) {
-+ graphene_point_init (&p, area.x, area.y);
- }
--#endif
--#endif
-
--#if GTK_CHECK_VERSION (3, 98, 4)
--#elif GTK_CHECK_VERSION (2, 91, 0)
-- if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
-- area.x = 0;
-- area.y += gdk_window_get_height (ibusimcontext->client_window);
-- }
--#else
-- if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
-- gint w, h;
-- gdk_drawable_get_size (ibusimcontext->client_window, &w, &h);
-- area.y += h;
-- area.x = 0;
-- }
--#endif
-+ native = gtk_widget_get_native (ibusimcontext->client_window);
-+ /* Translates from the surface coordinates into the widget coordinates. */
-+ gtk_native_get_surface_transform (native, &nx, &ny);
-
--#if GTK_CHECK_VERSION (3, 98, 4)
--#if defined(GDK_WINDOWING_X11)
-- GdkDisplay *display = gtk_widget_get_display (ibusimcontext->client_window);
-+ display = gtk_widget_get_display (ibusimcontext->client_window);
- if (GDK_IS_X11_DISPLAY (display)) {
-- Display *xdisplay = gdk_x11_display_get_xdisplay (display);
-- Window root_window = gdk_x11_display_get_xrootwindow (display);
-- GtkNative *native = gtk_widget_get_native (
-- ibusimcontext->client_window);
-- GdkSurface *surface = gtk_native_get_surface (native);
-- /* The window is the toplevel window but not the inner text widget.
-- * Unfortunatelly GTK4 cannot get the coordinate of the text widget.
-- */
-- Window window = gdk_x11_surface_get_xid (surface);
-+ GdkSurface *surface = gtk_native_get_surface
-+ (gtk_widget_get_native (ibusimcontext->client_window));
- Window child;
-- int x, y;
-- XTranslateCoordinates (xdisplay, window, root_window,
-- 0, 0, &x, &y, &child);
-- XWindowAttributes xwa;
-- XGetWindowAttributes (xdisplay, window, &xwa);
-- area.x = x - xwa.x + area.x;
-- area.y = y - xwa.y + area.y;
-- area.width = 50; /* FIXME: Why 50 meets the cursor position? */
-- area.height = xwa.height;
-+ int scale_factor = gtk_widget_get_scale_factor
-+ (ibusimcontext->client_window);
-+
-+ XTranslateCoordinates (GDK_DISPLAY_XDISPLAY (display),
-+ GDK_SURFACE_XID (surface),
-+ gdk_x11_display_get_xrootwindow (display),
-+ 0, 0, &tx, &ty,
-+ &child);
-+
-+ tx = tx / scale_factor;
-+ ty = ty / scale_factor;
- }
--#endif
-+
-+ area.x = p.x + nx + tx;
-+ area.y = p.y + ny + ty;
- #else
- gdk_window_get_root_coords (ibusimcontext->client_window,
- area.x, area.y,
- &area.x, &area.y);
- #endif
-+
- _set_rect_scale_factor_with_window (&area, ibusimcontext->client_window);
-- ibus_input_context_set_cursor_location (ibusimcontext->ibuscontext,
-- area.x,
-- area.y,
-- area.width,
-- area.height);
-+
-+#ifdef GDK_WINDOWING_WAYLAND
-+#if !GTK_CHECK_VERSION (3, 98, 4)
-+ display = gdk_window_get_display (ibusimcontext->client_window);
-+#endif
-+
-+ if (GDK_IS_WAYLAND_DISPLAY (display)) {
-+ ibus_input_context_set_cursor_location_relative (ibusimcontext->ibuscontext,
-+ area.x,
-+ area.y,
-+ area.width,
-+ area.height);
-+
-+ } else {
-+#endif
-+ ibus_input_context_set_cursor_location (ibusimcontext->ibuscontext,
-+ area.x,
-+ area.y,
-+ area.width,
-+ area.height);
-+#ifdef GDK_WINDOWING_WAYLAND
-+ }
-+#endif
-+
- return FALSE;
- }
-
---
-2.41.0
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:07 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : e9877b0a75da53b799a87b1adb106e10658c05fb
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2022-09-01T07:46:54+09:00
Stats : +0/-4563 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/e9877b0a75da53b799a87b1adb106e10658c05fb?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 94cfbfd..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,4563 +0,0 @@
-From 17648f0522910480b6c5dd4f5356ca1f6c160bf5 Mon Sep 17 00:00:00 2001
-From: Carlos Garnacho <carlosg@gnome.org>
-Date: Tue, 29 Mar 2022 22:48:19 +0200
-Subject: [PATCH] src: Fix refcounting issues
-
-Commit 5a455b1ead attempted to fix both GLib warnings around
-floating references and other presumed refcounting issues. However
-it missed 2 kinds of bugs:
-
-- The places that take an IBusText created from a static string
- were made to avoid freeing it afterwards, but the staticness refers
- to the string content, not the object itself.
-- The places that are documented to emit signals on floating object
- references used to do the following after signal emission:
-
- if (g_object_is_floating (object))
- g_object_unref (object)
-
- And did possibly trigger GLib warnings were changed to:
-
- if (g_object_is_floating (object))
- g_object_sink_ref (object);
- g_object_unref (object);
-
- Which fixes the GLib warning for floating references, but do
- unintendedly steal one reference away for non floating references.
-
-This commit is essentially a revert of commit 5a455b1ead, but
-addressing both things differently:
-
-- All label/tooltip/symbol IBusText properties in IBusProperty do
- now always sink the reference of the stored object.
-
-- All places documented as maybe using objects with a floating reference
- on signals changed to doing:
-
- if (g_object_is_floating (object)) {
- g_object_ref_sink (object);
- g_object_unref (object);
- }
-
- So the floating reference is owned and unreferenced without warnings,
- but already owned references are left unchanged.
-
-This addresses the possible GLib warnings, fixes the possible double
-unrefs happening on IBusText used in signals, and fixes the missing
-unrefs on IBusText objects created from static strings.
-
-BUG=https://github.com/ibus/ibus/issues/2393
-BUG=https://github.com/ibus/ibus/issues/2387
----
- src/ibusinputcontext.c | 35 +++++++++++++++++++++--------------
- src/ibusproperty.c | 32 +++++++++++++++++---------------
- 2 files changed, 38 insertions(+), 29 deletions(-)
-
-diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
-index 4b27551b..7981de38 100644
---- a/src/ibusinputcontext.c
-+++ b/src/ibusinputcontext.c
-@@ -549,9 +549,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- g_variant_unref (variant);
- g_signal_emit (context, context_signals[COMMIT_TEXT], 0, text);
-
-- if (g_object_is_floating (text))
-+ if (g_object_is_floating (text)) {
- g_object_ref_sink (text);
-- g_object_unref (text);
-+ g_object_unref (text);
-+ }
- return;
- }
- if (g_strcmp0 (signal_name, "UpdatePreeditText") == 0) {
-@@ -569,9 +570,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- cursor_pos,
- visible);
-
-- if (g_object_is_floating (text))
-+ if (g_object_is_floating (text)) {
- g_object_ref_sink (text);
-- g_object_unref (text);
-+ g_object_unref (text);
-+ }
- return;
- }
- if (g_strcmp0 (signal_name, "UpdatePreeditTextWithMode") == 0) {
-@@ -592,9 +594,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- visible,
- mode);
-
-- if (g_object_is_floating (text))
-+ if (g_object_is_floating (text)) {
- g_object_ref_sink (text);
-- g_object_unref (text);
-+ g_object_unref (text);
-+ }
- return;
- }
-
-@@ -621,9 +624,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- 0,
- text,
- visible);
-- if (g_object_is_floating (text))
-+ if (g_object_is_floating (text)) {
- g_object_ref_sink (text);
-- g_object_unref (text);
-+ g_object_unref (text);
-+ }
- return;
- }
-
-@@ -640,9 +644,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- 0,
- table,
- visible);
-- if (g_object_is_floating (table))
-+ if (g_object_is_floating (table)) {
- g_object_ref_sink (table);
-- g_object_unref (table);
-+ g_object_unref (table);
-+ }
- return;
-
- }
-@@ -659,9 +664,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
- 0,
- prop_list);
-
-- if (g_object_is_floating (prop_list))
-+ if (g_object_is_floating (prop_list)) {
- g_object_ref_sink (prop_list);
-- g_object_unref (prop_list);
-+ g_object_unref (prop_list);
-+ }
- return;
- }
-
-@@ -673,9 +679,10 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
-
- g_signal_emit (context, context_signals[UPDATE_PROPERTY], 0, prop);
-
-- if (g_object_is_floating (prop))
-+ if (g_object_is_floating (prop)) {
- g_object_ref_sink (prop);
-- g_object_unref (prop);
-+ g_object_unref (prop);
-+ }
- return;
- }
-
-diff --git a/src/ibusproperty.c b/src/ibusproperty.c
-index 6d4ed088..cd8a0e2a 100644
---- a/src/ibusproperty.c
-+++ b/src/ibusproperty.c
-@@ -336,20 +336,17 @@ ibus_property_destroy (IBusProperty *prop)
- prop->priv->icon = NULL;
-
- if (prop->priv->label) {
-- if (!ibus_text_get_is_static (prop->priv->label))
-- g_object_unref (prop->priv->label);
-+ g_object_unref (prop->priv->label);
- prop->priv->label = NULL;
- }
-
- if (prop->priv->symbol) {
-- if (!ibus_text_get_is_static (prop->priv->symbol))
-- g_object_unref (prop->priv->symbol);
-+ g_object_unref (prop->priv->symbol);
- prop->priv->symbol = NULL;
- }
-
- if (prop->priv->tooltip) {
-- if (!ibus_text_get_is_static (prop->priv->tooltip))
-- g_object_unref (prop->priv->tooltip);
-+ g_object_unref (prop->priv->tooltip);
- prop->priv->tooltip = NULL;
- }
-
-@@ -404,7 +401,7 @@ ibus_property_deserialize (IBusProperty *prop,
- g_variant_get_child (variant, retval++, "u", &prop->priv->type);
-
- GVariant *subvar = g_variant_get_child_value (variant, retval++);
-- if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
-+ if (prop->priv->label) {
- g_object_unref (prop->priv->label);
- }
- prop->priv->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
-@@ -414,7 +411,7 @@ ibus_property_deserialize (IBusProperty *prop,
- ibus_g_variant_get_child_string (variant, retval++, &prop->priv->icon);
-
- subvar = g_variant_get_child_value (variant, retval++);
-- if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
-+ if (prop->priv->tooltip) {
- g_object_unref (prop->priv->tooltip);
- }
- prop->priv->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
-@@ -435,7 +432,7 @@ ibus_property_deserialize (IBusProperty *prop,
-
- /* Keep the serialized order for the compatibility when add new members. */
- subvar = g_variant_get_child_value (variant, retval++);
-- if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
-+ if (prop->priv->symbol) {
- g_object_unref (prop->priv->symbol);
- }
- prop->priv->symbol = IBUS_TEXT (ibus_serializable_deserialize (subvar));
-@@ -567,7 +564,7 @@ ibus_property_set_label (IBusProperty *prop,
- g_assert (IBUS_IS_PROPERTY (prop));
- g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
-
-- if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
-+ if (prop->priv->label) {
- g_object_unref (prop->priv->label);
- }
-
-@@ -575,8 +572,10 @@ ibus_property_set_label (IBusProperty *prop,
- prop->priv->label = ibus_text_new_from_static_string ("");
- }
- else {
-- prop->priv->label = g_object_ref_sink (label);
-+ prop->priv->label = label;
- }
-+
-+ g_object_ref_sink (prop->priv->label);
- }
-
- void
-@@ -586,7 +585,7 @@ ibus_property_set_symbol (IBusProperty *prop,
- g_assert (IBUS_IS_PROPERTY (prop));
- g_return_if_fail (symbol == NULL || IBUS_IS_TEXT (symbol));
-
-- if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
-+ if (prop->priv->symbol) {
- g_object_unref (prop->priv->symbol);
- }
-
-@@ -594,8 +593,10 @@ ibus_property_set_symbol (IBusProperty *prop,
- prop->priv->symbol = ibus_text_new_from_static_string ("");
- }
- else {
-- prop->priv->symbol = g_object_ref_sink (symbol);
-+ prop->priv->symbol = symbol;
- }
-+
-+ g_object_ref_sink (prop->priv->symbol);
- }
-
- void
-@@ -615,7 +616,7 @@ ibus_property_set_tooltip (IBusProperty *prop,
- g_assert (IBUS_IS_PROPERTY (prop));
- g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip));
-
-- if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
-+ if (prop->priv->tooltip) {
- g_object_unref (prop->priv->tooltip);
- }
-
-@@ -624,8 +625,9 @@ ibus_property_set_tooltip (IBusProperty *prop,
- }
- else {
- prop->priv->tooltip = tooltip;
-- g_object_ref_sink (prop->priv->tooltip);
- }
-+
-+ g_object_ref_sink (prop->priv->tooltip);
- }
-
- void
---
-2.34.1
-
-From 1b5b9548ad418765717ce1fbdc70b3f3eaae67fc Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 14 Mar 2022 14:25:10 +0900
-Subject: [PATCH] client/gtk2: Revert CCedilla change for pt-BR
-
-gtk_im_context_simple_add_table() is deprecated in GTK4.
-I decide to delete gtk_im_context_simple_add_table() here because
-the change 03c9e591430c62354bbf26ef7bd4a2e6acfb7c8f is no longer needed
-because IBusEngineSimple has implemented to load pt_br compose key
-by locale
-
-BUG=chromium-os:11421
-BUG=http://codereview.appspot.com/3989060
----
- client/gtk2/ibusimcontext.c | 33 +--------------------------------
- 1 file changed, 1 insertion(+), 32 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index a5e5e792..e314ae98 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 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) 2008-2021 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -874,33 +874,6 @@ ibus_im_context_class_fini (IBusIMContextClass *class)
- g_bus_unwatch_name (_daemon_name_watch_id);
- }
-
--/* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
-- * Overwrite the original Gtk+'s compose table in gtk+-2.x.y/gtk/gtkimcontextsimple.c. */
--
--/* The difference between this and the default input method is the handling
-- * of C+acute - this method produces C WITH CEDILLA rather than C WITH ACUTE.
-- * For languages that use CCedilla and not acute, this is the preferred mapping,
-- * and is particularly important for pt_BR, where the us-intl keyboard is
-- * used extensively.
-- */
--static guint16 cedilla_compose_seqs[] = {
--#ifdef DEPRECATED_GDK_KEYSYMS
-- GDK_dead_acute, GDK_C, 0, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_dead_acute, GDK_c, 0, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-- GDK_Multi_key, GDK_apostrophe, GDK_C, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_Multi_key, GDK_apostrophe, GDK_c, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-- GDK_Multi_key, GDK_C, GDK_apostrophe, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_Multi_key, GDK_c, GDK_apostrophe, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
--#else
-- GDK_KEY_dead_acute, GDK_KEY_C, 0, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_KEY_dead_acute, GDK_KEY_c, 0, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-- GDK_KEY_Multi_key, GDK_KEY_apostrophe, GDK_KEY_C, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_KEY_Multi_key, GDK_KEY_apostrophe, GDK_KEY_c, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-- GDK_KEY_Multi_key, GDK_KEY_C, GDK_KEY_apostrophe, 0, 0, 0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-- GDK_KEY_Multi_key, GDK_KEY_c, GDK_KEY_apostrophe, 0, 0, 0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
--#endif
--};
--
- static void
- ibus_im_context_init (GObject *obj)
- {
-@@ -936,10 +909,6 @@ ibus_im_context_init (GObject *obj)
-
- // Create slave im context
- ibusimcontext->slave = gtk_im_context_simple_new ();
-- gtk_im_context_simple_add_table (GTK_IM_CONTEXT_SIMPLE (ibusimcontext->slave),
-- cedilla_compose_seqs,
-- 4,
-- G_N_ELEMENTS (cedilla_compose_seqs) / (4 + 2));
-
- g_signal_connect (ibusimcontext->slave,
- "commit",
---
-2.34.1
-
-From 37900574934bb01cc31860ae3ae2f668e4360838 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 28 Mar 2022 23:18:58 +0900
-Subject: [PATCH] src/tests: Run ibus-daemon from CI even if GNOME desktop
-
-gnome-shell no longer launch ibus-daemon with IBus systemd file.
-This is a workaround to call ibus-daemon after GNOME fails to
-launch ibus-daemon
-
-BUG=https://gitlab.gnome.org/GNOME/gdm/-/issues/777
----
- src/tests/ibus-desktop-testing-runner.in | 38 +++++++++++++++++++++---
- 1 file changed, 34 insertions(+), 4 deletions(-)
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 48528326..6b208345 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -55,6 +55,7 @@ GREEN='\033[0;32m'
- RED='\033[0;31m'
- NC='\033[0m'
-
-+
- print_log()
- {
- if [ x"$RESULT_LOG" != x ] ; then
-@@ -69,6 +70,7 @@ print_log()
- fi
- }
-
-+
- usage()
- {
- $ECHO -e \
-@@ -95,6 +97,7 @@ usage()
- ""
- }
-
-+
- parse_args()
- {
- # This is GNU getopt. "sudo port getopt" in BSD?
-@@ -129,6 +132,7 @@ parse_args()
- fi
- }
-
-+
- init_desktop()
- {
- if [ "$RESULT_LOG" != "" ] ; then
-@@ -207,6 +211,7 @@ _EOF
- #export XDG_SEAT=seat0
- }
-
-+
- run_dbus_daemon()
- {
- # Use dbus-launch --exit-with-session later instead of --sh-syntax
-@@ -216,6 +221,7 @@ run_dbus_daemon()
- export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
- }
-
-+
- init_gnome()
- {
- # gsettings set command needs dconf-service with the same $DISPLAY
-@@ -258,6 +264,7 @@ init_gnome()
- fi
- }
-
-+
- run_desktop()
- {
- echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null
-@@ -278,12 +285,28 @@ run_desktop()
- $DESKTOP_COMMAND &
- PID_GNOME_SESSION=$!
- sleep 30
-- if [ $HAS_GNOME -ne 0 ] ; then
-- ibus-daemon --daemonize --verbose
-- sleep 3
-- fi
-+
-+ # gnome-shell 42 checks if org.freedesktop.IBus.session.GNOME.service
-+ # systemd file is available with org.freedesktop.systemd1.Manager.GetUnit
-+ # D-Bus method, which is provided by IBus 1.5.26, and if the file
-+ # is available, gnome-shell no longer launch ibus-daemon
-+ # because gnome-shell assumes gnome-session would launch ibus-daemon
-+ # with org.freedesktop.systemd1.Manager.StartUnit D-Bus method.
-+ # But actually gnome-session failed to launch ibus-daemon
-+ # because the IBus systemd file depends on gnome-session.target
-+ # but this CI launches gnome-session directly.
-+ #
-+ # So ibus-dameon is now always called here after gnome-shell fails to
-+ # launch ibus-daemon.
-+ # It may be better this CI launches GDM autologin to run gnome-session
-+ # with gnome-session.target systemd file.
-+ # But `systemctl start gdm` terminates the parent script forcibly
-+ # and the script cannot get the CI result.
-+ ibus-daemon --daemonize --verbose
-+ sleep 3
- }
-
-+
- count_case_result()
- {
- retval=$1
-@@ -298,6 +321,7 @@ count_case_result()
- echo $pass $fail
- }
-
-+
- echo_case_result()
- {
- retval=$1
-@@ -311,6 +335,7 @@ echo_case_result()
- fi
- }
-
-+
- run_direct_test_cases()
- {
- pass=0
-@@ -363,6 +388,7 @@ EOF_ENVS
- echo $pass $fail
- }
-
-+
- run_gnome_desktop_testing_runner()
- {
- pass=0
-@@ -397,6 +423,7 @@ EOF
- echo $pass $fail
- }
-
-+
- run_test_suite()
- {
- pass=0
-@@ -435,6 +462,7 @@ EOF_RUNNER
- fi
- }
-
-+
- finit()
- {
- echo "# Killing left gnome-session and Xorg"
-@@ -451,6 +479,7 @@ finit()
- echo "# Finished $PROGNAME testing"
- }
-
-+
- main()
- {
- parse_args "$@"
-@@ -470,5 +499,6 @@ main()
- finit
- }
-
-+
- # Need to enclose $@ with double quotes not to split the array.
- main "$@"
---
-2.34.1
-
-From b024ea8fcee6fe1a20570a6f80cc4f9f8f420706 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 20 Apr 2022 19:36:10 +0900
-Subject: [PATCH] ui/gtk3: Disable XKB engines in Plasma Wayland
-
-Currently ibus-ui-gtk3 runs the setxkbmap command internally to set
-the XKB keymaps from XKB engines but setxkbmap does not work in Wayland
-session.
-The IBus XKB engines are disabled at the moment in Plamsa Wayland
-and ibus-ui-gtk3 asks users to use systemsettings5.
-
-Will use libinput and libxkbcommon later but it would be better
-to implement IBus in Plamsa Wayland compositor.
-
-BUG=rhbz#2076596
----
- configure.ac | 16 ++++++++++
- ui/gtk3/Makefile.am | 17 ++++++++++-
- ui/gtk3/panel.vala | 74 +++++++++++++++++++++++++++++++++++++++++----
- 3 files changed, 100 insertions(+), 7 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index a3cdb2da..79b9c11a 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -636,6 +636,21 @@ if test x"$enable_engine" = x"yes"; then
- enable_engine="yes (enabled, use --disable-engine to disable)"
- fi
-
-+# --disable-libnotify
-+AC_ARG_ENABLE(libnotify,
-+ AS_HELP_STRING([--disable-libnotify],
-+ [Disable to link libnotify]),
-+ [enable_libnotify=$enableval],
-+ [enable_libnotify=yes]
-+)
-+AM_CONDITIONAL([ENABLE_LIBNOTIFY], [test x"$enable_libnotify" = x"yes"])
-+if test x"$enable_libnotify" = x"yes"; then
-+ PKG_CHECK_MODULES(LIBNOTIFY, [
-+ libnotify >= 0.7
-+ ])
-+ enable_libnotify="yes (enabled, use --disable-libnotify to disable)"
-+fi
-+
- PKG_CHECK_MODULES(XTEST,
- [x11 xtst],
- [enable_xtest=yes],
-@@ -871,6 +886,7 @@ Build options:
- No snooper regexes "$NO_SNOOPER_APPS"
- Panel icon "$IBUS_ICON_KEYBOARD"
- Enable surrounding-text $enable_surrounding_text
-+ Enable libnotify $enable_libnotify
- Enable Emoji dict $enable_emoji_dict
- Unicode Emoji directory $UNICODE_EMOJI_DIR
- CLDR annotation directory $EMOJI_ANNOTATION_DIR
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index ab379328..2a9cabde 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -3,7 +3,7 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2015-2020 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2015-2022 Takao Fujwiara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2007-2020 Red Hat, Inc.
- #
- # This library is free software; you can redistribute it and/or
-@@ -81,6 +81,21 @@ AM_VALAFLAGS = \
- --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
- $(NULL)
-
-+if ENABLE_LIBNOTIFY
-+AM_CFLAGS += \
-+ @LIBNOTIFY_CFLAGS@ \
-+ $(NULL)
-+
-+AM_LDADD += \
-+ @LIBNOTIFY_LIBS@ \
-+ $(NULL)
-+
-+AM_VALAFLAGS += \
-+ --pkg=libnotify \
-+ -D ENABLE_LIBNOTIFY \
-+ $(NULL)
-+endif
-+
- if ENABLE_APPINDICATOR
- AM_VALAFLAGS += --define=INDICATOR
- endif
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 07ce6524..bd70d7d2 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -73,6 +73,7 @@ class Panel : IBus.PanelService {
- private string m_icon_prop_key = "";
- private int m_property_icon_delay_time = 500;
- private uint m_property_icon_delay_time_id;
-+ private bool m_is_wayland;
- #if INDICATOR
- private bool m_is_kde = is_kde();
- #else
-@@ -93,6 +94,18 @@ class Panel : IBus.PanelService {
-
- m_bus = bus;
-
-+#if USE_GDK_WAYLAND
-+ Gdk.set_allowed_backends("*");
-+ var display = Gdk.DisplayManager.get().open_display(null);
-+ Type instance_type = display.get_type();
-+ Type wayland_type = typeof(GdkWayland.Display);
-+ m_is_wayland = instance_type.is_a(wayland_type);
-+ Gdk.set_allowed_backends("x11");
-+#else
-+ m_is_wayland = false;
-+ warning("Checking Wayland is disabled");
-+#endif
-+
- init_settings();
-
- // init ui
-@@ -553,6 +566,11 @@ class Panel : IBus.PanelService {
- GLib.List<IBus.EngineDesc> im_engines =
- get_engines_from_locale(engines);
-
-+ if (m_is_wayland) {
-+ if (xkb_engines.length() > 0)
-+ xkb_engines = new GLib.List<IBus.EngineDesc>();
-+ }
-+
- string[] names = {};
- foreach (unowned IBus.EngineDesc engine in xkb_engines)
- names += engine.get_name();
-@@ -728,6 +746,32 @@ class Panel : IBus.PanelService {
- inited_engines_order = false;
- }
-
-+ private void update_version_1_5_26() {
-+#if ENABLE_LIBNOTIFY
-+ if (!Notify.is_initted()) {
-+ Notify.init ("ibus");
-+ }
-+
-+ var notification = new Notify.Notification(
-+ _("IBus Attention"),
-+ _("Layout changes do not work in Plasma Wayland. " +
-+ "Please use systemsettings5."),
-+ "ibus");
-+ notification.set_timeout(30 * 1000);
-+ notification.set_category("hotkey");
-+
-+ try {
-+ notification.show();
-+ } catch (GLib.Error e){
-+ warning (_("Layout changes do not work in Plasma Wayland. " +
-+ "Please use systemsettings5."));
-+ }
-+#else
-+ warning (_("Layout changes do not work in Plasma Wayland. " +
-+ "Please use systemsettings5."));
-+#endif
-+ }
-+
- private void set_version() {
- string prev_version = m_settings_general.get_string("version");
- string current_version = null;
-@@ -735,6 +779,9 @@ class Panel : IBus.PanelService {
- if (compare_versions(prev_version, "1.5.8") < 0)
- update_version_1_5_8();
-
-+ if (compare_versions(prev_version, "1.5.26") < 0)
-+ update_version_1_5_26();
-+
- current_version = "%d.%d.%d".printf(IBus.MAJOR_VERSION,
- IBus.MINOR_VERSION,
- IBus.MICRO_VERSION);
-@@ -856,7 +903,7 @@ class Panel : IBus.PanelService {
- m_icon_prop_key = "";
-
- // set xkb layout
-- if (!m_use_system_keyboard_layout)
-+ if (!m_use_system_keyboard_layout && !m_is_wayland)
- m_xkblayout.set_layout(engine);
-
- set_language_from_engine(engine);
-@@ -960,17 +1007,25 @@ class Panel : IBus.PanelService {
- string[]? order_names) {
- string[]? engine_names = unowned_engine_names;
-
-- if (engine_names == null || engine_names.length == 0)
-- engine_names = {"xkb:us::eng"};
-+ if (engine_names == null || engine_names.length == 0) {
-+ if (m_is_wayland)
-+ engine_names = {};
-+ else
-+ engine_names = {"xkb:us::eng"};
-+ }
-
- string[] names = {};
-
- foreach (var name in order_names) {
-+ if (m_is_wayland && name.has_prefix("xkb:"))
-+ continue;
- if (name in engine_names)
- names += name;
- }
-
- foreach (var name in engine_names) {
-+ if (m_is_wayland && name.has_prefix("xkb:"))
-+ continue;
- if (name in names)
- continue;
- names += name;
-@@ -1011,9 +1066,14 @@ class Panel : IBus.PanelService {
- }
-
- if (m_engines.length == 0) {
-- m_engines = engines;
-- switch_engine(0, true);
-- run_preload_engines(engines, 1);
-+ if (engines.length > 0) {
-+ m_engines = engines;
-+ switch_engine(0, true);
-+ run_preload_engines(engines, 1);
-+ } else {
-+ m_candidate_panel.set_language(new Pango.AttrLanguage(
-+ Pango.Language.from_string(null)));
-+ }
- } else {
- var current_engine = m_engines[0];
- m_engines = engines;
-@@ -1478,6 +1538,8 @@ class Panel : IBus.PanelService {
- /* Do not change the order of m_engines during running switcher. */
- if (m_switcher.is_running())
- return;
-+ if (m_engines.length == 0)
-+ return;
-
- if (m_icon_type == IconType.INDICATOR) {
- // Wait for the callback of the session bus.
---
-2.34.1
-
-From bca7bf0f97230806a26f53c798050408108cfb3d Mon Sep 17 00:00:00 2001
-From: Mike FABIAN <mfabian@redhat.com>
-Date: Wed, 25 May 2022 23:07:24 +0900
-Subject: [PATCH] data/dconf: Update xkb-latin-layouts in gschema
-
-Add more keyboard layouts which cannot produce ASCII to
-data/dconf/org.freedesktop.ibus.gschema.xml
-Remove "mal" and "mkd", there are no such layouts.
-
-BUG=https://github.com/ibus/ibus/issues/2404
----
- data/dconf/org.freedesktop.ibus.gschema.xml | 47 ++++++++++++++++++++-
- 1 file changed, 46 insertions(+), 1 deletion(-)
-
-diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
-index 516f7520..8b181d76 100644
---- a/data/dconf/org.freedesktop.ibus.gschema.xml
-+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
-@@ -28,7 +28,52 @@
- <description>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.</description>
- </key>
- <key name="xkb-latin-layouts" type="as">
-- <default>[ 'ara', 'bg', 'cz', 'dev', 'gr', 'gur', 'in', 'jp(kana)', 'mal', 'mkd', 'ru', 'ua' ]</default>
-+ <default>
-+ [ 'af', 'af(fa-olpc)', 'af(ps-olpc)', 'af(ps)', 'af(uz)',
-+ 'af(uz-olpc)', 'am', 'am(eastern)', 'am(eastern-alt)',
-+ 'am(phonetic)', 'am(phonetic-alt)', 'am(western)', 'ara',
-+ 'ara(azerty)', 'ara(azerty_digits)', 'ara(buckwalter)',
-+ 'ara(digits)', 'ara(qwerty)', 'ara(qwerty_digits)',
-+ 'az(cyrillic)', 'bd', 'bd(probhat)', 'bg', 'bg(bas_phonetic)',
-+ 'bg(phonetic)', 'brai', 'brai(left_hand)', 'brai(right_hand)',
-+ 'bt', 'by', 'by(legacy)', 'ca(ike)', 'ca(multi-2gr)',
-+ 'cn(tib)', 'cn(tib_asciinum)', 'cn(ug)', 'cz', 'cz(ucw)',
-+ 'de(ru)', 'dev', 'et', 'fr(geo)', 'ge', 'ge(os)', 'gr',
-+ 'gr(extended)', 'gr(nodeadkeys)', 'gr(polytonic)',
-+ 'gr(simple)', 'gur', 'il', 'il(biblical)', 'il(lyx)',
-+ 'il(phonetic)', 'in', 'in(ben)', 'in(ben_baishakhi)',
-+ 'in(ben_bornona)', 'in(ben_gitanjali)', 'in(ben_inscript)',
-+ 'in(ben_probhat)', 'in(bolnagri)', 'in(deva)', 'in(guj)',
-+ 'in(guru)', 'in(hin-kagapa)', 'in(hin-wx)', 'in(jhelum)',
-+ 'in(kan)', 'in(kan-kagapa)', 'in(mal)', 'in(mal_enhanced)',
-+ 'in(mal_lalitha)', 'in(mar-kagapa)', 'in(ori)',
-+ 'in(san-kagapa)', 'in(tam)', 'in(tam_tamilnet)',
-+ 'in(tam_tamilnet_TAB)', 'in(tam_tamilnet_TSCII)',
-+ 'in(tam_tamilnet_with_tam_nums)', 'in(tel)', 'in(tel-kagapa)',
-+ 'in(urd-phonetic)', 'in(urd-phonetic3)', 'in(urd-winkeys)',
-+ 'iq', 'ir', 'ir(pes_keypad)', 'jp(kana)', 'jp(mac)', 'kg',
-+ 'kg(phonetic)', 'kh', 'kz', 'kz(kazrus)', 'kz(ruskaz)', 'la',
-+ 'la(stea)', 'lk', 'lk(tam_TAB)', 'lk(tam_unicode)', 'ma',
-+ 'ma(tifinagh)', 'ma(tifinagh-alt)',
-+ 'ma(tifinagh-alt-phonetic)', 'ma(tifinagh-extended)',
-+ 'ma(tifinagh-extended-phonetic)', 'ma(tifinagh-phonetic)',
-+ 'me(cyrillic)', 'me(cyrillicalternatequotes)',
-+ 'me(cyrillicyz)', 'mk', 'mk(nodeadkeys)', 'mm', 'mn', 'mv',
-+ 'np', 'ph(capewell-dvorak-bay)', 'ph(capewell-qwerf2k6-bay)',
-+ 'ph(colemak-bay)', 'ph(dvorak-bay)', 'ph(qwerty-bay)', 'pk',
-+ 'pk(ara)', 'pk(snd)', 'pk(urd-crulp)', 'pk(urd-nla)',
-+ 'pl(ru_phonetic_dvorak)', 'rs', 'rs(alternatequotes)',
-+ 'rs(rue)', 'rs(yz)', 'ru', 'ru(bak)', 'ru(chm)', 'ru(cv)',
-+ 'ru(dos)', 'ru(kom)', 'ru(legacy)', 'ru(mac)',
-+ 'ru(os_legacy)', 'ru(os_winkeys)', 'ru(phonetic)',
-+ 'ru(phonetic_winkeys)', 'ru(sah)', 'ru(srp)', 'ru(tt)',
-+ 'ru(typewriter)', 'ru(typewriter-legacy)', 'ru(udm)',
-+ 'ru(xal)', 'se(rus)', 'se(rus_nodeadkeys)', 'se(swl)', 'sy',
-+ 'sy(syc)', 'sy(syc_phonetic)', 'th', 'th(pat)', 'th(tis)',
-+ 'tj', 'tj(legacy)', 'tz', 'ua', 'ua(homophonic)',
-+ 'ua(legacy)', 'ua(phonetic)', 'ua(rstu)', 'ua(rstu_ru)',
-+ 'ua(typewriter)', 'ua(winkeys)', 'us(chr)', 'us(rus)', 'uz' ]
-+ </default>
- <summary>Latin layouts which have no ASCII</summary>
- <description>US layout is appended to the Latin layouts. variant can be omitted.</description>
- </key>
---
-2.35.3
-
-From 16df64edadc21f50906e5442b73425b9256fbf65 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 25 May 2022 23:07:33 +0900
-Subject: [PATCH] src/tests: Add xkb-latin-layouts case
-
-BUG=https://github.com/ibus/ibus/issues/2404
----
- src/tests/Makefile.am | 26 ++++++--
- src/tests/runtest | 1 +
- src/tests/xkb-latin-layouts | 130 ++++++++++++++++++++++++++++++++++++
- 3 files changed, 150 insertions(+), 8 deletions(-)
- create mode 100755 src/tests/xkb-latin-layouts
-
-diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
-index f932f18f..ca5285bd 100644
---- a/src/tests/Makefile.am
-+++ b/src/tests/Makefile.am
-@@ -41,8 +41,9 @@ prog_ldadd =\
- $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la \
- $(NULL)
-
--noinst_PROGRAMS = $(TESTS)
--TESTS = \
-+noinst_PROGRAMS = $(TESTS_C)
-+noinst_SCRIPTS = $(TESTS_SCRIPT)
-+TESTS_C = \
- ibus-bus \
- ibus-config \
- ibus-configservice \
-@@ -56,16 +57,25 @@ TESTS = \
- ibus-util \
- $(NULL)
-
-+TESTS_SCRIPT = \
-+ xkb-latin-layouts \
-+ $(NULL)
-+
-+TESTS = \
-+ $(TESTS_C) \
-+ $(TESTS_SCRIPT) \
-+ $(NULL)
-+
- CLEANFILES =
-
- if ENABLE_ENGINE
--TESTS += ibus-engine-switch
-+TESTS_C += ibus-engine-switch
- endif
-
- if ENABLE_GTK3
--TESTS += ibus-compose
-+TESTS_C += ibus-compose
- if ENABLE_XTEST
--TESTS += ibus-keypress
-+TESTS_C += ibus-keypress
- endif
- endif
-
-@@ -99,9 +109,10 @@ CLEANFILES += \
- org.freedesktop.IBus.Desktop.Testing.desktop \
- $(NULL)
-
--test_execs_PROGRAMS = $(TESTS)
-+test_execs_PROGRAMS = $(TESTS_C)
-+test_execs_SCRIPTS = $(TESTS_SCRIPT)
- if ENABLE_GTK3
--test_execs_SCRIPTS = ibus-compose-locales
-+test_execs_SCRIPTS += ibus-compose-locales
- CLEANFILES += \
- ibus-compose-locales \
- $(NULL)
-@@ -138,6 +149,7 @@ ibus-desktop-testing-runner: ibus-desktop-testing-runner.in
-
- EXTRA_DIST = \
- $(test_metas_in) \
-+ $(TESTS_SCRIPT) \
- runtest \
- ibus-compose.emoji \
- ibus-compose.env \
-diff --git a/src/tests/runtest b/src/tests/runtest
-index a6e4194b..a229140a 100755
---- a/src/tests/runtest
-+++ b/src/tests/runtest
-@@ -35,6 +35,7 @@ ibus-engine-switch
- ibus-compose
- ibus-keypress
- test-stress
-+xkb-latin-layouts
- "
- IBUS_SCHEMA_FILE='org.freedesktop.ibus.gschema.xml'
- GTK_QUERY_MODULE=gtk-query-immodules-3.0-32
-diff --git a/src/tests/xkb-latin-layouts b/src/tests/xkb-latin-layouts
-new file mode 100755
-index 00000000..f8dced6b
---- /dev/null
-+++ b/src/tests/xkb-latin-layouts
-@@ -0,0 +1,130 @@
-+#!/bin/bash
-+
-+PROGNAME=`basename $0`
-+VERSION=0.1
-+# POSIX sh has no 'echo -e'
-+: ${ECHO:='/usr/bin/echo'}
-+TMPDIR=
-+INSTALLED_SCHEMAS_DIR=
-+
-+
-+usage()
-+{
-+ $ECHO -e \
-+"This test runs setxkbmap command for gsettings xkb-latin-layouts value\n" \
-+"$PROGNAME [OPTIONS…]\n" \
-+"\n" \
-+"OPTIONS:\n" \
-+"-h, --help This help\n" \
-+"-v, --version Show version\n" \
-+"-D, --schemasdir=DIR Load the latest schema file in DIR\n" \
-+""
-+}
-+
-+
-+parse_args()
-+{
-+ # This is GNU getopt. "sudo port getopt" in BSD?
-+ ARGS=`getopt -o hD:Tv --long \
-+ help,schemasdir:,tap,version\
-+ -- "$@"`;
-+ eval set -- "$ARGS"
-+ while [ 1 ] ; do
-+ case "$1" in
-+ -h | --help ) usage; exit 0;;
-+ -D | --schemasdir ) INSTALLED_SCHEMAS_DIR="$2"; shift 2;;
-+ -T | --tap ) shift;; # ignore the option
-+ -v | --version ) $ECHO -e "$VERSION"; exit 0;;
-+ -- ) shift; break;;
-+ * ) shift;;
-+ esac
-+ done
-+}
-+
-+
-+init()
-+{
-+ set -e
-+
-+ # gnome-continuous doesn't have a machine-id set, which
-+ # breaks dbus-launch. There's dbus-run-session which is
-+ # better, but not everyone has it yet.
-+ export DBUS_FATAL_WARNINGS=0
-+ export TMPDIR=$(mktemp -d --tmpdir="$PWD")
-+ export XDG_CONFIG_HOME="$TMPDIR/config"
-+ export XDG_CACHE_HOME="$TMPDIR/cache"
-+ export GSETTINGS_SCHEMA_DIR="$TMPDIR/schemas"
-+ mkdir -p $XDG_CONFIG_HOME $XDG_CACHE_HOME $GSETTINGS_SCHEMA_DIR
-+
-+ eval `dbus-launch --sh-syntax`
-+
-+ trap 'rm -rf $TMPDIR; kill $DBUS_SESSION_BUS_PID; setxkbmap -layout us' ERR
-+
-+ # in case that schema is not installed on the system
-+ glib-compile-schemas --targetdir "$GSETTINGS_SCHEMA_DIR" "$INSTALLED_SCHEMAS_DIR"
-+}
-+
-+
-+finit()
-+{
-+ # dbus-launch and gsettings run /usr/lib*/gvfsd-fuse $TMPDIR/cache/gvfs -f
-+ # via systemd since gvfs 1.45.90 in Fedora 33
-+ # and rm $TMPDIR could be failed until umount would be called.
-+ if [ -d $TMPDIR/cache/gvfs ] ; then
-+ umount $TMPDIR/cache/gvfs
-+ fi
-+ rm -rf $TMPDIR
-+
-+ kill $DBUS_SESSION_BUS_PID
-+ exit 0
-+}
-+
-+
-+test_xkb_keymaps()
-+{
-+ # Loop over top level schemas since "gsettings list-recursively" only
-+ # looks for direct children.
-+ xkb_latin_layouts=`gsettings get org.freedesktop.ibus.general xkb-latin-layouts`
-+ while read keymap ; do
-+ eval keymap="$keymap"
-+ HAS_VARIANT=$($ECHO "$keymap" | grep '(' 2> /dev/null) ||:
-+ if [ "x$HAS_VARIANT" != "x" ] ; then
-+ layout=$($ECHO "$keymap" | sed -e 's/\([^(]*\)([^)]*)/\1/')
-+ variant=$($ECHO "$keymap" | sed -e 's/[^(]*(\([^)]*\))/\1/')
-+ $ECHO setxkbmap -layout $layout -variant $variant
-+ setxkbmap -layout $layout -variant $variant
-+ else
-+ layout="$keymap"
-+ $ECHO setxkbmap -layout $layout
-+ setxkbmap -layout $layout
-+ fi
-+ if [ $? -ne 0 ] ; then
-+ $ECHO "Error in layout $layout variant $variant"
-+ setxkbmap -layout us
-+ exit 1
-+ fi
-+ done << EOF_READ_XKB
-+ `$ECHO $xkb_latin_layouts | sed -e 's/^\[//' -e 's/\]$//' | tr "," "\n"`
-+EOF_READ_XKB
-+
-+ setxkbmap -layout us
-+}
-+
-+
-+main()
-+{
-+ parse_args "$@"
-+
-+ if [ x"$INSTALLED_SCHEMAS_DIR" != x ] ; then
-+ init
-+ fi
-+
-+ test_xkb_keymaps
-+
-+ if [ x"$INSTALLED_SCHEMAS_DIR" != x ] ; then
-+ finit
-+ fi
-+}
-+
-+
-+main "$@"
---
-2.35.3
-
-From 233a3f4d4d3dc6782e74db5bf4e7c28fae729bc9 Mon Sep 17 00:00:00 2001
-From: Hollow Man <hollowman@opensuse.org>
-Date: Wed, 26 Jan 2022 09:35:11 +0800
-Subject: [PATCH 1/3] Add functionality to change IBus panel themes with
- available GTK themes
-
-To allow IBus to have their own control of themes.
-
-https://gitlab.gnome.org/GNOME/gnome-tweaks/-/blob/b9badc47b92dd73f8cedbd2efc66cbaf3ea25773/gtweak/tweaks/tweak_group_appearance.py#L69
-
-BUG=https://github.com/ibus/ibus/pull/2327
-
-Signed-off-by: Hollow Man <hollowman@opensuse.org>
----
- data/dconf/org.freedesktop.ibus.gschema.xml | 20 +++
- setup/main.py | 137 ++++++++++++++++++++
- setup/setup.ui | 97 +++++++++++++-
- ui/gtk3/bindingcommon.vala | 46 +++++++
- ui/gtk3/panel.vala | 18 +++
- ui/gtk3/panelbinding.vala | 18 +++
- 6 files changed, 335 insertions(+), 1 deletion(-)
-
-diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
-index 8b181d76..051f21a5 100644
---- a/data/dconf/org.freedesktop.ibus.gschema.xml
-+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
-@@ -210,6 +210,26 @@
- <summary>Custom font</summary>
- <description>Custom font name for language panel</description>
- </key>
-+ <key name="use-custom-theme" type="b">
-+ <default>false</default>
-+ <summary>Use custom theme</summary>
-+ <description>Use custom theme name for language panel</description>
-+ </key>
-+ <key name="custom-theme" type="s">
-+ <default>'Adwaita'</default>
-+ <summary>Custom theme</summary>
-+ <description>Custom theme name for language panel</description>
-+ </key>
-+ <key name="use-custom-icon" type="b">
-+ <default>false</default>
-+ <summary>Use custom icon</summary>
-+ <description>Use custom icon name for language panel</description>
-+ </key>
-+ <key name="custom-icon" type="s">
-+ <default>'Adwaita'</default>
-+ <summary>Custom icon</summary>
-+ <description>Custom icon name for language panel</description>
-+ </key>
- <key name="use-glyph-from-engine-lang" type="b">
- <default>true</default>
- <summary>Choose glyphs with input method's language on candidate window</summary>
-diff --git a/setup/main.py b/setup/main.py
-index 1b9056a6..71896693 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -29,6 +29,7 @@ import os
- import signal
- import sys
- import time
-+import glob
-
- from gi import require_version as gi_require_version
- gi_require_version('GLib', '2.0')
-@@ -196,6 +197,79 @@ class Setup(object):
- 'sensitive',
- Gio.SettingsBindFlags.GET)
-
-+ # custom theme
-+ self.__model_custom_theme = self.__builder.get_object(
-+ "model_custom_theme")
-+ self.__combobox_custom_theme = self.__builder.get_object(
-+ "combobox_custom_theme")
-+ self.__checkbutton_custom_theme = self.__builder.get_object(
-+ "checkbutton_custom_theme")
-+
-+ def update_combobox_custom_theme(settings, key):
-+ theme_name_list = self.__init_available_gtk_themes()
-+ self.__model_custom_theme.clear()
-+ for name in theme_name_list:
-+ self.__model_custom_theme.append([name])
-+ current_theme = self.__settings_panel.get_string(key)
-+ try:
-+ current_theme_number = theme_name_list.index(current_theme)
-+ except ValueError:
-+ self.__settings_panel.reset(key)
-+ current_theme = self.__settings_panel.get_string(key)
-+ current_theme_number = theme_name_list.index(current_theme)
-+ self.__combobox_custom_theme.set_active(current_theme_number)
-+
-+ update_combobox_custom_theme(None, 'custom-theme')
-+ self.__settings_panel.bind('use-custom-theme',
-+ self.__checkbutton_custom_theme,
-+ 'active',
-+ Gio.SettingsBindFlags.DEFAULT)
-+ self.__settings_panel.connect('changed::custom-theme',
-+ update_combobox_custom_theme)
-+ self.__settings_panel.bind('use-custom-theme',
-+ self.__combobox_custom_theme,
-+ 'sensitive',
-+ Gio.SettingsBindFlags.DEFAULT)
-+ self.__combobox_custom_theme.connect("changed",
-+ self.__on_combobox_custom_theme_changed)
-+
-+
-+ # custom icon
-+ self.__model_custom_icon = self.__builder.get_object(
-+ "model_custom_icon")
-+ self.__combobox_custom_icon = self.__builder.get_object(
-+ "combobox_custom_icon")
-+ self.__checkbutton_custom_icon = self.__builder.get_object(
-+ "checkbutton_custom_icon")
-+
-+ def update_combobox_custom_icon(settings, key):
-+ icon_name_list = self.__init_available_gtk_icons()
-+ self.__model_custom_icon.clear()
-+ for name in icon_name_list:
-+ self.__model_custom_icon.append([name])
-+ current_icon = self.__settings_panel.get_string(key)
-+ try:
-+ current_icon_number = icon_name_list.index(current_icon)
-+ except ValueError:
-+ self.__settings_panel.reset(key)
-+ current_icon = self.__settings_panel.get_string(key)
-+ current_icon_number = icon_name_list.index(current_icon)
-+ self.__combobox_custom_icon.set_active(current_icon_number)
-+
-+ update_combobox_custom_icon(None, 'custom-icon')
-+ self.__settings_panel.bind('use-custom-icon',
-+ self.__checkbutton_custom_icon,
-+ 'active',
-+ Gio.SettingsBindFlags.DEFAULT)
-+ self.__settings_panel.connect('changed::custom-icon',
-+ update_combobox_custom_icon)
-+ self.__settings_panel.bind('use-custom-icon',
-+ self.__combobox_custom_icon,
-+ 'sensitive',
-+ Gio.SettingsBindFlags.DEFAULT)
-+ self.__combobox_custom_icon.connect("changed",
-+ self.__on_combobox_custom_icon_changed)
-+
- # show icon on system tray
- self.__checkbutton_show_icon_on_systray = self.__builder.get_object(
- "checkbutton_show_icon_on_systray")
-@@ -588,6 +662,69 @@ class Setup(object):
- _("Use shortcut with shift to switch to the previous input method")
- entry.set_tooltip_text(tooltip)
-
-+ def __init_available_gtk_themes(self):
-+ path_list = []
-+ path_list.append(os.path.join(GLib.get_home_dir(), ".themes"))
-+ path_list.append(os.path.join(GLib.get_user_data_dir(), "themes"))
-+ path_list.extend(list(map(lambda x: os.path.join(
-+ x, "themes"), GLib.get_system_data_dirs())))
-+ theme_name_list = []
-+ gtk_theme_path = []
-+ for path in path_list:
-+ gtk_theme_path.extend(glob.glob(path + "/*/gtk-*/gtk.css"))
-+ gtk_theme_path.extend(glob.glob(path + "/*/gtk-*/gtk-dark.css"))
-+ for path in gtk_theme_path:
-+ filename = os.path.basename(path)
-+ appendix = ""
-+ if filename == "gtk-dark.css":
-+ appendix = ":dark"
-+ theme_name_list.append(os.path.basename(
-+ os.path.dirname(os.path.dirname(path))) + appendix)
-+
-+ theme_name_list.extend([
-+ 'Adwaita', 'Adwaita:dark',
-+ 'HighContrast', 'HighContrastInverse'
-+ ])
-+ theme_name_list = list(set(theme_name_list))
-+ theme_name_list.sort()
-+
-+ return theme_name_list
-+
-+ def __on_combobox_custom_theme_changed(self, combobox):
-+ tree_iter = self.__combobox_custom_theme.get_active_iter()
-+ if tree_iter is not None:
-+ model = self.__combobox_custom_theme.get_model()
-+ theme_name = model[tree_iter][0]
-+ self.__settings_panel.set_string('custom-theme', theme_name)
-+
-+ def __init_available_gtk_icons(self):
-+ path_list = []
-+ path_list.append(os.path.join(GLib.get_home_dir(), ".icons"))
-+ path_list.append(os.path.join(GLib.get_user_data_dir(), "icons"))
-+ path_list.extend(list(map(lambda x: os.path.join(
-+ x, "icons"), GLib.get_system_data_dirs())))
-+ icon_name_list = []
-+ gtk_icon_path = []
-+ for path in path_list:
-+ gtk_icon_path.extend(glob.glob(path + "/*/index.theme"))
-+ for path in gtk_icon_path:
-+ dir = os.path.dirname(path)
-+ if not os.path.exists(os.path.join(dir, "cursors")):
-+ icon_name_list.append(os.path.basename(dir))
-+
-+ icon_name_list.extend(["Adwaita"])
-+ icon_name_list = list(set(icon_name_list))
-+ icon_name_list.sort()
-+
-+ return icon_name_list
-+
-+ def __on_combobox_custom_icon_changed(self, combobox):
-+ tree_iter = self.__combobox_custom_icon.get_active_iter()
-+ if tree_iter is not None:
-+ model = self.__combobox_custom_icon.get_model()
-+ icon_name = model[tree_iter][0]
-+ self.__settings_panel.set_string('custom-icon', icon_name)
-+
- def __item_started_column_toggled_cb(self, cell, path_str, model):
-
- # get toggled iter
-diff --git a/setup/setup.ui b/setup/setup.ui
-index a15b9083..5a9804f9 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -55,6 +55,18 @@
- </row>
- </data>
- </object>
-+ <object class="GtkListStore" id="model_custom_theme">
-+ <columns>
-+ <!-- column-name gchararray -->
-+ <column type="gchararray"/>
-+ </columns>
-+ </object>
-+ <object class="GtkListStore" id="model_custom_icon">
-+ <columns>
-+ <!-- column-name gchararray -->
-+ <column type="gchararray"/>
-+ </columns>
-+ </object>
- <object class="GtkAdjustment" id="adjustment_emoji_partial_match">
- <property name="value">3.0</property>
- <property name="lower">1.0</property>
-@@ -1318,13 +1330,96 @@
- <property name="position">0</property>
- </packing>
- </child>
-+ <child>
-+ <object class="GtkGrid" id="table3">
-+ <property name="visible">True</property>
-+ <property name="can_focus">False</property>
-+ <property name="column_spacing">12</property>
-+ <property name="row_spacing">6</property>
-+ <child>
-+ <object class="GtkCheckButton" id="checkbutton_custom_theme">
-+ <property name="label" translatable="yes">Use custom theme:</property>
-+ <property name="use_action_appearance">False</property>
-+ <property name="visible">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="receives_default">False</property>
-+ <property name="use_action_appearance">False</property>
-+ <property name="use_underline">True</property>
-+ <property name="halign">start</property>
-+ <property name="draw_indicator">True</property>
-+ <property name="hexpand">True</property>
-+ </object>
-+ <packing>
-+ <property name="left_attach">0</property>
-+ <property name="top_attach">0</property>
-+ </packing>
-+ </child>
-+ <child>
-+ <object class="GtkComboBox" id="combobox_custom_theme">
-+ <property name="visible">True</property>
-+ <property name="can_focus">False</property>
-+ <property name="model">model_custom_theme</property>
-+ <property name="hexpand">True</property>
-+ <child>
-+ <object class="GtkCellRendererText" id="renderer4"/>
-+ <attributes>
-+ <attribute name="text">0</attribute>
-+ </attributes>
-+ </child>
-+ </object>
-+ <packing>
-+ <property name="left_attach">1</property>
-+ <property name="top_attach">0</property>
-+ </packing>
-+ </child>
-+ <child>
-+ <object class="GtkCheckButton" id="checkbutton_custom_icon">
-+ <property name="label" translatable="yes">Use custom icon:</property>
-+ <property name="use_action_appearance">False</property>
-+ <property name="visible">True</property>
-+ <property name="can_focus">True</property>
-+ <property name="receives_default">False</property>
-+ <property name="use_action_appearance">False</property>
-+ <property name="use_underline">True</property>
-+ <property name="halign">start</property>
-+ <property name="draw_indicator">True</property>
-+ </object>
-+ <packing>
-+ <property name="left_attach">0</property>
-+ <property name="top_attach">1</property>
-+ </packing>
-+ </child>
-+ <child>
-+ <object class="GtkComboBox" id="combobox_custom_icon">
-+ <property name="visible">True</property>
-+ <property name="can_focus">False</property>
-+ <property name="model">model_custom_icon</property>
-+ <child>
-+ <object class="GtkCellRendererText" id="renderer5"/>
-+ <attributes>
-+ <attribute name="text">0</attribute>
-+ </attributes>
-+ </child>
-+ </object>
-+ <packing>
-+ <property name="left_attach">1</property>
-+ <property name="top_attach">1</property>
-+ </packing>
-+ </child>
-+ </object>
-+ <packing>
-+ <property name="expand">False</property>
-+ <property name="fill">False</property>
-+ <property name="position">1</property>
-+ </packing>
-+ </child>
- </object>
- </child>
- <child type="label">
- <object class="GtkLabel" id="label20">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
-- <property name="label" translatable="yes"><b>Fonts</b></property>
-+ <property name="label" translatable="yes"><b>Font and Theme</b></property>
- <property name="use_markup">True</property>
- </object>
- </child>
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index 150d4c39..e825167b 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -212,4 +212,50 @@ class BindingCommon {
- css_provider,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
- }
-+
-+ public static void
-+ set_custom_theme(GLib.Settings? settings_panel) {
-+ if (settings_panel == null)
-+ return;
-+
-+ bool use_custom_theme = settings_panel.get_boolean("use-custom-theme");
-+ string custom_theme = settings_panel.get_string("custom-theme");
-+
-+ Gtk.Settings gtk_settings = Gtk.Settings.get_default();
-+
-+ if (use_custom_theme == false)
-+ custom_theme = "";
-+
-+ if (custom_theme == null || custom_theme == "") {
-+ gtk_settings.reset_property("gtk-theme-name");
-+ gtk_settings.reset_property("gtk-application-prefer-dark-theme");
-+ } else {
-+ string[] custom_theme_splitted = custom_theme.split(":");
-+ gtk_settings.gtk_theme_name = custom_theme_splitted[0];
-+ if (custom_theme_splitted.length == 2 &&
-+ custom_theme_splitted[1] == "dark")
-+ gtk_settings.gtk_application_prefer_dark_theme = true;
-+ else
-+ gtk_settings.gtk_application_prefer_dark_theme = false;
-+ }
-+ }
-+
-+ public static void
-+ set_custom_icon(GLib.Settings? settings_panel) {
-+ if (settings_panel == null)
-+ return;
-+
-+ bool use_custom_icon = settings_panel.get_boolean("use-custom-icon");
-+ string custom_icon = settings_panel.get_string("custom-icon");
-+
-+ Gtk.Settings gtk_settings = Gtk.Settings.get_default();
-+
-+ if (use_custom_icon == false)
-+ custom_icon = "";
-+
-+ if (custom_icon == null || custom_icon == "")
-+ gtk_settings.reset_property("gtk-icon-theme-name");
-+ else
-+ gtk_settings.gtk_icon_theme_name = custom_icon;
-+ }
- }
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 61bfa1b6..101c2b3d 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -211,6 +211,22 @@ class Panel : IBus.PanelService {
- ref m_css_provider);
- });
-
-+ m_settings_panel.changed["custom-theme"].connect((key) => {
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["use-custom-theme"].connect((key) => {
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["custom-icon"].connect((key) => {
-+ BindingCommon.set_custom_icon(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["use-custom-icon"].connect((key) => {
-+ BindingCommon.set_custom_icon(m_settings_panel);
-+ });
-+
- m_settings_panel.changed["use-glyph-from-engine-lang"].connect((key) =>
- {
- m_use_engine_lang = m_settings_panel.get_boolean(
-@@ -816,6 +832,8 @@ class Panel : IBus.PanelService {
- BindingCommon.set_custom_font(m_settings_panel,
- null,
- ref m_css_provider);
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ BindingCommon.set_custom_icon(m_settings_panel);
- set_show_icon_on_systray();
- set_lookup_table_orientation();
- set_show_property_panel();
-diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
-index e63d93f2..3c516afd 100644
---- a/ui/gtk3/panelbinding.vala
-+++ b/ui/gtk3/panelbinding.vala
-@@ -270,6 +270,22 @@ class PanelBinding : IBus.PanelService {
- ref m_css_provider);
- });
-
-+ m_settings_panel.changed["custom-theme"].connect((key) => {
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["use-custom-theme"].connect((key) => {
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["custom-icon"].connect((key) => {
-+ BindingCommon.set_custom_icon(m_settings_panel);
-+ });
-+
-+ m_settings_panel.changed["use-custom-icon"].connect((key) => {
-+ BindingCommon.set_custom_icon(m_settings_panel);
-+ });
-+
- m_settings_emoji.changed["unicode-hotkey"].connect((key) => {
- set_emoji_hotkey();
- });
-@@ -422,6 +438,8 @@ class PanelBinding : IBus.PanelService {
- BindingCommon.set_custom_font(m_settings_panel,
- m_settings_emoji,
- ref m_css_provider);
-+ BindingCommon.set_custom_theme(m_settings_panel);
-+ BindingCommon.set_custom_icon(m_settings_panel);
- set_emoji_favorites();
- if (m_load_emoji_at_startup && !m_loaded_emoji)
- set_emoji_lang();
---
-2.35.3
-
-From addab9fdc7f98c172b6fcb1e24faa133368bdaf3 Mon Sep 17 00:00:00 2001
-From: Hollow Man <hollowman@opensuse.org>
-Date: Wed, 26 Jan 2022 10:03:04 +0800
-Subject: [PATCH 2/3] Revert support for choosing GTK themes dark variant
-
-So that the theme list won't get too messy
-
-BUG=https://github.com/ibus/ibus/pull/2327
-
-Signed-off-by: Hollow Man <hollowman@opensuse.org>
----
- setup/main.py | 10 ++--------
- ui/gtk3/bindingcommon.vala | 14 +++-----------
- 2 files changed, 5 insertions(+), 19 deletions(-)
-
-diff --git a/setup/main.py b/setup/main.py
-index 71896693..d0e05666 100644
---- a/setup/main.py
-+++ b/setup/main.py
-@@ -672,18 +672,12 @@ class Setup(object):
- gtk_theme_path = []
- for path in path_list:
- gtk_theme_path.extend(glob.glob(path + "/*/gtk-*/gtk.css"))
-- gtk_theme_path.extend(glob.glob(path + "/*/gtk-*/gtk-dark.css"))
- for path in gtk_theme_path:
-- filename = os.path.basename(path)
-- appendix = ""
-- if filename == "gtk-dark.css":
-- appendix = ":dark"
- theme_name_list.append(os.path.basename(
-- os.path.dirname(os.path.dirname(path))) + appendix)
-+ os.path.dirname(os.path.dirname(path))))
-
- theme_name_list.extend([
-- 'Adwaita', 'Adwaita:dark',
-- 'HighContrast', 'HighContrastInverse'
-+ 'Adwaita', 'HighContrast', 'HighContrastInverse'
- ])
- theme_name_list = list(set(theme_name_list))
- theme_name_list.sort()
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index e825167b..4ecb7159 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -226,18 +226,10 @@ class BindingCommon {
- if (use_custom_theme == false)
- custom_theme = "";
-
-- if (custom_theme == null || custom_theme == "") {
-+ if (custom_theme == null || custom_theme == "")
- gtk_settings.reset_property("gtk-theme-name");
-- gtk_settings.reset_property("gtk-application-prefer-dark-theme");
-- } else {
-- string[] custom_theme_splitted = custom_theme.split(":");
-- gtk_settings.gtk_theme_name = custom_theme_splitted[0];
-- if (custom_theme_splitted.length == 2 &&
-- custom_theme_splitted[1] == "dark")
-- gtk_settings.gtk_application_prefer_dark_theme = true;
-- else
-- gtk_settings.gtk_application_prefer_dark_theme = false;
-- }
-+ else
-+ gtk_settings.gtk_theme_name = custom_theme;
- }
-
- public static void
---
-2.35.3
-
-From ff99828cb60915318ed0f40998a1a23d5dea42c7 Mon Sep 17 00:00:00 2001
-From: Hollow Man <hollowman@opensuse.org>
-Date: Wed, 26 Jan 2022 11:19:40 +0800
-Subject: [PATCH 3/3] Add tooltip text for use custom icon and theme
-
-BUG=https://github.com/ibus/ibus/pull/2327
-
-Signed-off-by: Hollow Man <hollowman@opensuse.org>
----
- setup/setup.ui | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/setup/setup.ui b/setup/setup.ui
-index 5a9804f9..6ded2061 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -1339,6 +1339,7 @@
- <child>
- <object class="GtkCheckButton" id="checkbutton_custom_theme">
- <property name="label" translatable="yes">Use custom theme:</property>
-+ <property name="tooltip_text" translatable="yes">Choose a theme of the candidate window</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
-@@ -1375,6 +1376,7 @@
- <child>
- <object class="GtkCheckButton" id="checkbutton_custom_icon">
- <property name="label" translatable="yes">Use custom icon:</property>
-+ <property name="tooltip_text" translatable="yes">Choose a theme of the arrow buttons on the candidate window</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
---
-2.35.3
-
-From 9ad063746ec3d919217ae18acce2d4768bcfca05 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 20 Jun 2022 21:01:31 +0900
-Subject: [PATCH] ui/gtk3: Hide XKB engine but enable it in Plasma Wayland
-
-IBus just cannot defer key events to the secondary input methods
-to switch XKB keymaps in Plasma Wayland because IBus has to handle the
-compose keys before defer the key events.
-
-Also update the POT file.
-
-BUG=rhbz#2088656
----
- data/dconf/org.freedesktop.ibus.gschema.xml | 4 +-
- ui/gtk3/panel.vala | 50 ++-
- 3 files changed, 248 insertions(+), 180 deletions(-)
-
-diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
-index 051f21a5..0ece2b4f 100644
---- a/data/dconf/org.freedesktop.ibus.gschema.xml
-+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
-@@ -223,12 +223,12 @@
- <key name="use-custom-icon" type="b">
- <default>false</default>
- <summary>Use custom icon</summary>
-- <description>Use custom icon name for language panel</description>
-+ <description>Use custom icon name for arrow buttons on candidate window</description>
- </key>
- <key name="custom-icon" type="s">
- <default>'Adwaita'</default>
- <summary>Custom icon</summary>
-- <description>Custom icon name for language panel</description>
-+ <description>Custom icon name for arrow buttons on candidate window</description>
- </key>
- <key name="use-glyph-from-engine-lang" type="b">
- <default>true</default>
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 101c2b3d..452b14c8 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -41,6 +41,7 @@ class Panel : IBus.PanelService {
- private Gtk.Menu m_ime_menu;
- private Gtk.Menu m_sys_menu;
- private IBus.EngineDesc[] m_engines = {};
-+ private IBus.EngineDesc m_en_engine;
- private GLib.HashTable<string, IBus.EngineDesc> m_engine_contexts =
- new GLib.HashTable<string, IBus.EngineDesc>(GLib.str_hash,
- GLib.str_equal);
-@@ -928,13 +929,20 @@ class Panel : IBus.PanelService {
- }
-
- private void switch_engine(int i, bool force = false) {
-- GLib.assert(i >= 0 && i < m_engines.length);
-+ if (m_is_wayland)
-+ GLib.assert(i >= 0 && i <= m_engines.length);
-+ else
-+ GLib.assert(i >= 0 && i < m_engines.length);
-
- // Do not need switch
- if (i == 0 && !force)
- return;
-
-- IBus.EngineDesc engine = m_engines[i];
-+ IBus.EngineDesc engine;
-+ if (m_is_wayland && m_engines.length == 0)
-+ engine = m_en_engine;
-+ else
-+ engine = m_engines[i];
-
- set_engine(engine);
- }
-@@ -1024,17 +1032,15 @@ class Panel : IBus.PanelService {
- string[]? order_names) {
- string[]? engine_names = unowned_engine_names;
-
-- if (engine_names == null || engine_names.length == 0) {
-- if (m_is_wayland)
-- engine_names = {};
-- else
-- engine_names = {"xkb:us::eng"};
-- }
-+ if (engine_names == null || engine_names.length == 0)
-+ engine_names = {"xkb:us::eng"};
-
- string[] names = {};
-
- foreach (var name in order_names) {
- if (m_is_wayland && name.has_prefix("xkb:"))
-+ name = "xkb:us::eng";
-+ if (name in names)
- continue;
- if (name in engine_names)
- names += name;
-@@ -1042,7 +1048,7 @@ class Panel : IBus.PanelService {
-
- foreach (var name in engine_names) {
- if (m_is_wayland && name.has_prefix("xkb:"))
-- continue;
-+ name = "xkb:us::eng";
- if (name in names)
- continue;
- names += name;
-@@ -1083,14 +1089,20 @@ class Panel : IBus.PanelService {
- }
-
- if (m_engines.length == 0) {
-- if (engines.length > 0) {
-- m_engines = engines;
-- switch_engine(0, true);
-- run_preload_engines(engines, 1);
-- } else {
-- m_candidate_panel.set_language(new Pango.AttrLanguage(
-- Pango.Language.from_string(null)));
-+ m_engines = engines;
-+ // Do not show engines in panel icon and suggest systemsettings5
-+ // in Plasma Wayland in case all engines are XKB.
-+ if (m_is_wayland && m_engines.length == 1 &&
-+ m_engines[0].get_name() == "xkb:us::eng") {
-+ m_engines = {};
-+ if (m_en_engine == null) {
-+ m_en_engine =
-+ m_bus.get_engines_by_names({"xkb:us::eng"})[0];
-+ }
- }
-+ switch_engine(0, true);
-+ if (m_engines.length > 0)
-+ run_preload_engines(m_engines, 1);
- } else {
- var current_engine = m_engines[0];
- m_engines = engines;
-@@ -1307,6 +1319,10 @@ class Panel : IBus.PanelService {
- var longname = engine.get_longname();
- var textdomain = engine.get_textdomain();
- var transname = GLib.dgettext(textdomain, longname);
-+ if (m_is_wayland && engine.get_name().has_prefix("xkb:")) {
-+ language = _("Other");
-+ transname = _("No input method");
-+ }
- var item = new Gtk.MenuItem.with_label(
- "%s - %s".printf (IBus.get_language_name(language), transname));
- // Make a copy of engine to workaround a bug in vala.
-@@ -1584,7 +1600,7 @@ class Panel : IBus.PanelService {
-
- if (engine != null) {
- var name = engine.get_name();
-- if (name.length >= 4 && name[0:4] == "xkb:")
-+ if (!m_is_wayland && name.length >= 4 && name[0:4] == "xkb:")
- language = m_switcher.get_xkb_language(engine);
- }
-
---
-2.35.3
-
-From b94f0c1cea5d0e423fef3bcc13b23f212f04c930 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:13:57 +0900
-Subject: [PATCH] src: Add IBUS_CAP_OSK to IBusCapabilite
-
-Some IMEs' behavior is different between the on-screen keyboard and
-the direct physical keyboard and this flag is useful for the IMEs.
-
-Also fix src/ibusaccelgroup.c for gtkdoc-mkhtml.
-If the API comment of IBusCapabilite is updated, XML & HTML files
-are rebuilt and gtk-doc-1.33.2 no longer accepts HTML tags in
-the comments.
----
- src/ibusaccelgroup.c | 14 +++++++-------
- src/ibustypes.h | 2 ++
- 2 files changed, 9 insertions(+), 7 deletions(-)
-
-diff --git a/src/ibusaccelgroup.c b/src/ibusaccelgroup.c
-index ef2d3976..aec1c7e4 100644
---- a/src/ibusaccelgroup.c
-+++ b/src/ibusaccelgroup.c
-@@ -267,14 +267,14 @@ is_keycode (const gchar *string)
- * modifier mask, %NULL
- *
- * Parses a string representing an accelerator. The format looks like
-- * “<Control>a” or “<Shift><Alt>F1” or “<Release>z” (the last one is
-- * for key release).
-+ * “<Control>a” or “<Shift><Alt>F1” or “<Release%gt;z”
-+ * (the last one is for key release).
- *
- * The parser is fairly liberal and allows lower or upper case, and also
-- * abbreviations such as “<Ctl>” and “<Ctrl>”. Key names are parsed using
-- * gdk_keyval_from_name(). For character keys the name is not the symbol,
-- * but the lowercase name, e.g. one would use “<Ctrl>minus” instead of
-- * “<Ctrl>-”.
-+ * abbreviations such as “<Ctl>” and “<Ctrl>”. Key names are
-+ * parsed using gdk_keyval_from_name(). For character keys the name is not the
-+ * symbol, but the lowercase name, e.g. one would use “<Ctrl>minus”
-+ * instead of “<Ctrl>-”.
- *
- * If the parse fails, @accelerator_key and @accelerator_mods will
- * be set to 0 (zero).
-@@ -403,7 +403,7 @@ out:
- *
- * Converts an accelerator keyval and modifier mask into a string
- * parseable by gtk_accelerator_parse(). For example, if you pass in
-- * #IBUS_KEY_q and #IBUS_CONTROL_MASK, this function returns “<Control>q”.
-+ * #IBUS_KEY_q and #IBUS_CONTROL_MASK, this function returns “<Control>q”.
- *
- * If you need to display accelerators in the user interface,
- * see gtk_accelerator_get_label().
-diff --git a/src/ibustypes.h b/src/ibustypes.h
-index 990659ac..60bcb92b 100644
---- a/src/ibustypes.h
-+++ b/src/ibustypes.h
-@@ -108,6 +108,7 @@ typedef enum
- * @IBUS_CAP_PROPERTY: UI is capable to have property.
- * @IBUS_CAP_SURROUNDING_TEXT: Client can provide surround text,
- * or IME can handle surround text.
-+ * @IBUS_CAP_OSK: UI is owned by on-screen keyboard.
- *
- * Capability flags of UI.
- */
-@@ -118,6 +119,7 @@ typedef enum {
- IBUS_CAP_FOCUS = 1 << 3,
- IBUS_CAP_PROPERTY = 1 << 4,
- IBUS_CAP_SURROUNDING_TEXT = 1 << 5,
-+ IBUS_CAP_OSK = 1 << 6,
- } IBusCapabilite;
-
- /**
---
-2.35.3
-
-From 4e48e7237d73d20f0426265dbb6b692b14891932 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:21:24 +0900
-Subject: [PATCH] tools: Enable ibus restart in GNOME desktop
-
-If ibus-daemon is called via systemd, IBus restart API cannot restart
-ibus-daemon but just terminates it.
-Now ibus restart command checks the systemd avaiability and restart
-ibus-daemon via systemd.
-ibus start command is also added to launch ibus-daemon with systemd.
-
-BUG=https://github.com/ibus/ibus/issues/2407
----
- tools/Makefile.am | 3 +-
- tools/ibus.1.in | 30 +++++-
- tools/main.vala | 261 ++++++++++++++++++++++++++++++++++++++++++++--
- 3 files changed, 330 insertions(+), 44 deletions(-)
-
-diff --git a/tools/Makefile.am b/tools/Makefile.am
-index 5c18d3d6..e380a9aa 100644
---- a/tools/Makefile.am
-+++ b/tools/Makefile.am
-@@ -3,7 +3,7 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2007-2017 Red Hat, Inc.
- #
- # This library is free software; you can redistribute it and/or
-@@ -57,6 +57,7 @@ AM_LDADD = \
- AM_VALAFLAGS = \
- --vapidir=$(top_builddir)/bindings/vala \
- --vapidir=$(top_srcdir)/bindings/vala \
-+ --pkg=gio-2.0 \
- --pkg=ibus-1.0 \
- --pkg=posix \
- --pkg=config \
-diff --git a/tools/ibus.1.in b/tools/ibus.1.in
-index 525d972e..fe1b7157 100644
---- a/tools/ibus.1.in
-+++ b/tools/ibus.1.in
-@@ -3,7 +3,7 @@
- .\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2013-2017.
- .\" Copyright (c) Peng Huang <shawn.p.huang@gmail.com>, 2013.
- .\"
--.TH "IBUS" 1 "May 2017" "@VERSION@" "User Commands"
-+.TH "IBUS" 1 "Jul 2022" "@VERSION@" "User Commands"
- .SH NAME
- .B ibus
- \- command line utility for ibus
-@@ -45,13 +45,33 @@ Exit ibus-daemon.
- \fBlist-engine\fR
- Show ibus engines list.
- .TP
--\fBrestart\fR
--Restart ibus-daemon.
-+\fBrestart\fR [\fB\-\-type=TYPE|\-\-verbose|\-\-help\fR]
-+Restart ibus-daemon. This command tries to restart ibus-daemon via systemd
-+firstly and directly secondary by default. If
-+.B \-\-type=systemd
-+is given, It tries to restart via systemd only. If
-+.B \-\-type=direct
-+is given, It tries to restart with an IBus API only. GNOME desktop runs
-+ibus-daemon via systemd and other desktops run ibus-daemon directly.
-+.TP
-+\fBstart\fR [\fB\-\-type=TYPE|\-\-verbose|\-\-help\fR]
-+Start ibus-daemon. This command tries to start ibus-daemon via systemd
-+firstly and directly secondary by default. If
-+.B \-\-type=systemd
-+is given, It tries to start as a background process via systemd only. If
-+.B \-\-type=direct
-+is given, It tries to start directly only as a foreground process and other
-+option arguments of ibus command are sent to ibus-daemon. E.g.
-+ibus start
-+.B \-\-type=direct
-+.B \-\-xim
-+&
-+GNOME desktop runs ibus-daemon via systemd and other desktops run ibus-daemon directly.
- .TP
- \fBversion\fR
- Show the ibus version.
- .TP
--\fBread\-cache\fR [\fB\-\-system|\-\-file=FILE\fR]
-+\fBread\-cache\fR [\fB\-\-system|\-\-file=FILE|\-\-help\fR]
- Show the content of the user registry cache if
- .B \-\-system
- is not given.
-@@ -64,7 +84,7 @@ if
- .B \-\-file=FILE
- is given.
- .TP
--\fBwrite\-cache\fR [\fB\-\-system|\-\-file=FILE\fR]
-+\fBwrite\-cache\fR [\fB\-\-system|\-\-file=FILE|\-\-help\fR]
- Save the user registry cache if
- .B \-\-system
- is not given.
-diff --git a/tools/main.vala b/tools/main.vala
-index 26e7fd88..407eaf74 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2015-2022 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
-@@ -27,17 +27,23 @@ private const string IBUS_SCHEMAS_GENERAL_HOTKEY =
- private const string IBUS_SCHEMAS_PANEL = "org.freedesktop.ibus.panel";
- private const string IBUS_SCHEMAS_PANEL_EMOJI =
- "org.freedesktop.ibus.panel.emoji";
-+private const string SYSTEMD_SESSION_GNOME_FILE =
-+ "org.freedesktop.IBus.session.GNOME.service";
-
- bool name_only = false;
- /* system() exists as a public API. */
- bool is_system = false;
- string cache_file = null;
- string engine_id = null;
-+bool verbose = false;
-+string daemon_type = null;
-+string systemd_service_file = null;
-
- class EngineList {
- public IBus.EngineDesc[] data = {};
- }
-
-+
- IBus.Bus? get_bus() {
- var bus = new IBus.Bus();
- if (!bus.is_connected ())
-@@ -45,6 +51,131 @@ IBus.Bus? get_bus() {
- return bus;
- }
-
-+
-+GLib.DBusConnection? get_session_bus(bool verbose) {
-+ try {
-+ return GLib.Bus.get_sync (GLib.BusType.SESSION, null);
-+ } catch (GLib.IOError e) {
-+ if (verbose)
-+ stderr.printf("%s\n", e.message);
-+ }
-+ return null;
-+}
-+
-+string?
-+get_ibus_systemd_object_path(GLib.DBusConnection connection,
-+ bool verbose) {
-+ string object_path = null;
-+ assert(systemd_service_file != null);
-+ try {
-+ var variant = connection.call_sync (
-+ "org.freedesktop.systemd1",
-+ "/org/freedesktop/systemd1",
-+ "org.freedesktop.systemd1.Manager",
-+ "GetUnit",
-+ new GLib.Variant("(s)", systemd_service_file),
-+ new GLib.VariantType("(o)"),
-+ GLib.DBusCallFlags.NONE,
-+ -1,
-+ null);
-+ variant.get("(o)", ref object_path);
-+ if (verbose) {
-+ stderr.printf("Succeed to get an object path \"%s\" for IBus " +
-+ "systemd service file \"%s\".\n",
-+ object_path, systemd_service_file);
-+ }
-+ return object_path;
-+ } catch (GLib.Error e) {
-+ if (verbose) {
-+ stderr.printf("IBus systemd service file \"%s\" is not installed " +
-+ "in your system: %s\n",
-+ systemd_service_file, e.message);
-+ }
-+ }
-+ return null;
-+}
-+
-+
-+bool
-+is_running_daemon_via_systemd(GLib.DBusConnection connection,
-+ string object_path,
-+ bool verbose) {
-+ string? state = null;
-+ try {
-+ while (true) {
-+ var variant = connection.call_sync (
-+ "org.freedesktop.systemd1",
-+ object_path,
-+ "org.freedesktop.DBus.Properties",
-+ "Get",
-+ new GLib.Variant("(ss)",
-+ "org.freedesktop.systemd1.Unit",
-+ "ActiveState"),
-+ new GLib.VariantType("(v)"),
-+ GLib.DBusCallFlags.NONE,
-+ -1,
-+ null);
-+ GLib.Variant child = null;
-+ variant.get("(v)", ref child);
-+ state = child.dup_string();
-+ if (verbose) {
-+ stderr.printf("systemd state is \"%s\" for an object " +
-+ "path \"%s\".\n", state, object_path);
-+ }
-+ if (state != "activating")
-+ break;
-+ Posix.sleep(1);
-+ }
-+ } catch (GLib.Error e) {
-+ if (verbose)
-+ stderr.printf("%s\n", e.message);
-+ return false;
-+ }
-+ if (state == "active")
-+ return true;
-+ return false;
-+}
-+
-+
-+bool
-+start_daemon_via_systemd(GLib.DBusConnection connection,
-+ bool restart,
-+ bool verbose) {
-+ string object_path = null;
-+ string method = "StartUnit";
-+ assert(systemd_service_file != null);
-+ if (restart)
-+ method = "RestartUnit";
-+ try {
-+ var variant = connection.call_sync (
-+ "org.freedesktop.systemd1",
-+ "/org/freedesktop/systemd1",
-+ "org.freedesktop.systemd1.Manager",
-+ method,
-+ new GLib.Variant("(ss)", systemd_service_file, "fail"),
-+ new GLib.VariantType("(o)"),
-+ GLib.DBusCallFlags.NONE,
-+ -1,
-+ null);
-+ variant.get("(o)", ref object_path);
-+ if (verbose) {
-+ stderr.printf("Succeed to restart IBus daemon via IBus systemd " +
-+ "service file \"%s\": \"%s\"\n",
-+ systemd_service_file, object_path);
-+ }
-+ return true;
-+ } catch (GLib.Error e) {
-+ if (verbose) {
-+ stderr.printf("Failed to %s IBus daemon via IBus systemd " +
-+ "service file \"%s\": %s\n",
-+ restart ? "restart" : "start",
-+ systemd_service_file, e.message);
-+ }
-+ }
-+ return false;
-+}
-+
-+
- int list_engine(string[] argv) {
- const OptionEntry[] options = {
- { "name-only", 0, 0, OptionArg.NONE, out name_only,
-@@ -99,6 +230,7 @@ int list_engine(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- private int exec_setxkbmap(IBus.EngineDesc engine) {
- string layout = engine.get_layout();
- string variant = engine.get_layout_variant();
-@@ -149,6 +281,7 @@ private int exec_setxkbmap(IBus.EngineDesc engine) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int get_set_engine(string[] argv) {
- var bus = get_bus();
- string engine = null;
-@@ -182,20 +315,121 @@ int get_set_engine(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int message_watch(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
--int restart_daemon(string[] argv) {
-- var bus = get_bus();
-- if (bus == null) {
-- stderr.printf(_("Can't connect to IBus.\n"));
-+
-+int start_daemon_real(string[] argv,
-+ bool restart) {
-+ const OptionEntry[] options = {
-+ { "type", 0, 0, OptionArg.STRING, out daemon_type,
-+ N_("Start or restart daemon with \"direct\" or \"systemd\" TYPE."),
-+ "TYPE" },
-+ { "service-file", 0, 0, OptionArg.STRING, out systemd_service_file,
-+ N_("Start or restart daemon with SYSTEMD_SERVICE file."),
-+ "SYSTEMD_SERVICE" },
-+ { "verbose", 0, 0, OptionArg.NONE, out verbose,
-+ N_("Show debug messages."), null },
-+ { null }
-+ };
-+
-+ var option = new OptionContext();
-+ option.add_main_entries(options, Config.GETTEXT_PACKAGE);
-+ option.set_ignore_unknown_options(true);
-+
-+ try {
-+ option.parse(ref argv);
-+ } catch (OptionError e) {
-+ stderr.printf("%s\n", e.message);
-+ return Posix.EXIT_FAILURE;
-+ }
-+ if (daemon_type != null && daemon_type != "direct" &&
-+ daemon_type != "systemd") {
-+ stderr.printf("type argument must be \"direct\" or \"systemd\"\n");
-+ return Posix.EXIT_FAILURE;
-+ }
-+ if (systemd_service_file == null)
-+ systemd_service_file = SYSTEMD_SESSION_GNOME_FILE;
-+
-+ do {
-+ if (daemon_type == "direct")
-+ break;
-+ GLib.DBusConnection? connection = get_session_bus(verbose);
-+ if (connection == null)
-+ break;
-+ string? object_path = null;
-+ if (restart) {
-+ object_path = get_ibus_systemd_object_path(connection, verbose);
-+ if (object_path == null)
-+ break;
-+ if (!is_running_daemon_via_systemd(connection,
-+ object_path,
-+ verbose)) {
-+ break;
-+ }
-+ }
-+ if (!start_daemon_via_systemd(connection, restart, verbose))
-+ break;
-+ // Do not check the systemd state in case of restart because
-+ // the systemd file validation is already done and also stopping
-+ // daemon and starting daemon take time and the state could be
-+ // "inactive" with the time lag.
-+ if (restart)
-+ return Posix.EXIT_SUCCESS;
-+ object_path = get_ibus_systemd_object_path(connection, verbose);
-+ if (object_path == null)
-+ break;
-+ if (!is_running_daemon_via_systemd(connection, object_path, verbose))
-+ break;
-+ return Posix.EXIT_SUCCESS;
-+ } while (false);
-+
-+ if (daemon_type == "systemd")
- return Posix.EXIT_FAILURE;
-+ if (restart) {
-+ var bus = get_bus();
-+ if (bus == null) {
-+ stderr.printf(_("Can't connect to IBus.\n"));
-+ return Posix.EXIT_FAILURE;
-+ }
-+ bus.exit(true);
-+ if (verbose) {
-+ stderr.printf("Succeed to restart ibus-daemon with an IBus API " +
-+ "directly.\n");
-+ }
-+ } else {
-+ string startarg = "ibus-daemon";
-+ argv[0] = startarg;
-+ var paths = GLib.Environment.get_variable("PATH").split(":");
-+ foreach (unowned string path in paths) {
-+ var full_path = "%s/%s".printf(path, startarg);
-+ if (GLib.FileUtils.test(full_path, GLib.FileTest.IS_EXECUTABLE)) {
-+ startarg = full_path;
-+ break;
-+ }
-+ }
-+ // When ibus-daemon is launched by GLib.Process.spawn_async(),
-+ // the parent process will be systemd
-+ if (verbose) {
-+ stderr.printf("Running \"%s\" directly as a foreground " +
-+ "process.\n", startarg);
-+ }
-+ Posix.execv(startarg, argv);
- }
-- bus.exit(true);
- return Posix.EXIT_SUCCESS;
- }
-
-+
-+int restart_daemon(string[] argv) {
-+ return start_daemon_real(argv, true);
-+}
-+
-+int start_daemon(string[] argv) {
-+ return start_daemon_real(argv, false);
-+}
-+
- int exit_daemon(string[] argv) {
- var bus = get_bus();
- if (bus == null) {
-@@ -206,11 +440,13 @@ int exit_daemon(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int print_version(string[] argv) {
- print("IBus %s\n", Config.PACKAGE_VERSION);
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int read_cache (string[] argv) {
- const OptionEntry[] options = {
- { "system", 0, 0, OptionArg.NONE, out is_system,
-@@ -251,6 +487,7 @@ int read_cache (string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int write_cache (string[] argv) {
- const OptionEntry[] options = {
- { "system", 0, 0, OptionArg.NONE, out is_system,
-@@ -283,12 +520,14 @@ int write_cache (string[] argv) {
- Posix.EXIT_SUCCESS : Posix.EXIT_FAILURE;
- }
-
-+
- int print_address(string[] argv) {
- string address = IBus.get_address();
- print("%s\n", address != null ? address : "(null)");
- return Posix.EXIT_SUCCESS;
- }
-
-+
- private int read_config_options(string[] argv) {
- const OptionEntry[] options = {
- { "engine-id", 0, 0, OptionArg.STRING, out engine_id,
-@@ -309,6 +548,7 @@ private int read_config_options(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- private GLib.SList<string> get_ibus_schemas() {
- string[] ids = {};
- if (engine_id != null) {
-@@ -342,6 +582,7 @@ private GLib.SList<string> get_ibus_schemas() {
- return ibus_schemas;
- }
-
-+
- int read_config(string[] argv) {
- if (read_config_options(argv) == Posix.EXIT_FAILURE)
- return Posix.EXIT_FAILURE;
-@@ -370,6 +611,7 @@ int read_config(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- int reset_config(string[] argv) {
- if (read_config_options(argv) == Posix.EXIT_FAILURE)
- return Posix.EXIT_FAILURE;
-@@ -401,6 +643,7 @@ int reset_config(string[] argv) {
- return Posix.EXIT_SUCCESS;
- }
-
-+
- #if EMOJI_DICT
- int emoji_dialog(string[] argv) {
- string cmd = Config.LIBEXECDIR + "/ibus-ui-emojier";
-@@ -427,11 +670,13 @@ int emoji_dialog(string[] argv) {
- }
- #endif
-
-+
- int print_help(string[] argv) {
- print_usage(stdout);
- return Posix.EXIT_SUCCESS;
- }
-
-+
- delegate int EntryFunc(string[] argv);
-
- struct CommandEntry {
-@@ -440,12 +685,14 @@ struct CommandEntry {
- unowned EntryFunc entry;
- }
-
-+
- const CommandEntry commands[] = {
- { "engine", N_("Set or get engine"), get_set_engine },
- { "exit", N_("Exit ibus-daemon"), exit_daemon },
- { "list-engine", N_("Show available engines"), list_engine },
- { "watch", N_("(Not implemented)"), message_watch },
- { "restart", N_("Restart ibus-daemon"), restart_daemon },
-+ { "start", N_("Start ibus-daemon"), start_daemon },
- { "version", N_("Show version"), print_version },
- { "read-cache", N_("Show the content of registry cache"), read_cache },
- { "write-cache", N_("Create registry cache"), write_cache },
-@@ -460,6 +707,7 @@ const CommandEntry commands[] = {
-
- static string program_name;
-
-+
- void print_usage(FileStream stream) {
- stream.printf(_("Usage: %s COMMAND [OPTION...]\n\n"), program_name);
- stream.printf(_("Commands:\n"));
-@@ -470,6 +718,7 @@ void print_usage(FileStream stream) {
- }
- }
-
-+
- public int main(string[] argv) {
- GLib.Intl.setlocale(GLib.LocaleCategory.ALL, "");
- GLib.Intl.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
---
-2.35.3
-
-From 5b441fabc9d766e694b992e0e2f28924d00a7402 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:22:26 +0900
-Subject: [PATCH] tools: Add ibus im-module command
-
-ibus im-module command can retrive gtk-im-module value from an
-instance of GtkIMMultiContext.
-The GTK version can be specified by --type option and the default
-is --type=gtk3 and GTK3 im-ibus.so is dlopened.
----
- client/gtk2/ibusim.c | 20 ++++++
- client/gtk4/ibusim.c | 20 ++++++
- tools/IBusIMModule-1.0.metadata | 1 +
- tools/Makefile.am | 116 ++++++++++++++++++++++++++------
- tools/ibus.1.in | 10 +++
- tools/ibusimmodule.c | 87 ++++++++++++++++++++++++
- tools/ibusimmodule.h | 36 ++++++++++
- tools/main.vala | 11 +++
- 8 files changed, 308 insertions(+), 40 deletions(-)
- create mode 100644 tools/IBusIMModule-1.0.metadata
- create mode 100644 tools/ibusimmodule.c
- create mode 100644 tools/ibusimmodule.h
-
-diff --git a/client/gtk2/ibusim.c b/client/gtk2/ibusim.c
-index 55609ce7..e196d536 100644
---- a/client/gtk2/ibusim.c
-+++ b/client/gtk2/ibusim.c
-@@ -77,3 +77,23 @@ im_module_list (const GtkIMContextInfo ***contexts,
- *n_contexts = G_N_ELEMENTS (info_list);
- }
-
-+G_MODULE_EXPORT const char *
-+im_get_context_id (int *argc,
-+ char ***argv)
-+{
-+ GtkIMContext *context;
-+ char *preedit_string = NULL;
-+ PangoAttrList *preedit_attrs = NULL;
-+ const char *context_id;
-+
-+ gtk_init (argc, argv);
-+ context = gtk_im_multicontext_new ();
-+ gtk_im_context_get_preedit_string (context,
-+ &preedit_string,
-+ &preedit_attrs,
-+ 0);
-+ context_id = gtk_im_multicontext_get_context_id (
-+ GTK_IM_MULTICONTEXT (context));
-+ return context_id;
-+}
-+
-diff --git a/client/gtk4/ibusim.c b/client/gtk4/ibusim.c
-index 5ecf9778..562bdf2d 100644
---- a/client/gtk4/ibusim.c
-+++ b/client/gtk4/ibusim.c
-@@ -50,3 +50,23 @@ g_io_im_ibus_unload (GTypeModule *type_module)
- g_type_module_unuse (type_module);
- }
-
-+G_MODULE_EXPORT const char *
-+im_get_context_id (int *argc,
-+ char ***argv)
-+{
-+ GtkIMContext *context;
-+ char *preedit_string = NULL;
-+ PangoAttrList *preedit_attrs = NULL;
-+ const char *context_id;
-+
-+ gtk_init ();
-+ context = gtk_im_multicontext_new ();
-+ gtk_im_context_get_preedit_string (context,
-+ &preedit_string,
-+ &preedit_attrs,
-+ 0);
-+ context_id = gtk_im_multicontext_get_context_id (
-+ GTK_IM_MULTICONTEXT (context));
-+ return context_id;
-+}
-+
-diff --git a/tools/IBusIMModule-1.0.metadata b/tools/IBusIMModule-1.0.metadata
-new file mode 100644
-index 00000000..14adc9ee
---- /dev/null
-+++ b/tools/IBusIMModule-1.0.metadata
-@@ -0,0 +1 @@
-+IBusIMModule cheader_filename="ibusimmodule.h" name="IBusIMModule"
-diff --git a/tools/Makefile.am b/tools/Makefile.am
-index e380a9aa..a9262ee0 100644
---- a/tools/Makefile.am
-+++ b/tools/Makefile.am
-@@ -24,9 +24,19 @@
- NULL =
-
- libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la
-+libibusimmodule = libibusimmodule.la
-+ibusimmodule_gir = IBusIMModule-1.0.gir
-+ibus_immodule_vapi = ibus-immodule-1.0.vapi
- libibus_emoji_dialog = \
- $(top_builddir)/ui/gtk3/libibus-emoji-dialog-@IBUS_API_VERSION@.la
-
-+noinst_LTLIBRARIES = $(libibusimmodule)
-+noinst_DATA =
-+INTROSPECTION_GIRS =
-+MAINTAINERCLEANFILES =
-+DISTCLEANFILES =
-+VAPIGEN_VAPIS =
-+
- # force include config.h before gi18n.h.
- AM_CPPFLAGS = \
- -I$(top_srcdir)/src \
-@@ -47,22 +57,26 @@ AM_CFLAGS = \
- $(NULL)
-
- AM_LDADD = \
-- @GOBJECT2_LIBS@ \
-- @GLIB2_LIBS@ \
-- @GIO2_LIBS@ \
-- @GTHREAD2_LIBS@ \
-- $(libibus) \
-- $(NULL)
-+ @GOBJECT2_LIBS@ \
-+ @GLIB2_LIBS@ \
-+ @GIO2_LIBS@ \
-+ @GTHREAD2_LIBS@ \
-+ $(libibus) \
-+ $(libibusimmodule) \
-+ $(NULL)
-
- AM_VALAFLAGS = \
-- --vapidir=$(top_builddir)/bindings/vala \
-- --vapidir=$(top_srcdir)/bindings/vala \
-- --pkg=gio-2.0 \
-- --pkg=ibus-1.0 \
-- --pkg=posix \
-- --pkg=config \
-- --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
-- $(NULL)
-+ --vapidir=$(top_builddir)/bindings/vala \
-+ --vapidir=$(top_srcdir)/bindings/vala \
-+ --vapidir=$(builddir) \
-+ --vapidir=$(srcdir) \
-+ --pkg=gio-2.0 \
-+ --pkg=ibus-1.0 \
-+ --pkg=ibus-immodule-1.0 \
-+ --pkg=posix \
-+ --pkg=config \
-+ --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
-+ $(NULL)
-
- bin_PROGRAMS = ibus
-
-@@ -79,9 +93,27 @@ bash_completion_DATA= \
- $(NULL)
- bash_completiondir=@datadir@/bash-completion/completions
-
-+libibusimmodule_la_SOURCES = \
-+ ibusimmodule.c \
-+ ibusimmodule.h \
-+ $(NULL)
-+libibusimmodule_la_CFLAGS = \
-+ @GLIB2_CFLAGS@ \
-+ -DGTK2_IM_MODULEDIR=\"$(GTK2_IM_MODULEDIR)\" \
-+ -DGTK3_IM_MODULEDIR=\"$(GTK3_IM_MODULEDIR)\" \
-+ -DGTK4_IM_MODULEDIR=\"$(GTK4_IM_MODULEDIR)\" \
-+ $(NULL)
-+libibusimmodule_la_LIBADD = \
-+ @GLIB2_LIBS@ \
-+ $(NULL)
-+libibusimmodule_la_LDFLAGS = \
-+ -no-undefined \
-+ -export-symbols-regex "ibus_.*" \
-+ $(NULL)
-+
- man_one_in_files = ibus.1.in
- man_one_files = $(man_one_in_files:.1.in=.1)
--man_one_DATA =$(man_one_files:.1=.1.gz)
-+man_one_DATA =$(man_one_files:.1=.1.gz)
- man_onedir = $(mandir)/man1
- %.1: %.1.in
- $(AM_V_GEN) sed \
-@@ -91,14 +123,17 @@ man_onedir = $(mandir)/man1
- $(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@
-
- EXTRA_DIST = \
-- $(man_one_in_files) \
-- ibus.bash \
-- $(NULL)
-+ $(ibus_immodule_vapi) \
-+ $(ibusimmodule_gir) \
-+ $(man_one_in_files) \
-+ ibus.bash \
-+ IBusIMModule-1.0.metadata \
-+ $(NULL)
-
- CLEANFILES = \
-- $(man_one_DATA) \
-- $(man_one_files) \
-- $(NULL)
-+ $(man_one_DATA) \
-+ $(man_one_files) \
-+ $(NULL)
-
- if ENABLE_EMOJI_DICT
- if ENABLE_UI
-@@ -108,4 +143,43 @@ AM_VALAFLAGS += \
- endif
- endif
-
-+if HAVE_INTROSPECTION
-+BUILT_SOURCES = $(INTROSPECTION_GIRS) $(VAPIGEN_VAPIS)
-+
-+-include $(INTROSPECTION_MAKEFILE)
-+INTROSPECTION_SCANNER_ARGS =
-+INTROSPECTION_COMPILER_ARGS = \
-+ --includedir=$(srcdir) \
-+ --includedir=. \
-+ $(NULL)
-+
-+IBusIMModule-1.0.gir: $(libibusimmodule) Makefile
-+IBusIMModule_1_0_gir_SCANNERFLAGS = \
-+ --pkg=glib-2.0 \
-+ $(IBUS_GIR_SCANNERFLAGS) \
-+ $(NULL)
-+IBusIMModule_1_0_gir_INCLUDES = GLib-2.0
-+IBusIMModule_1_0_gir_LIBS = $(libibusimmodule)
-+IBusIMModule_1_0_gir_FILES = ibusimmodule.h
-+IBusIMModule_1_0_gir_CFLAGS = \
-+ -I$(srcdir) \
-+ -I$(builddir) \
-+ $(NULL)
-+
-+INTROSPECTION_GIRS += $(ibusimmodule_gir)
-+noinst_DATA += $(ibusimmodule_gir)
-+MAINTAINERCLEANFILES += $(ibusimmodule_gir)
-+DISTCLEANFILES += $(ibusimmodule_gir)
-+
-+-include $(VAPIGEN_MAKEFILE)
-+ibus-immodule-1.0.vapi: $(ibusimmodule_gir) IBusIMModule-1.0.metadata
-+ibus_immodule_1_0_vapi_DEPS = glib-2.0
-+ibus_immodule_1_0_vapi_METADATADIRS = $(srcdir)
-+ibus_immodule_1_0_vapi_FILES = IBusIMModule-1.0.gir
-+VAPIGEN_VAPIS += $(ibus_immodule_vapi)
-+noinst_DATA += $(ibus_immodule_vapi)
-+MAINTAINERCLEANFILES += $(ibus_immodule_vapi)
-+DISTCLEANFILES += $(ibus_immodule_vapi)
-+endif
-+
- -include $(top_srcdir)/git.mk
-diff --git a/tools/ibus.1.in b/tools/ibus.1.in
-index fe1b7157..84ef5fff 100644
---- a/tools/ibus.1.in
-+++ b/tools/ibus.1.in
-@@ -128,6 +128,16 @@ option enables to match annotations with a partial string. These settings
- are available with
- .B ibus\-setup (1)
- utility.
-+.TP
-+\fBim-module\fR [\fB\-\-type=TYPE|\-\-help\fR]
-+Show an internal im-module value in a virtual GTK application. If IBus is
-+installed and configured properly, the output is "ibus". This sub-command
-+is useful for some users who build IBus from the source codes and check
-+the configurations. Currently the sub-command supports GTK applications only
-+and the default is GTK3. If you wish to check a GTK4 application, you can
-+specify
-+.B \-\-type=gtk4
-+option and you can choose one of "gtk2", "gtk3" and "gtk4".
-
- .SH BUGS
- If you find a bug, please report it at https://github.com/ibus/ibus/issues
-diff --git a/tools/ibusimmodule.c b/tools/ibusimmodule.c
-new file mode 100644
-index 00000000..20ccc748
---- /dev/null
-+++ b/tools/ibusimmodule.c
-@@ -0,0 +1,87 @@
-+#include <glib.h>
-+#include <glib/gi18n-lib.h>
-+#include <dlfcn.h>
-+
-+#ifndef DEFAULT_IM_MODULE_TYPE
-+#define DEFAULT_IM_MODULE_TYPE "gtk3"
-+#endif
-+
-+#define OPTION_TYPE_MESSAGE \
-+ N_("Type im-module TYPE = \"gtk2\", \"gtk3\", \"gtk4\". Default is " \
-+ "\"gtk3\".")
-+
-+typedef const char * (* IBusIMGetContextIdFunc) (int *argc, char ***argv);
-+
-+static char *im_module_type;
-+
-+
-+char *
-+ibus_im_module_get_id (int argc, char *argv[])
-+{
-+ static const GOptionEntry options[3] = {
-+ { "type", (char)0, (int)0, G_OPTION_ARG_STRING, &im_module_type,
-+ OPTION_TYPE_MESSAGE,
-+ "TYPE"},
-+ { NULL }
-+ };
-+ GOptionContext *option;
-+ GError *error = NULL;
-+ void *module;
-+ char *im_context_id;
-+ IBusIMGetContextIdFunc im_get_context_id;
-+
-+ if (!(option = g_option_context_new (NULL))) {
-+ g_critical ("malloc GOptionContext is failed.");
-+ return NULL;
-+ }
-+ g_option_context_add_main_entries (option, options, GETTEXT_PACKAGE);
-+ g_option_context_parse (option, &argc, &argv, &error);
-+ if (error) {
-+ g_critical ("%s", error->message);
-+ g_clear_error (&error);
-+ return NULL;
-+ }
-+ g_option_context_free (option);
-+ if (!im_module_type)
-+ im_module_type = g_strdup (DEFAULT_IM_MODULE_TYPE);
-+
-+ if (G_LIKELY (!g_strcmp0 (im_module_type, "gtk3"))) {
-+ module = dlopen (GTK3_IM_MODULEDIR "/im-ibus.so",
-+ RTLD_LAZY);
-+ } else if (!g_strcmp0 (im_module_type, "gtk4")) {
-+ const char *module_path_env = g_getenv ("GTK_PATH");
-+ char *module_path;
-+ if (module_path_env) {
-+ module_path = g_build_filename (module_path_env,
-+ GTK4_IM_MODULEDIR "/libim-ibus.so",
-+ NULL);
-+ } else {
-+ module_path = g_strdup (GTK4_IM_MODULEDIR "/libim-ibus.so");
-+ }
-+ module = dlopen (module_path, RTLD_LAZY);
-+ g_free (module_path);
-+ } else if (!g_strcmp0 (im_module_type, "gtk2")) {
-+ module = dlopen (GTK2_IM_MODULEDIR "/im-ibus.so",
-+ RTLD_LAZY);
-+ } else {
-+ module = dlopen (im_module_type, RTLD_LAZY);
-+ }
-+ if (!module) {
-+ g_warning ("Not found module: %s", dlerror ());
-+ return NULL;
-+ }
-+
-+ im_get_context_id = dlsym (module, "im_get_context_id");
-+ if (!im_get_context_id) {
-+ g_warning ("Not found im_get_context_id: %s", dlerror ());
-+ dlclose (module);
-+ return NULL;
-+ }
-+
-+ im_context_id = strdup (im_get_context_id (&argc, &argv));
-+ dlclose (module);
-+ return im_context_id;
-+}
-+
-+#undef DEFAULT_IM_MODULE_TYPE
-+
-diff --git a/tools/ibusimmodule.h b/tools/ibusimmodule.h
-new file mode 100644
-index 00000000..e762a747
---- /dev/null
-+++ b/tools/ibusimmodule.h
-@@ -0,0 +1,36 @@
-+/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
-+/* vim:set et sts=4: */
-+/* ibus - The Input Bus
-+ * Copyright (C) 2022 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, write to the Free Software
-+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
-+ * USA
-+ */
-+
-+#ifndef __IBUS_IM_MODULE_CONTEXT_H_
-+#define __IBUS_IM_MODULE_CONTEXT_H_
-+
-+/**
-+ * ibus_im_module_get_id:
-+ * @argc: The length of argv
-+ * @argv: (array length=argc) (element-type utf8): argv from main()
-+ *
-+ * Retrieve im-module value from GTK instance.
-+ *
-+ * Returns: (nullable): im-module value.
-+ */
-+char * ibus_im_module_get_id (int argc, char *argv[]);
-+
-+#endif
-diff --git a/tools/main.vala b/tools/main.vala
-index 407eaf74..1fed2440 100644
---- a/tools/main.vala
-+++ b/tools/main.vala
-@@ -671,6 +671,15 @@ int emoji_dialog(string[] argv) {
- #endif
-
-
-+int read_im_module(string[] argv) {
-+ string? im_module = IBusIMModule.im_module_get_id(argv);
-+ if (im_module == null)
-+ return Posix.EXIT_FAILURE;
-+ print("%s\n".printf(im_module));
-+ return Posix.EXIT_SUCCESS;
-+}
-+
-+
- int print_help(string[] argv) {
- print_usage(stdout);
- return Posix.EXIT_SUCCESS;
-@@ -702,6 +711,8 @@ const CommandEntry commands[] = {
- #if EMOJI_DICT
- { "emoji", N_("Save emoji on dialog to clipboard"), emoji_dialog },
- #endif
-+ { "im-module", N_("Retrieve im-module value from GTK instance"),
-+ read_im_module },
- { "help", N_("Show this information"), print_help }
- };
-
---
-2.35.3
-
-From 7e42b437c901bb56ca2f776aad5fe65d0d8c246a Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:22:42 +0900
-Subject: [PATCH] client/gtk2: Implement new process_key_event for GTK4
-
----
- client/gtk2/ibusimcontext.c | 147 ++++++++++++++++++++++++++++++------
- src/ibustypes.h | 4 +
- 2 files changed, 127 insertions(+), 24 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index c7f23293..bc14df00 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -111,13 +111,13 @@ static guint _signal_delete_surrounding_id = 0;
- static guint _signal_retrieve_surrounding_id = 0;
-
- #if GTK_CHECK_VERSION (3, 98, 4)
--static gboolean _use_sync_mode = TRUE;
-+static char _use_sync_mode = 2;
- #else
- static const gchar *_no_snooper_apps = NO_SNOOPER_APPS;
- static gboolean _use_key_snooper = ENABLE_SNOOPER;
- static guint _key_snooper_id = 0;
-
--static gboolean _use_sync_mode = FALSE;
-+static char _use_sync_mode = 0;
- #endif
-
- static const gchar *_discard_password_apps = "";
-@@ -375,12 +375,15 @@ ibus_im_context_commit_event (IBusIMContext *ibusimcontext,
- return FALSE;
- }
-
--struct _ProcessKeyEventData {
-+typedef struct {
- GdkEvent *event;
- IBusIMContext *ibusimcontext;
--};
-+} ProcessKeyEventData;
-
--typedef struct _ProcessKeyEventData ProcessKeyEventData;
-+typedef struct {
-+ GMainLoop *loop;
-+ gboolean retval;
-+} ProcessKeyEventReplyData;
-
- static void
- _process_key_event_done (GObject *object,
-@@ -395,12 +398,12 @@ _process_key_event_done (GObject *object,
- IBusIMContext *ibusimcontext = data->ibusimcontext;
- #endif
- GError *error = NULL;
-+ gboolean retval;
-
- g_slice_free (ProcessKeyEventData, data);
-- gboolean retval = ibus_input_context_process_key_event_async_finish (
-- context,
-- res,
-- &error);
-+ retval = ibus_input_context_process_key_event_async_finish (context,
-+ res,
-+ &error);
-
- if (error != NULL) {
- g_warning ("Process Key Event failed: %s.", error->message);
-@@ -431,6 +434,27 @@ _process_key_event_done (GObject *object,
- #endif
- }
-
-+static void
-+_process_key_event_reply_done (GObject *object,
-+ GAsyncResult *res,
-+ gpointer user_data)
-+{
-+ IBusInputContext *context = (IBusInputContext *)object;
-+ ProcessKeyEventReplyData *data = (ProcessKeyEventReplyData *)user_data;
-+ GError *error = NULL;
-+ gboolean retval = ibus_input_context_process_key_event_async_finish (
-+ context,
-+ res,
-+ &error);
-+ if (error != NULL) {
-+ g_warning ("Process Key Event failed: %s.", error->message);
-+ g_error_free (error);
-+ }
-+ g_return_if_fail (data);
-+ data->retval = retval;
-+ g_main_loop_quit (data->loop);
-+}
-+
- static gboolean
- _process_key_event (IBusInputContext *context,
- #if GTK_CHECK_VERSION (3, 98, 4)
-@@ -462,13 +486,45 @@ _process_key_event (IBusInputContext *context,
- #endif
- keycode = hardware_keycode;
-
-- if (_use_sync_mode) {
-+ switch (_use_sync_mode) {
-+ case 1: {
- retval = ibus_input_context_process_key_event (context,
-+ keyval,
-+ keycode - 8,
-+ state);
-+ break;
-+ }
-+ case 2: {
-+ GMainLoop *loop = g_main_loop_new (NULL, TRUE);
-+ ProcessKeyEventReplyData *data = NULL;
-+
-+ if (loop)
-+ data = g_slice_new0 (ProcessKeyEventReplyData);
-+ if (!data) {
-+ g_warning ("Cannot wait for the reply of the process key event.");
-+ retval = ibus_input_context_process_key_event (context,
-+ keyval,
-+ keycode - 8,
-+ state);
-+ if (loop)
-+ g_main_loop_quit (loop);
-+ break;
-+ }
-+ data->loop = loop;
-+ ibus_input_context_process_key_event_async (context,
- keyval,
- keycode - 8,
-- state);
-+ state,
-+ -1,
-+ NULL,
-+ _process_key_event_reply_done,
-+ data);
-+ g_main_loop_run (loop);
-+ retval = data->retval;
-+ g_slice_free (ProcessKeyEventReplyData, data);
-+ break;
- }
-- else {
-+ default: {
- ProcessKeyEventData *data = g_slice_new0 (ProcessKeyEventData);
- #if GTK_CHECK_VERSION (3, 98, 4)
- data->event = gdk_event_ref (event);
-@@ -487,6 +543,7 @@ _process_key_event (IBusInputContext *context,
-
- retval = TRUE;
- }
-+ }
-
- /* GTK4 does not provide gtk_key_snooper_install() and also
- * GtkIMContextClass->filter_keypress() cannot send the updated
-@@ -676,24 +733,47 @@ _key_snooper_cb (GtkWidget *widget,
- #endif
-
- static gboolean
--_get_boolean_env(const gchar *name,
-- gboolean defval)
-+_get_boolean_env (const gchar *name,
-+ gboolean defval)
- {
- const gchar *value = g_getenv (name);
-
- if (value == NULL)
-- return defval;
-+ return defval;
-
- if (g_strcmp0 (value, "") == 0 ||
- g_strcmp0 (value, "0") == 0 ||
- g_strcmp0 (value, "false") == 0 ||
- g_strcmp0 (value, "False") == 0 ||
-- g_strcmp0 (value, "FALSE") == 0)
-- return FALSE;
-+ g_strcmp0 (value, "FALSE") == 0) {
-+ return FALSE;
-+ }
-
- return TRUE;
- }
-
-+static char
-+_get_char_env (const gchar *name,
-+ char defval)
-+{
-+ const gchar *value = g_getenv (name);
-+
-+ if (value == NULL)
-+ return defval;
-+
-+ if (g_strcmp0 (value, "") == 0 ||
-+ g_strcmp0 (value, "0") == 0 ||
-+ g_strcmp0 (value, "false") == 0 ||
-+ g_strcmp0 (value, "False") == 0 ||
-+ g_strcmp0 (value, "FALSE") == 0) {
-+ return 0;
-+ } else if (!g_strcmp0 (value, "2")) {
-+ return 2;
-+ }
-+
-+ return 1;
-+}
-+
- static void
- daemon_name_appeared (GDBusConnection *connection,
- const gchar *name,
-@@ -777,11 +857,11 @@ ibus_im_context_class_init (IBusIMContextClass *class)
- g_assert (_signal_retrieve_surrounding_id != 0);
-
- #if GTK_CHECK_VERSION (3, 98, 4)
-- _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", TRUE);
-+ _use_sync_mode = _get_char_env ("IBUS_ENABLE_SYNC_MODE", 2);
- #else
- _use_key_snooper = !_get_boolean_env ("IBUS_DISABLE_SNOOPER",
- !(ENABLE_SNOOPER));
-- _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", FALSE);
-+ _use_sync_mode = (char)_get_char_env ("IBUS_ENABLE_SYNC_MODE", 0);
- #endif
- _use_discard_password = _get_boolean_env ("IBUS_DISCARD_PASSWORD", FALSE);
-
-@@ -904,6 +984,8 @@ ibus_im_context_init (GObject *obj)
- #else
- ibusimcontext->caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS;
- #endif
-+ if (_use_sync_mode != 1)
-+ ibusimcontext->caps |= IBUS_CAP_SYNC_PROCESS_KEY;
-
- ibusimcontext->events_queue = g_queue_new ();
-
-@@ -1246,7 +1328,7 @@ ibus_im_context_reset (GtkIMContext *context)
- * IBus uses button-press-event instead until GTK is fixed.
- * https://gitlab.gnome.org/GNOME/gtk/issues/1534
- */
-- if (_use_sync_mode)
-+ if (_use_sync_mode == 1)
- ibus_im_context_clear_preedit_text (ibusimcontext);
- ibus_input_context_reset (ibusimcontext->ibuscontext);
- }
-@@ -1361,7 +1443,7 @@ ibus_im_context_set_client_window (GtkIMContext *context,
-
- if (ibusimcontext->client_window) {
- #if !GTK_CHECK_VERSION (3, 98, 4)
-- if (ibusimcontext->use_button_press_event && !_use_sync_mode)
-+ if (ibusimcontext->use_button_press_event && _use_sync_mode != 1)
- _connect_button_press_event (ibusimcontext, FALSE);
- #endif
- g_object_unref (ibusimcontext->client_window);
-@@ -1371,7 +1453,7 @@ ibus_im_context_set_client_window (GtkIMContext *context,
- if (client != NULL) {
- ibusimcontext->client_window = g_object_ref (client);
- #if !GTK_CHECK_VERSION (3, 98, 4)
-- if (!ibusimcontext->use_button_press_event && !_use_sync_mode)
-+ if (!ibusimcontext->use_button_press_event && _use_sync_mode != 1)
- _connect_button_press_event (ibusimcontext, TRUE);
- #endif
- }
-@@ -1993,7 +2075,7 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext,
- #if !GTK_CHECK_VERSION (3, 98, 4)
- if (!ibusimcontext->use_button_press_event &&
- mode == IBUS_ENGINE_PREEDIT_COMMIT &&
-- !_use_sync_mode) {
-+ _use_sync_mode != 1) {
- if (ibusimcontext->client_window) {
- _connect_button_press_event (ibusimcontext, TRUE);
- }
-@@ -2200,6 +2282,8 @@ _create_input_context_done (IBusBus *bus,
- static void
- _create_input_context (IBusIMContext *ibusimcontext)
- {
-+ gchar *prgname = g_strdup (g_get_prgname());
-+ gchar *client_name;
- IDEBUG ("%s", __FUNCTION__);
-
- g_assert (ibusimcontext->ibuscontext == NULL);
-@@ -2208,11 +2292,24 @@ _create_input_context (IBusIMContext *ibusimcontext)
-
- ibusimcontext->cancellable = g_cancellable_new ();
-
-+ if (!prgname)
-+ prgname = g_strdup_printf ("(%d)", getpid ());
-+ client_name = g_strdup_printf ("%s:%s",
-+#if GTK_CHECK_VERSION (3, 98, 4)
-+ "gtk4-im",
-+#elif GTK_CHECK_VERSION (2, 91, 0)
-+ "gtk3-im",
-+#else
-+ "gtk-im",
-+#endif
-+ prgname);
-+ g_free (prgname);
- ibus_bus_create_input_context_async (_bus,
-- "gtk-im", -1,
-+ client_name, -1,
- ibusimcontext->cancellable,
- (GAsyncReadyCallback)_create_input_context_done,
- g_object_ref (ibusimcontext));
-+ g_free (client_name);
- }
-
- /* Callback functions for slave context */
-@@ -2329,6 +2426,8 @@ _create_fake_input_context_done (IBusBus *bus,
- NULL);
-
- guint32 caps = IBUS_CAP_PREEDIT_TEXT | IBUS_CAP_FOCUS | IBUS_CAP_SURROUNDING_TEXT;
-+ if (_use_sync_mode != 1)
-+ caps |= IBUS_CAP_SYNC_PROCESS_KEY;
- ibus_input_context_set_capabilities (_fake_context, caps);
-
- /* focus in/out the fake context */
-diff --git a/src/ibustypes.h b/src/ibustypes.h
-index 60bcb92b..a8eee319 100644
---- a/src/ibustypes.h
-+++ b/src/ibustypes.h
-@@ -109,6 +109,9 @@ typedef enum
- * @IBUS_CAP_SURROUNDING_TEXT: Client can provide surround text,
- * or IME can handle surround text.
- * @IBUS_CAP_OSK: UI is owned by on-screen keyboard.
-+ * @IBUS_CAP_SYNC_PROCESS_KEY: Asynchronous process key events are not
-+ * supported and the ibus_engine_forward_key_event() should not be
-+ * used for the return value of #IBusEngine::process_key_event().
- *
- * Capability flags of UI.
- */
-@@ -120,6 +123,7 @@ typedef enum {
- IBUS_CAP_PROPERTY = 1 << 4,
- IBUS_CAP_SURROUNDING_TEXT = 1 << 5,
- IBUS_CAP_OSK = 1 << 6,
-+ IBUS_CAP_SYNC_PROCESS_KEY = 1 << 7,
- } IBusCapabilite;
-
- /**
---
-2.35.3
-
-From b14cab3753c6510a0a48eec673aa6eac89c793a1 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:22:45 +0900
-Subject: [PATCH] src/ibusengine: Add focus_in_id()/focus_out_id() class
- methods
-
-IBusEngine constructor now has a 'has-focus-id' property and if it's %TRUE,
-IBusEngine::focus_in_id()/focus_out_id() are called instaed of
-IBusEngine::focus_in()/focus_out() and the class method has an object_path
-argument for the unique input context ID and a client argument for
-the client application type likes ibus-gtk, ibus-gtk4, xim.
----
- bus/engineproxy.c | 304 +++++++++++++++++++++++++++++-----------
- bus/engineproxy.h | 12 +-
- bus/ibusimpl.c | 13 ++
- bus/ibusimpl.h | 13 +-
- bus/inputcontext.c | 50 +++++--
- src/ibusengine.c | 217 ++++++++++++++++++++++++++--
- src/ibusengine.h | 10 +-
- src/ibusmarshalers.list | 1 +
- 8 files changed, 505 insertions(+), 115 deletions(-)
-
-diff --git a/bus/engineproxy.c b/bus/engineproxy.c
-index 2d98995c..fd1f34fb 100644
---- a/bus/engineproxy.c
-+++ b/bus/engineproxy.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -59,6 +59,7 @@ struct _BusEngineProxy {
-
- /* cached properties */
- IBusPropList *prop_list;
-+ gboolean has_focus_id;
- };
-
- struct _BusEngineProxyClass {
-@@ -105,30 +106,35 @@ static IBusText *text_empty = NULL;
- static IBusPropList *prop_list_empty = NULL;
-
- /* functions prototype */
--static void bus_engine_proxy_set_property (BusEngineProxy *engine,
-- guint prop_id,
-- const GValue *value,
-- GParamSpec *pspec);
--static void bus_engine_proxy_get_property (BusEngineProxy *engine,
-- guint prop_id,
-- GValue *value,
-- GParamSpec *pspec);
-+static void bus_engine_proxy_set_property (BusEngineProxy *engine,
-+ guint prop_id,
-+ const GValue *value,
-+ GParamSpec *pspec);
-+static void bus_engine_proxy_get_property (BusEngineProxy *engine,
-+ guint prop_id,
-+ GValue *value,
-+ GParamSpec *pspec);
- static void bus_engine_proxy_real_register_properties
-- (BusEngineProxy *engine,
-- IBusPropList *prop_list);
-+ (BusEngineProxy *engine,
-+ IBusPropList *prop_list);
- static void bus_engine_proxy_real_update_property
-- (BusEngineProxy *engine,
-- IBusProperty *prop);
--static void bus_engine_proxy_real_destroy (IBusProxy *proxy);
--static void bus_engine_proxy_g_signal (GDBusProxy *proxy,
-- const gchar *sender_name,
-- const gchar *signal_name,
-- GVariant *parameters);
-+ (BusEngineProxy *engine,
-+ IBusProperty *prop);
-+static void bus_engine_proxy_real_destroy (IBusProxy *proxy);
-+static void bus_engine_proxy_g_signal (GDBusProxy *proxy,
-+ const gchar *sender_name,
-+ const gchar *signal_name,
-+ GVariant *parameters);
- static void bus_engine_proxy_initable_iface_init
-- (GInitableIface *initable_iface);
-+ (GInitableIface
-+ *initable_iface);
-+static void bus_engine_proxy_get_has_focus_id
-+ (BusEngineProxy *engine);
-
- G_DEFINE_TYPE_WITH_CODE (BusEngineProxy, bus_engine_proxy, IBUS_TYPE_PROXY,
-- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, bus_engine_proxy_initable_iface_init)
-+ G_IMPLEMENT_INTERFACE (
-+ G_TYPE_INITABLE,
-+ bus_engine_proxy_initable_iface_init)
- );
-
- static GInitableIface *parent_initable_iface = NULL;
-@@ -138,8 +144,10 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- {
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-
-- gobject_class->set_property = (GObjectSetPropertyFunc)bus_engine_proxy_set_property;
-- gobject_class->get_property = (GObjectGetPropertyFunc)bus_engine_proxy_get_property;
-+ gobject_class->set_property =
-+ (GObjectSetPropertyFunc)bus_engine_proxy_set_property;
-+ gobject_class->get_property =
-+ (GObjectGetPropertyFunc)bus_engine_proxy_get_property;
-
- class->register_properties = bus_engine_proxy_real_register_properties;
- class->update_property = bus_engine_proxy_real_update_property;
-@@ -147,8 +155,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- IBUS_PROXY_CLASS (class)->destroy = bus_engine_proxy_real_destroy;
- G_DBUS_PROXY_CLASS (class)->g_signal = bus_engine_proxy_g_signal;
-
-- parent_initable_iface =
-- (GInitableIface *)g_type_interface_peek (bus_engine_proxy_parent_class, G_TYPE_INITABLE);
-+ parent_initable_iface = (GInitableIface *)g_type_interface_peek (
-+ bus_engine_proxy_parent_class,
-+ G_TYPE_INITABLE);
-
- /* install properties */
- g_object_class_install_property (gobject_class,
-@@ -164,7 +173,9 @@ bus_engine_proxy_class_init (BusEngineProxyClass *class)
- G_PARAM_STATIC_NICK
- ));
-
-- /* install glib signals that will be sent when corresponding D-Bus signals are sent from an engine process. */
-+ /* install glib signals that will be sent when corresponding D-Bus signals
-+ * are sent from an engine process.
-+ */
- engine_signals[COMMIT_TEXT] =
- g_signal_new (I_("commit-text"),
- G_TYPE_FROM_CLASS (class),
-@@ -473,7 +484,8 @@ bus_engine_proxy_real_destroy (IBusProxy *proxy)
- engine->prop_list = NULL;
- }
-
-- IBUS_PROXY_CLASS (bus_engine_proxy_parent_class)->destroy ((IBusProxy *)engine);
-+ IBUS_PROXY_CLASS (bus_engine_proxy_parent_class)->destroy (
-+ (IBusProxy *)engine);
- }
-
- static void
-@@ -486,7 +498,8 @@ _g_object_unref_if_floating (gpointer instance)
- /**
- * bus_engine_proxy_g_signal:
- *
-- * Handle all D-Bus signals from the engine process. This function emits corresponding glib signal for the D-Bus signal.
-+ * Handle all D-Bus signals from the engine process. This function emits
-+ * corresponding glib signal for the D-Bus signal.
- */
- static void
- bus_engine_proxy_g_signal (GDBusProxy *proxy,
-@@ -522,7 +535,9 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- }
- }
-
-- /* Handle D-Bus signals with parameters. Deserialize them and emit a glib signal. */
-+ /* Handle D-Bus signals with parameters. Deserialize them and emit a glib
-+ * signal.
-+ */
- if (g_strcmp0 (signal_name, "CommitText") == 0) {
- GVariant *arg0 = NULL;
- g_variant_get (parameters, "(v)", &arg0);
-@@ -568,7 +583,8 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- gboolean visible = FALSE;
- guint mode = 0;
-
-- g_variant_get (parameters, "(vubu)", &arg0, &cursor_pos, &visible, &mode);
-+ g_variant_get (parameters, "(vubu)",
-+ &arg0, &cursor_pos, &visible, &mode);
- g_return_if_fail (arg0 != NULL);
-
- IBusText *text = IBUS_TEXT (ibus_serializable_deserialize (arg0));
-@@ -594,7 +610,11 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- g_variant_unref (arg0);
- g_return_if_fail (text != NULL);
-
-- g_signal_emit (engine, engine_signals[UPDATE_AUXILIARY_TEXT], 0, text, visible);
-+ g_signal_emit (engine,
-+ engine_signals[UPDATE_AUXILIARY_TEXT],
-+ 0,
-+ text,
-+ visible);
- _g_object_unref_if_floating (text);
- return;
- }
-@@ -606,11 +626,16 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- g_variant_get (parameters, "(vb)", &arg0, &visible);
- g_return_if_fail (arg0 != NULL);
-
-- IBusLookupTable *table = IBUS_LOOKUP_TABLE (ibus_serializable_deserialize (arg0));
-+ IBusLookupTable *table =
-+ IBUS_LOOKUP_TABLE (ibus_serializable_deserialize (arg0));
- g_variant_unref (arg0);
- g_return_if_fail (table != NULL);
-
-- g_signal_emit (engine, engine_signals[UPDATE_LOOKUP_TABLE], 0, table, visible);
-+ g_signal_emit (engine,
-+ engine_signals[UPDATE_LOOKUP_TABLE],
-+ 0,
-+ table,
-+ visible);
- _g_object_unref_if_floating (table);
- return;
- }
-@@ -620,11 +645,15 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-
-- IBusPropList *prop_list = IBUS_PROP_LIST (ibus_serializable_deserialize (arg0));
-+ IBusPropList *prop_list =
-+ IBUS_PROP_LIST (ibus_serializable_deserialize (arg0));
- g_variant_unref (arg0);
- g_return_if_fail (prop_list != NULL);
-
-- g_signal_emit (engine, engine_signals[REGISTER_PROPERTIES], 0, prop_list);
-+ g_signal_emit (engine,
-+ engine_signals[REGISTER_PROPERTIES],
-+ 0,
-+ prop_list);
- _g_object_unref_if_floating (prop_list);
- return;
- }
-@@ -634,7 +663,8 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy,
- g_variant_get (parameters, "(v)", &arg0);
- g_return_if_fail (arg0 != NULL);
-
-- IBusProperty *prop = IBUS_PROPERTY (ibus_serializable_deserialize (arg0));
-+ IBusProperty *prop =
-+ IBUS_PROPERTY (ibus_serializable_deserialize (arg0));
- g_variant_unref (arg0);
- g_return_if_fail (prop != NULL);
-
-@@ -665,26 +695,45 @@ bus_engine_proxy_new_internal (const gchar *path,
- IBusEngineDesc *desc,
- GDBusConnection *connection)
- {
-+ GDBusProxyFlags flags;
-+ BusEngineProxy *engine;
-+ BusIBusImpl *ibus = BUS_DEFAULT_IBUS;
-+ GHashTable *hash_table = NULL;
-+ EngineFocusCategory category = ENGINE_FOCUS_CATEGORY_NONE;
-+
- g_assert (path);
- g_assert (IBUS_IS_ENGINE_DESC (desc));
- g_assert (G_IS_DBUS_CONNECTION (connection));
-
-- GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
-- BusEngineProxy *engine =
-- (BusEngineProxy *) g_initable_new (BUS_TYPE_ENGINE_PROXY,
-- NULL,
-- NULL,
-- "desc", desc,
-- "g-connection", connection,
-- "g-interface-name", IBUS_INTERFACE_ENGINE,
-- "g-object-path", path,
-- "g-default-timeout", g_gdbus_timeout,
-- "g-flags", flags,
-- NULL);
-+ flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START;
-+ engine = (BusEngineProxy *) g_initable_new (
-+ BUS_TYPE_ENGINE_PROXY,
-+ NULL,
-+ NULL,
-+ "desc", desc,
-+ "g-connection", connection,
-+ "g-interface-name", IBUS_INTERFACE_ENGINE,
-+ "g-object-path", path,
-+ "g-default-timeout", g_gdbus_timeout,
-+ "g-flags", flags,
-+ NULL);
- const gchar *layout = ibus_engine_desc_get_layout (desc);
- if (layout != NULL && layout[0] != '\0') {
- engine->keymap = ibus_keymap_get (layout);
- }
-+ if (ibus)
-+ hash_table = bus_ibus_impl_get_engine_focus_id_table (ibus);
-+ if (hash_table) {
-+ category = (EngineFocusCategory)GPOINTER_TO_INT (
-+ g_hash_table_lookup (hash_table,
-+ ibus_engine_desc_get_name (desc)));
-+ if (category == ENGINE_FOCUS_CATEGORY_HAS_ID)
-+ engine->has_focus_id = TRUE;
-+ else if (category == ENGINE_FOCUS_CATEGORY_NO_ID)
-+ engine->has_focus_id = FALSE;
-+ else
-+ bus_engine_proxy_get_has_focus_id (engine);
-+ }
- return engine;
- }
-
-@@ -740,7 +789,8 @@ engine_proxy_new_data_free (EngineProxyNewData *data)
- /**
- * create_engine_ready_cb:
- *
-- * A callback function to be called when bus_factory_proxy_create_engine finishes.
-+ * A callback function to be called when bus_factory_proxy_create_engine
-+ * finishes.
- * Create an BusEngineProxy object and call the GAsyncReadyCallback.
- */
- static void
-@@ -775,8 +825,10 @@ create_engine_ready_cb (BusFactoryProxy *factory,
- /**
- * notify_factory_cb:
- *
-- * A callback function to be called when bus_component_start() emits "notify::factory" signal within 5 seconds.
-- * Call bus_factory_proxy_create_engine to create the engine proxy asynchronously.
-+ * A callback function to be called when bus_component_start() emits
-+ * "notify::factory" signal within 5 seconds.
-+ * Call bus_factory_proxy_create_engine to create the engine proxy
-+ * asynchronously.
- */
- static void
- notify_factory_cb (BusComponent *component,
-@@ -798,22 +850,25 @@ notify_factory_cb (BusComponent *component,
- data->handler_id = 0;
- }
-
-- /* We *have to* disconnect the cancelled_cb here, since g_dbus_proxy_call
-- * calls create_engine_ready_cb even if the proxy call is cancelled, and
-- * in this case, create_engine_ready_cb itself will return error using
-- * g_task_return_error(). */
-+ /* We *have to* disconnect the cancelled_cb here, since
-+ * g_dbus_proxy_call calls create_engine_ready_cb even if the proxy
-+ * call is cancelled, and in this case, create_engine_ready_cb itself
-+ * will return error using g_task_return_error().
-+ */
- if (data->cancellable && data->cancelled_handler_id != 0) {
-- g_cancellable_disconnect (data->cancellable, data->cancelled_handler_id);
-+ g_cancellable_disconnect (data->cancellable,
-+ data->cancelled_handler_id);
- data->cancelled_handler_id = 0;
- }
-
- /* Create engine from factory. */
-- bus_factory_proxy_create_engine (data->factory,
-- data->desc,
-- data->timeout,
-- data->cancellable,
-- (GAsyncReadyCallback) create_engine_ready_cb,
-- data);
-+ bus_factory_proxy_create_engine (
-+ data->factory,
-+ data->desc,
-+ data->timeout,
-+ data->cancellable,
-+ (GAsyncReadyCallback) create_engine_ready_cb,
-+ data);
- }
- /* If factory is NULL, we will continue wait for
- * factory notify signal or timeout */
-@@ -822,7 +877,8 @@ notify_factory_cb (BusComponent *component,
- /**
- * timeout_cb:
- *
-- * A callback function to be called when bus_component_start() does not emit "notify::factory" signal within 5 seconds.
-+ * A callback function to be called when bus_component_start() does not emit
-+ * "notify::factory" signal within 5 seconds.
- * Call the GAsyncReadyCallback and stop the 5 sec timer.
- */
- static gboolean
-@@ -927,16 +983,18 @@ bus_engine_proxy_new (IBusEngineDesc *desc,
- /* The factory is ready. We'll create the engine proxy directly. */
- g_object_ref (data->factory);
-
-- /* We don't have to connect to cancelled_cb here, since g_dbus_proxy_call
-- * calls create_engine_ready_cb even if the proxy call is cancelled, and
-- * in this case, create_engine_ready_cb itself can return error using
-- * g_task_return_error(). */
-- bus_factory_proxy_create_engine (data->factory,
-- data->desc,
-- timeout,
-- cancellable,
-- (GAsyncReadyCallback) create_engine_ready_cb,
-- data);
-+ /* We don't have to connect to cancelled_cb here, since
-+ * g_dbus_proxy_call calls create_engine_ready_cb even if the proxy
-+ * call is cancelled, and in this case, create_engine_ready_cb itself
-+ * can return error using g_task_return_error().
-+ */
-+ bus_factory_proxy_create_engine (
-+ data->factory,
-+ data->desc,
-+ timeout,
-+ cancellable,
-+ (GAsyncReadyCallback) create_engine_ready_cb,
-+ data);
- }
- }
-
-@@ -978,8 +1036,11 @@ bus_engine_proxy_process_key_event (BusEngineProxy *engine,
- {
- g_assert (BUS_IS_ENGINE_PROXY (engine));
-
-- if (keycode != 0 && bus_ibus_impl_is_use_sys_layout (BUS_DEFAULT_IBUS) == FALSE) {
-- /* Since use_sys_layout is false, we don't rely on XKB. Try to convert keyval from keycode by using our own mapping. */
-+ if (keycode != 0 &&
-+ bus_ibus_impl_is_use_sys_layout (BUS_DEFAULT_IBUS) == FALSE) {
-+ /* Since use_sys_layout is false, we don't rely on XKB. Try to convert
-+ * keyval from keycode by using our own mapping.
-+ */
- IBusKeymap *keymap = engine->keymap;
- if (keymap == NULL)
- keymap = BUS_DEFAULT_KEYMAP;
-@@ -1142,7 +1203,8 @@ void bus_engine_proxy_set_surrounding_text (BusEngineProxy *engine,
- g_strcmp0 (text->text, engine->surrounding_text->text) != 0 ||
- cursor_pos != engine->surrounding_cursor_pos ||
- anchor_pos != engine->selection_anchor_pos) {
-- GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text);
-+ GVariant *variant =
-+ ibus_serializable_serialize ((IBusSerializable *)text);
- if (engine->surrounding_text)
- g_object_unref (engine->surrounding_text);
- engine->surrounding_text = (IBusText *) g_object_ref_sink (text);
-@@ -1201,6 +1263,61 @@ bus_engine_proxy_set_content_type (BusEngineProxy *engine,
- g_variant_unref (content_type);
- }
-
-+static void
-+_get_has_focus_id_cb (GObject *object,
-+ GAsyncResult *res,
-+ gpointer user_data)
-+{
-+ GHashTable *hash_table = (GHashTable*)user_data;
-+ BusEngineProxy *engine;
-+ GError *error = NULL;
-+ GVariant *result;
-+
-+ g_return_if_fail (BUS_IS_ENGINE_PROXY (object));
-+ engine = BUS_ENGINE_PROXY (object);
-+ result = g_dbus_proxy_call_finish (G_DBUS_PROXY (object), res, &error);
-+
-+ if (result != NULL) {
-+ GVariant *variant = NULL;
-+ gpointer value;
-+ g_variant_get (result, "(v)", &variant);
-+ engine->has_focus_id = g_variant_get_boolean (variant);
-+ g_variant_unref (variant);
-+ g_variant_unref (result);
-+ value = GINT_TO_POINTER (engine->has_focus_id
-+ ? ENGINE_FOCUS_CATEGORY_HAS_ID
-+ : ENGINE_FOCUS_CATEGORY_NO_ID);
-+ g_hash_table_replace (
-+ hash_table,
-+ (gpointer)ibus_engine_desc_get_name (engine->desc),
-+ value);
-+ }
-+ g_hash_table_unref (hash_table);
-+}
-+
-+static void
-+bus_engine_proxy_get_has_focus_id (BusEngineProxy *engine)
-+{
-+ BusIBusImpl *ibus = BUS_DEFAULT_IBUS;
-+ GHashTable *hash_table;
-+
-+ g_assert (BUS_IS_ENGINE_PROXY (engine));
-+ g_assert (ibus);
-+
-+ hash_table = bus_ibus_impl_get_engine_focus_id_table (ibus);
-+ g_assert (hash_table);
-+ g_dbus_proxy_call ((GDBusProxy *) engine,
-+ "org.freedesktop.DBus.Properties.Get",
-+ g_variant_new ("(ss)",
-+ IBUS_INTERFACE_ENGINE,
-+ "FocusId"),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL,
-+ _get_has_focus_id_cb,
-+ g_hash_table_ref (hash_table));
-+}
-+
- /* a macro to generate a function to call a nullary D-Bus method. */
- #define DEFINE_FUNCTION(Name, name) \
- void \
-@@ -1223,11 +1340,24 @@ DEFINE_FUNCTION (CursorDown, cursor_down)
- #undef DEFINE_FUNCTION
-
- void
--bus_engine_proxy_focus_in (BusEngineProxy *engine)
-+bus_engine_proxy_focus_in (BusEngineProxy *engine,
-+ const gchar *object_path,
-+ const gchar *client)
- {
- g_assert (BUS_IS_ENGINE_PROXY (engine));
-- if (!engine->has_focus) {
-- engine->has_focus = TRUE;
-+ if (engine->has_focus)
-+ return;
-+ engine->has_focus = TRUE;
-+ if (engine->has_focus_id) {
-+ g_dbus_proxy_call ((GDBusProxy *)engine,
-+ "FocusInId",
-+ g_variant_new ("(ss)", object_path, client),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL,
-+ NULL,
-+ NULL);
-+ } else {
- g_dbus_proxy_call ((GDBusProxy *)engine,
- "FocusIn",
- NULL,
-@@ -1240,11 +1370,23 @@ bus_engine_proxy_focus_in (BusEngineProxy *engine)
- }
-
- void
--bus_engine_proxy_focus_out (BusEngineProxy *engine)
-+bus_engine_proxy_focus_out (BusEngineProxy *engine,
-+ const gchar *object_path)
- {
- g_assert (BUS_IS_ENGINE_PROXY (engine));
-- if (engine->has_focus) {
-- engine->has_focus = FALSE;
-+ if (!engine->has_focus)
-+ return;
-+ engine->has_focus = FALSE;
-+ if (engine->has_focus_id) {
-+ g_dbus_proxy_call ((GDBusProxy *)engine,
-+ "FocusOutId",
-+ g_variant_new ("(s)", object_path),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL,
-+ NULL,
-+ NULL);
-+ } else {
- g_dbus_proxy_call ((GDBusProxy *)engine,
- "FocusOut",
- NULL,
-diff --git a/bus/engineproxy.h b/bus/engineproxy.h
-index a3006b47..957b7851 100644
---- a/bus/engineproxy.h
-+++ b/bus/engineproxy.h
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara@gmail.com>
-+ * Copyright (C) 2018-2022 Takao Fujiwara <takao.fujiwara@gmail.com>
- * Copyright (C) 2008-2018 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -126,20 +126,26 @@ void bus_engine_proxy_set_cursor_location
- /**
- * bus_engine_proxy_focus_in:
- * @engine: A #BusEngineProxy.
-+ * @object_path: An object path.
-+ * @client: A client name.
- *
- * Call "FocusIn" method of an engine asynchronously. Do nothing if
- * the engine already has a focus.
- */
--void bus_engine_proxy_focus_in (BusEngineProxy *engine);
-+void bus_engine_proxy_focus_in (BusEngineProxy *engine,
-+ const gchar *object_path,
-+ const gchar *client);
-
- /**
- * bus_engine_proxy_focus_out:
- * @engine: A #BusEngineProxy.
-+ * @object_path: An object path.
- *
- * Call "FocusOut" method of an engine asynchronously. Do nothing if
- * the engine does not have a focus.
- */
--void bus_engine_proxy_focus_out (BusEngineProxy *engine);
-+void bus_engine_proxy_focus_out (BusEngineProxy *engine,
-+ const gchar *object_path);
-
- /**
- * bus_engine_proxy_reset:
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 49a138fe..8a443545 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -72,6 +72,8 @@ struct _BusIBusImpl {
- * IBusEngineDesc object. */
- GHashTable *engine_table;
-
-+ GHashTable *engine_focus_id_table;
-+
- BusInputContext *focused_context;
- BusPanelProxy *panel;
- BusPanelProxy *emoji_extension;
-@@ -596,6 +598,7 @@ bus_ibus_impl_init (BusIBusImpl *ibus)
- ibus->use_global_engine = TRUE;
- ibus->global_engine_name = NULL;
- ibus->global_previous_engine_name = NULL;
-+ ibus->engine_focus_id_table = g_hash_table_new (g_str_hash, g_str_equal);
-
- /* focus the fake_context, if use_global_engine is enabled. */
- if (ibus->use_global_engine)
-@@ -2384,3 +2387,13 @@ bus_ibus_impl_get_focused_input_context (BusIBusImpl *ibus)
-
- return ibus->focused_context;
- }
-+
-+GHashTable *
-+bus_ibus_impl_get_engine_focus_id_table (BusIBusImpl *ibus)
-+{
-+
-+ g_assert (BUS_IS_IBUS_IMPL (ibus));
-+
-+ return ibus->engine_focus_id_table;
-+}
-+
-diff --git a/bus/ibusimpl.h b/bus/ibusimpl.h
-index 0bb18daf..cbe6856d 100644
---- a/bus/ibusimpl.h
-+++ b/bus/ibusimpl.h
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2022 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
-@@ -58,6 +59,13 @@ G_BEGIN_DECLS
- typedef struct _BusIBusImpl BusIBusImpl;
- typedef struct _BusIBusImplClass BusIBusImplClass;
-
-+typedef enum
-+{
-+ ENGINE_FOCUS_CATEGORY_NONE = 0,
-+ ENGINE_FOCUS_CATEGORY_NO_ID,
-+ ENGINE_FOCUS_CATEGORY_HAS_ID
-+} EngineFocusCategory;
-+
- GType bus_ibus_impl_get_type (void);
-
- /**
-@@ -81,6 +89,7 @@ gboolean bus_ibus_impl_is_embed_preedit_text
- (BusIBusImpl *ibus);
- BusInputContext *bus_ibus_impl_get_focused_input_context
- (BusIBusImpl *ibus);
--
-+GHashTable *bus_ibus_impl_get_engine_focus_id_table
-+ (BusIBusImpl *ibus);
- G_END_DECLS
- #endif
-diff --git a/bus/inputcontext.c b/bus/inputcontext.c
-index 8d84fd05..72041ecb 100644
---- a/bus/inputcontext.c
-+++ b/bus/inputcontext.c
-@@ -846,7 +846,8 @@ _ic_process_key_event_reply_cb (GObject *source,
- /**
- * _ic_process_key_event:
- *
-- * Implement the "ProcessKeyEvent" method call of the org.freedesktop.IBus.InputContext interface.
-+ * Implement the "ProcessKeyEvent" method call of the
-+ * org.freedesktop.IBus.InputContext interface.
- */
- static void
- _ic_process_key_event (BusInputContext *context,
-@@ -860,11 +861,13 @@ _ic_process_key_event (BusInputContext *context,
- g_variant_get (parameters, "(uuu)", &keyval, &keycode, &modifiers);
- if (G_UNLIKELY (!context->has_focus)) {
- /* workaround: set focus if context does not have focus */
-- BusInputContext *focused_context = bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS);
-+ BusInputContext *focused_context =
-+ bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS);
- if (focused_context == NULL ||
- focused_context->fake == TRUE ||
- context->fake == FALSE) {
-- /* grab focus, if context is a real IC or current focused IC is fake */
-+ /* grab focus, if context is a real IC or current focused IC is
-+ * fake */
- bus_input_context_focus_in (context);
- }
- }
-@@ -914,7 +917,8 @@ _ic_process_key_event (BusInputContext *context,
- data);
- }
- else {
-- g_dbus_method_invocation_return_value (invocation, g_variant_new ("(b)", FALSE));
-+ g_dbus_method_invocation_return_value (invocation,
-+ g_variant_new ("(b)", FALSE));
- }
- }
-
-@@ -1438,7 +1442,9 @@ bus_input_context_focus_in (BusInputContext *context)
- context->prev_modifiers = 0;
-
- if (context->engine) {
-- bus_engine_proxy_focus_in (context->engine);
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
-+ bus_engine_proxy_focus_in (context->engine, path, context->client);
- bus_engine_proxy_enable (context->engine);
- bus_engine_proxy_set_capabilities (context->engine, context->capabilities);
- bus_engine_proxy_set_cursor_location (context->engine, context->x, context->y, context->w, context->h);
-@@ -1538,7 +1544,9 @@ bus_input_context_focus_out (BusInputContext *context)
- bus_input_context_register_properties (context, props_empty);
-
- if (context->engine) {
-- bus_engine_proxy_focus_out (context->engine);
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
-+ bus_engine_proxy_focus_out (context->engine, path);
- }
-
- context->has_focus = FALSE;
-@@ -2376,11 +2384,19 @@ bus_input_context_enable (BusInputContext *context)
- if (context->engine == NULL)
- return;
-
-- bus_engine_proxy_focus_in (context->engine);
-- bus_engine_proxy_enable (context->engine);
-- bus_engine_proxy_set_capabilities (context->engine, context->capabilities);
-- bus_engine_proxy_set_cursor_location (context->engine, context->x, context->y, context->w, context->h);
-- bus_engine_proxy_set_content_type (context->engine, context->purpose, context->hints);
-+ {
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
-+ bus_engine_proxy_focus_in (context->engine, path, context->client);
-+ bus_engine_proxy_enable (context->engine);
-+ bus_engine_proxy_set_capabilities (context->engine,
-+ context->capabilities);
-+ bus_engine_proxy_set_cursor_location (context->engine,
-+ context->x, context->y,
-+ context->w, context->h);
-+ bus_engine_proxy_set_content_type (context->engine,
-+ context->purpose, context->hints);
-+ }
- }
-
- void
-@@ -2397,7 +2413,9 @@ bus_input_context_disable (BusInputContext *context)
- bus_input_context_register_properties (context, props_empty);
-
- if (context->engine) {
-- bus_engine_proxy_focus_out (context->engine);
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
-+ bus_engine_proxy_focus_out (context->engine, path);
- bus_engine_proxy_disable (context->engine);
- }
- }
-@@ -2445,6 +2463,8 @@ bus_input_context_unset_engine (BusInputContext *context)
-
- if (context->engine) {
- gint i;
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
- /* uninstall signal handlers for the engine. */
- for (i = 0; i < G_N_ELEMENTS(engine_signals); i++) {
- g_signal_handlers_disconnect_by_func (context->engine,
-@@ -2453,7 +2473,7 @@ bus_input_context_unset_engine (BusInputContext *context)
- /* focus out engine so that the next call of
- bus_engine_proxy_focus_in() will take effect and trigger
- RegisterProperties. */
-- bus_engine_proxy_focus_out (context->engine);
-+ bus_engine_proxy_focus_out (context->engine, path);
- g_object_unref (context->engine);
- context->engine = NULL;
- }
-@@ -2488,7 +2508,9 @@ bus_input_context_set_engine (BusInputContext *context,
- context);
- }
- if (context->has_focus) {
-- bus_engine_proxy_focus_in (context->engine);
-+ const gchar *path =
-+ ibus_service_get_object_path ((IBusService *)context);
-+ bus_engine_proxy_focus_in (context->engine, path, context->client);
- bus_engine_proxy_enable (context->engine);
- bus_engine_proxy_set_capabilities (context->engine, context->capabilities);
- bus_engine_proxy_set_cursor_location (context->engine, context->x, context->y, context->w, context->h);
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index 7e844838..7c797103 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2021 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -37,7 +37,9 @@
- enum {
- PROCESS_KEY_EVENT,
- FOCUS_IN,
-+ FOCUS_IN_ID,
- FOCUS_OUT,
-+ FOCUS_OUT_ID,
- RESET,
- ENABLE,
- DISABLE,
-@@ -61,6 +63,7 @@ enum {
- enum {
- PROP_0,
- PROP_ENGINE_NAME,
-+ PROP_HAS_FOCUS_ID,
- };
-
-
-@@ -82,6 +85,7 @@ struct _IBusEnginePrivate {
- GHashTable *extension_keybindings;
- gboolean enable_extension;
- gchar *current_extension_name;
-+ gboolean has_focus_id;
- };
-
-
-@@ -104,7 +108,8 @@ static void ibus_engine_service_method_call
- GDBusConnection *connection,
- const gchar *sender,
- const gchar *object_path,
-- const gchar *interface_name,
-+ const gchar
-+ *interface_name,
- const gchar *method_name,
- GVariant *parameters,
- GDBusMethodInvocation
-@@ -132,7 +137,12 @@ static gboolean ibus_engine_process_key_event
- guint keycode,
- guint state);
- static void ibus_engine_focus_in (IBusEngine *engine);
-+static void ibus_engine_focus_in_id (IBusEngine *engine,
-+ const gchar *object_path,
-+ const gchar *client);
- static void ibus_engine_focus_out (IBusEngine *engine);
-+static void ibus_engine_focus_out_id (IBusEngine *engine,
-+ const gchar *object_path);
- static void ibus_engine_reset (IBusEngine *engine);
- static void ibus_engine_enable (IBusEngine *engine);
- static void ibus_engine_disable (IBusEngine *engine);
-@@ -170,7 +180,8 @@ static void ibus_engine_set_surrounding_text
- static void ibus_engine_process_hand_writing_event
- (IBusEngine *engine,
- const gdouble *coordinates,
-- guint coordinates_len);
-+ guint
-+ coordinates_len);
- static void ibus_engine_cancel_hand_writing
- (IBusEngine *engine,
- guint n_strokes);
-@@ -230,7 +241,15 @@ static const gchar introspection_xml[] =
- " <arg direction='in' type='u' name='state' />"
- " </method>"
- " <method name='FocusIn' />"
-+ " <method name='FocusInId'>"
-+ " <arg direction='in' type='s' name='object_path' />"
-+ " <arg direction='in' type='s' name='client' />"
-+ " </method>"
-+ " <method name='FocusIn' />"
- " <method name='FocusOut' />"
-+ " <method name='FocusOutId'>"
-+ " <arg direction='in' type='s' name='object_path' />"
-+ " </method>"
- " <method name='Reset' />"
- " <method name='Enable' />"
- " <method name='Disable' />"
-@@ -283,6 +302,7 @@ static const gchar introspection_xml[] =
- " </signal>"
- /* FIXME properties */
- " <property name='ContentType' type='(uu)' access='write' />"
-+ " <property name='FocusId' type='(b)' access='read' />"
- " </interface>"
- "</node>";
-
-@@ -324,7 +344,9 @@ ibus_engine_class_init (IBusEngineClass *class)
-
- class->process_key_event = ibus_engine_process_key_event;
- class->focus_in = ibus_engine_focus_in;
-+ class->focus_in_id = ibus_engine_focus_in_id;
- class->focus_out = ibus_engine_focus_out;
-+ class->focus_out_id = ibus_engine_focus_out_id;
- class->reset = ibus_engine_reset;
- class->enable = ibus_engine_enable;
- class->disable = ibus_engine_disable;
-@@ -360,6 +382,15 @@ ibus_engine_class_init (IBusEngineClass *class)
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS));
-
-+ g_object_class_install_property (gobject_class,
-+ PROP_HAS_FOCUS_ID,
-+ g_param_spec_boolean ("has-focus-id",
-+ "has focus id",
-+ "Has focus ID",
-+ FALSE,
-+ G_PARAM_READWRITE |
-+ G_PARAM_CONSTRUCT_ONLY));
-+
- /* install signals */
- /**
- * IBusEngine::process-key-event:
-@@ -378,7 +409,8 @@ ibus_engine_class_init (IBusEngineClass *class)
- * Returns: %TRUE for successfully process the key; %FALSE otherwise.
- * See also: ibus_input_context_process_key_event().
- *
-- * <note><para>Argument @user_data is ignored in this function.</para></note>
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
- */
- engine_signals[PROCESS_KEY_EVENT] =
- g_signal_new (I_("process-key-event"),
-@@ -402,7 +434,8 @@ ibus_engine_class_init (IBusEngineClass *class)
- * in extended class to receive this signal.
- *
- * See also: ibus_input_context_focus_in()
-- * <note><para>Argument @user_data is ignored in this function.</para></note>
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
- */
- engine_signals[FOCUS_IN] =
- g_signal_new (I_("focus-in"),
-@@ -414,6 +447,58 @@ ibus_engine_class_init (IBusEngineClass *class)
- G_TYPE_NONE,
- 0);
-
-+ /**
-+ * IBusEngine::focus-in-id:
-+ * @engine: An IBusEngine.
-+ * @object_path: An object path.
-+ * @client: An client name.
-+ *
-+ * Emitted when the client application get the focus.
-+ * Implement the member function IBusEngineClass::focus_in
-+ * in extended class to receive this signal.
-+ * @object_path is a unique id by input context.
-+ * @client indicates a client type:
-+ * 'fake': focus is on desktop background or other programs where no
-+ * input is possible
-+ * 'xim': old X11 programs like xterm, emacs, ...
-+ * GTK3 programs in a Gnome Xorg session when GTK_IM_MODULE
-+ * is unset also use xim
-+ * 'gtk-im:<client-name>': Gtk2 input module is used
-+ * 'gtk3-im:<client-name>': Gtk3 input module is used
-+ * 'gtk4-im:<client-name>': Gtk4 input module is used
-+ * In case of the Gtk input modules, the name of the
-+ * client is also shown after the “:”, for example
-+ * like 'gtk3-im:firefox', 'gtk4-im:gnome-text-editor', …
-+ * 'gnome-shell': Entries handled by gnome-shell
-+ * (like the command line dialog opened with Alt+F2
-+ * or the search field when pressing the Super key.)
-+ * When GTK_IM_MODULE is unset in a Gnome Wayland session
-+ * all programs which would show 'gtk3-im' or 'gtk4-im'
-+ * with GTK_IM_MODULE=ibus then show 'gnome-shell'
-+ * instead.
-+ * 'Qt': Qt4 programs like keepassx-2.0.3 …
-+ * 'QIBusInputContext': Qt5 programs like keepassxc-2.7.1, anki-2.1.15
-+ * telegram-desktop-3.7.3,
-+ *
-+ * You need to set #IBusEngine::has-focus-id property to %TRUE when you
-+ * construct an #IBusEngine to use this class method.
-+ *
-+ * See also: ibus_input_context_focus_in()
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
-+ */
-+ engine_signals[FOCUS_IN_ID] =
-+ g_signal_new (I_("focus-in-id"),
-+ G_TYPE_FROM_CLASS (gobject_class),
-+ G_SIGNAL_RUN_LAST,
-+ G_STRUCT_OFFSET (IBusEngineClass, focus_in_id),
-+ NULL, NULL,
-+ _ibus_marshal_VOID__STRING_STRING,
-+ G_TYPE_NONE,
-+ 2,
-+ G_TYPE_STRING,
-+ G_TYPE_STRING);
-+
- /**
- * IBusEngine::focus-out:
- * @engine: An IBusEngine.
-@@ -423,7 +508,8 @@ ibus_engine_class_init (IBusEngineClass *class)
- * in extended class to receive this signal.
- *
- * See also: ibus_input_context_focus_out()
-- * <note><para>Argument @user_data is ignored in this function.</para></note>
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
- */
- engine_signals[FOCUS_OUT] =
- g_signal_new (I_("focus-out"),
-@@ -435,6 +521,33 @@ ibus_engine_class_init (IBusEngineClass *class)
- G_TYPE_NONE,
- 0);
-
-+ /**
-+ * IBusEngine::focus-out-id:
-+ * @engine: An IBusEngine.
-+ * @object_path: An object path.
-+ *
-+ * Emitted when the client application lost the focus.
-+ * Implement the member function IBusEngineClass::focus_out
-+ * in extended class to receive this signal.
-+ * @object_path is a unique id by input context.
-+ * You need to set #IBusEngine::has-focus-id property to %TRUE when you
-+ * construct an #IBusEngine to use this class method.
-+ *
-+ * See also: ibus_input_context_focus_out()
-+ * <note><para>Argument @user_data is ignored in this function.</para>
-+ * </note>
-+ */
-+ engine_signals[FOCUS_OUT_ID] =
-+ g_signal_new (I_("focus-out-id"),
-+ G_TYPE_FROM_CLASS (gobject_class),
-+ G_SIGNAL_RUN_LAST,
-+ G_STRUCT_OFFSET (IBusEngineClass, focus_out_id),
-+ NULL, NULL,
-+ _ibus_marshal_VOID__STRING,
-+ G_TYPE_NONE,
-+ 1,
-+ G_TYPE_STRING);
-+
- /**
- * IBusEngine::reset:
- * @engine: An IBusEngine.
-@@ -872,6 +985,9 @@ ibus_engine_set_property (IBusEngine *engine,
- case PROP_ENGINE_NAME:
- engine->priv->engine_name = g_value_dup_string (value);
- break;
-+ case PROP_HAS_FOCUS_ID:
-+ engine->priv->has_focus_id = g_value_get_boolean (value);
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (engine, prop_id, pspec);
- }
-@@ -887,7 +1003,9 @@ ibus_engine_get_property (IBusEngine *engine,
- case PROP_ENGINE_NAME:
- g_value_set_string (value, engine->priv->engine_name);
- break;
--
-+ case PROP_HAS_FOCUS_ID:
-+ g_value_set_boolean (value, engine->priv->has_focus_id);
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (engine, prop_id, pspec);
- }
-@@ -1176,6 +1294,30 @@ ibus_engine_service_method_call (IBusService *service,
- }
- }
-
-+ if (g_strcmp0 (method_name, "FocusInId") == 0) {
-+ gchar *object_path = NULL;
-+ gchar *client = NULL;
-+ g_variant_get (parameters, "(&s&s)", &object_path, &client);
-+ g_signal_emit (engine,
-+ engine_signals[FOCUS_IN_ID],
-+ 0,
-+ object_path,
-+ client);
-+ g_dbus_method_invocation_return_value (invocation, NULL);
-+ return;
-+ }
-+
-+ if (g_strcmp0 (method_name, "FocusOutId") == 0) {
-+ gchar *object_path = NULL;
-+ g_variant_get (parameters, "(&s)", &object_path);
-+ g_signal_emit (engine,
-+ engine_signals[FOCUS_OUT_ID],
-+ 0,
-+ object_path);
-+ g_dbus_method_invocation_return_value (invocation, NULL);
-+ return;
-+ }
-+
- if (g_strcmp0 (method_name, "CandidateClicked") == 0) {
- guint index, button, state;
- g_variant_get (parameters, "(uuu)", &index, &button, &state);
-@@ -1303,6 +1445,23 @@ ibus_engine_service_method_call (IBusService *service,
- g_return_if_reached ();
- }
-
-+/**
-+ * _ibus_engine_has_focus_id:
-+ *
-+ * Implement the "FocusId" method call of the org.freedesktop.IBus interface.
-+ */
-+static GVariant *
-+_ibus_engine_has_focus_id (IBusEngine *engine,
-+ GDBusConnection *connection,
-+ GError **error)
-+{
-+ if (error) {
-+ *error = NULL;
-+ }
-+
-+ return g_variant_new_boolean (engine->priv->has_focus_id);
-+}
-+
- static GVariant *
- ibus_engine_service_get_property (IBusService *service,
- GDBusConnection *connection,
-@@ -1312,7 +1471,18 @@ ibus_engine_service_get_property (IBusService *service,
- const gchar *property_name,
- GError **error)
- {
-- return IBUS_SERVICE_CLASS (ibus_engine_parent_class)->
-+ int i;
-+ static const struct {
-+ const gchar *method_name;
-+ GVariant * (* method_callback) (IBusEngine *,
-+ GDBusConnection *,
-+ GError **);
-+ } methods [] = {
-+ { "FocusId", _ibus_engine_has_focus_id },
-+ };
-+
-+ if (g_strcmp0 (interface_name, IBUS_INTERFACE_ENGINE) != 0) {
-+ return IBUS_SERVICE_CLASS (ibus_engine_parent_class)->
- service_get_property (service,
- connection,
- sender,
-@@ -1320,6 +1490,19 @@ ibus_engine_service_get_property (IBusService *service,
- interface_name,
- property_name,
- error);
-+ }
-+
-+ for (i = 0; i < G_N_ELEMENTS (methods); i++) {
-+ if (g_strcmp0 (methods[i].method_name, property_name) == 0) {
-+ return methods[i].method_callback ((IBusEngine *) service,
-+ connection,
-+ error);
-+ }
-+ }
-+
-+ g_warning ("service_get_property received an unknown property: %s",
-+ property_name ? property_name : "(null)");
-+ return NULL;
- }
-
- static gboolean
-@@ -1386,31 +1569,39 @@ ibus_engine_process_key_event (IBusEngine *engine,
- static void
- ibus_engine_focus_in (IBusEngine *engine)
- {
-- // g_debug ("focus-in");
-+}
-+
-+static void
-+ibus_engine_focus_in_id (IBusEngine *engine,
-+ const gchar *object_path,
-+ const gchar *client)
-+{
- }
-
- static void
- ibus_engine_focus_out (IBusEngine *engine)
- {
-- // g_debug ("focus-out");
-+}
-+
-+static void
-+ibus_engine_focus_out_id (IBusEngine *engine,
-+ const gchar *object_path)
-+{
- }
-
- static void
- ibus_engine_reset (IBusEngine *engine)
- {
-- // g_debug ("reset");
- }
-
- static void
- ibus_engine_enable (IBusEngine *engine)
- {
-- // g_debug ("enable");
- }
-
- static void
- ibus_engine_disable (IBusEngine *engine)
- {
-- // g_debug ("disable");
- }
-
- static void
-diff --git a/src/ibusengine.h b/src/ibusengine.h
-index 43eaa554..6af0e856 100644
---- a/src/ibusengine.h
-+++ b/src/ibusengine.h
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2012-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2022 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
-@@ -153,10 +154,15 @@ struct _IBusEngineClass {
- (IBusEngine *engine,
- guint purpose,
- guint hints);
-+ void (* focus_in_id) (IBusEngine *engine,
-+ const gchar *object_path,
-+ const gchar *client);
-+ void (* focus_out_id) (IBusEngine *engine,
-+ const gchar *object_path);
-
- /*< private >*/
- /* padding */
-- gpointer pdummy[4];
-+ gpointer pdummy[2];
- };
-
- GType ibus_engine_get_type (void);
-diff --git a/src/ibusmarshalers.list b/src/ibusmarshalers.list
-index aa9ea82a..7489f842 100644
---- a/src/ibusmarshalers.list
-+++ b/src/ibusmarshalers.list
-@@ -19,6 +19,7 @@ VOID:OBJECT,UINT,UINT
- VOID:OBJECT,BOOLEAN
- VOID:BOXED,BOOLEAN
- VOID:BOXED
-+VOID:STRING,STRING
- VOID:STRING,STRING,VARIANT
- VOID:STRING,STRING,STRING
- VOID:UINT
---
-2.35.3
-
-From 59c13597918db98ec8120ccdac09f1e2dc576e1b Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 7 Jul 2022 08:22:48 +0900
-Subject: [PATCH] src/tests: Unset G_MESSAGES_DEBUG for gsettings in
- xkb-latin-layouts
-
-gsettings cannot get the key value when G_MESSAGES_DEBUG is enabled.
-Add denylist.txt to engine/Makefile.am
----
- engine/Makefile.am | 3 ++-
- src/tests/xkb-latin-layouts | 7 +++++++
- 2 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/engine/Makefile.am b/engine/Makefile.am
-index 03867f52..7256fbc8 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-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2013-2021 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
-@@ -88,6 +88,7 @@ CLEANFILES = \
- $(NULL)
-
- EXTRA_DIST = \
-+ denylist.txt \
- gensimple.py \
- iso639converter.py \
- simple.xml.in \
-diff --git a/src/tests/xkb-latin-layouts b/src/tests/xkb-latin-layouts
-index f8dced6b..92464234 100755
---- a/src/tests/xkb-latin-layouts
-+++ b/src/tests/xkb-latin-layouts
-@@ -82,9 +82,16 @@ finit()
-
- test_xkb_keymaps()
- {
-+ # G_MESSAGES_DEBUG=all or G_MESSAGES_DEBUG=GLib-GIO-DEBUG would append
-+ # debug messages to gsettings output and could not get the result correctly.
-+ backup_G_MESSAGES_DEBUG="$G_MESSAGES_DEBUG"
-+ unset G_MESSAGES_DEBUG
- # Loop over top level schemas since "gsettings list-recursively" only
- # looks for direct children.
- xkb_latin_layouts=`gsettings get org.freedesktop.ibus.general xkb-latin-layouts`
-+ if [ x"$backup_G_MESSAGES_DEBUG" != x ] ; then
-+ export G_MESSAGES_DEBUG=$backup_G_MESSAGES_DEBUG
-+ fi
- while read keymap ; do
- eval keymap="$keymap"
- HAS_VARIANT=$($ECHO "$keymap" | grep '(' 2> /dev/null) ||:
---
-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
-
-From 53d8a826a62f2b43d7361f719fb72e26da8732f8 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 12 Aug 2022 11:41:16 +0900
-Subject: [PATCH] data/dconf: Revert Emoji shoftcut key to Super-space
-
-IBus provides the D-Bus method to override IBus emoji UI and i think
-Super-period is better than Ctrl-period for the emoji shortcut key to
-compare MS-Window, Macintosh. IBus emoji UI connects to the input method
-and provides the language emoji annotations.
-
-Seems moving GTK Cotrol-period to gnome-shell Suer-period is difficult
-at present.
-
-BUG=https://github.com/ibus/ibus/issues/2390
-BUG=https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5728
----
- 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 0ece2b4f..4d3b7ae2 100644
---- a/data/dconf/org.freedesktop.ibus.gschema.xml
-+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
-@@ -248,7 +248,7 @@
- <description>The shortcut keys for turning Unicode typing on or off</description>
- </key>
- <key name="hotkey" type="as">
-- <default>[ '<Control>period', '<Control>semicolon' ]</default>
-+ <default>[ '<Super>period' ]</default>
- <summary>Emoji shortcut keys for gtk_accelerator_parse</summary>
- <description>The shortcut keys for turning emoji typing on or off</description>
- </key>
---
-2.37.1
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:07 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : bd586f3b2dab6cbdc0fc640595e9b36a7539a10a
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2020-02-21T22:15:39+09:00
Stats : +0/-3384 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/bd586f3b2dab6cbdc0fc640595e9b36a7539a10a?branch=autotool
Log:
Delete upstreamed patches
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
deleted file mode 100644
index 9e83a36..0000000
--- a/ibus-HEAD.patch
+++ /dev/null
@@ -1,3384 +0,0 @@
-From fcb2187dd46d71031867f3bd43196c2448693469 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 6 Sep 2019 20:59:49 +0900
-Subject: [PATCH] src/tests: Replace push with cd for Posix SH
-
-BUG=https://github.com/ibus/ibus/issues/2124
-BUG=https://github.com/ibus/ibus/issues/2126
----
- src/tests/ibus-config.c | 2 +-
- src/tests/runtest | 5 +++--
- 2 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/src/tests/ibus-config.c b/src/tests/ibus-config.c
-index 9b925ad9..5e845f10 100644
---- a/src/tests/ibus-config.c
-+++ b/src/tests/ibus-config.c
-@@ -114,7 +114,7 @@ test_config_set_get (void)
- value_bits |= (1 << 1);
- }
- else {
-- g_warning ("unknow value name=%s", name);
-+ g_warning ("Unknown value name=%s", name);
- }
- ibus_config_unset (config, "test", name);
- g_variant_unref (value);
-diff --git a/src/tests/runtest b/src/tests/runtest
-index 1fcc9283..ed38992f 100755
---- a/src/tests/runtest
-+++ b/src/tests/runtest
-@@ -111,7 +111,8 @@ fi
- run_test_case()
- {
- test -d $tstdir || mkdir $tstdir
-- pushd $tstdir
-+ backup_dir=$PWD
-+ cd $tstdir
-
- need_bus=no
- for t in $BUS_REQUIRED_TESTS; do
-@@ -190,7 +191,7 @@ run_test_case()
-
- retval=`expr $retval \| $?`
-
-- popd
-+ cd $backup_dir
-
- func_cleanup $tstdir
- }
---
-2.21.0
-
-From 48a8d7ed58bdfb02c24c8039bae1cb15d4fc1bce Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 6 Sep 2019 21:24:24 +0900
-Subject: [PATCH] Delete deprecated g_type_class_add_private since glib 2.58
-
-G_DEFINE_TYPE_WITH_PRIVATE() and G_ADD_PRIVATE() have been available
-since 2.38.
-IBusService has custom GBaseInitFunc and GBaseFinalizeFunc in
-ibus_service_get_type() and implements ibus_service_private_offset
-and ibus_service_get_instance_private() directly without
-G_DEFINE_TYPE_WITH_PRIVATE().
----
- bus/ibusimpl.c | 7 +++---
- src/ibusbus.c | 8 +++---
- src/ibuscomponent.c | 10 ++++----
- src/ibusconfig.c | 9 +++----
- src/ibusemoji.c | 14 +++++------
- src/ibusengine.c | 10 +++-----
- src/ibusenginedesc.c | 10 ++++----
- src/ibusenginesimple.c | 8 +++---
- src/ibusfactory.c | 8 +++---
- src/ibushotkey.c | 55 ++++++++++++------------------------------
- src/ibusinputcontext.c | 12 ++++-----
- src/ibusobject.c | 8 +++---
- src/ibusobservedpath.c | 6 ++---
- src/ibusproperty.c | 8 +++---
- src/ibusregistry.c | 10 +++-----
- src/ibusserializable.c | 24 ++++++++++++++----
- src/ibusservice.c | 34 +++++++++++++++++++-------
- src/ibusunicode.c | 24 ++++++++----------
- src/ibusxevent.c | 22 ++++++++---------
- 19 files changed, 135 insertions(+), 152 deletions(-)
-
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index bbbb5770..39b16139 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2011-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -2180,7 +2180,8 @@ bus_ibus_impl_registry_destroy (BusIBusImpl *ibus)
-
- g_clear_pointer (&ibus->engine_table, g_hash_table_destroy);
-
-- g_clear_pointer (&ibus->registry, ibus_object_destroy);
-+ ibus_object_destroy (IBUS_OBJECT (ibus->registry));
-+ ibus->registry = NULL;
-
- if (ibus->extension_register_keys)
- g_clear_pointer (&ibus->extension_register_keys, g_variant_unref);
-diff --git a/src/ibusbus.c b/src/ibusbus.c
-index 09054851..0783e7bb 100644
---- a/src/ibusbus.c
-+++ b/src/ibusbus.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2016 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -36,7 +36,7 @@
- #include "ibusconfig.h"
-
- #define IBUS_BUS_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_BUS, IBusBusPrivate))
-+ ((IBusBusPrivate *)ibus_bus_get_instance_private (o))
-
- enum {
- CONNECTED,
-@@ -115,7 +115,7 @@ static void ibus_bus_get_property (IBusBus *bus,
-
- static void ibus_bus_close_connection (IBusBus *bus);
-
--G_DEFINE_TYPE (IBusBus, ibus_bus, IBUS_TYPE_OBJECT)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusBus, ibus_bus, IBUS_TYPE_OBJECT)
-
- static void
- ibus_bus_class_init (IBusBusClass *class)
-@@ -234,8 +234,6 @@ ibus_bus_class_init (IBusBusClass *class)
- G_TYPE_NONE,
- 3,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
--
-- g_type_class_add_private (class, sizeof (IBusBusPrivate));
- }
-
- static void
-diff --git a/src/ibuscomponent.c b/src/ibuscomponent.c
-index a933e79b..9837f47c 100644
---- a/src/ibuscomponent.c
-+++ b/src/ibuscomponent.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -58,7 +58,7 @@ struct _IBusComponentPrivate {
- };
-
- #define IBUS_COMPONENT_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_COMPONENT, IBusComponentPrivate))
-+ ((IBusComponentPrivate *)ibus_component_get_instance_private (o))
-
- // static guint _signals[LAST_SIGNAL] = { 0 };
-
-@@ -90,7 +90,9 @@ static void ibus_component_parse_observed_paths
- XMLNode *node,
- gboolean access_fs);
-
--G_DEFINE_TYPE (IBusComponent, ibus_component, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusComponent,
-+ ibus_component,
-+ IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_component_class_init (IBusComponentClass *class)
-@@ -99,8 +101,6 @@ ibus_component_class_init (IBusComponentClass *class)
- IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
- IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
-
-- g_type_class_add_private (class, sizeof (IBusComponentPrivate));
--
- gobject_class->set_property = (GObjectSetPropertyFunc) ibus_component_set_property;
- gobject_class->get_property = (GObjectGetPropertyFunc) ibus_component_get_property;
- object_class->destroy = (IBusObjectDestroyFunc) ibus_component_destroy;
-diff --git a/src/ibusconfig.c b/src/ibusconfig.c
-index 621a4e53..713fe251 100644
---- a/src/ibusconfig.c
-+++ b/src/ibusconfig.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -27,7 +27,7 @@
- #include "ibuserror.h"
-
- #define IBUS_CONFIG_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_CONFIG, IBusConfigPrivate))
-+ ((IBusConfigPrivate *)ibus_config_get_instance_private (o))
-
- enum {
- VALUE_CHANGED,
-@@ -65,6 +65,7 @@ static void _signal_unsubscribe (GDBusProxy *proxy,
- static void _remove_all_match_rules (IBusConfig *config);
-
- G_DEFINE_TYPE_WITH_CODE (IBusConfig, ibus_config, IBUS_TYPE_PROXY,
-+ G_ADD_PRIVATE (IBusConfig)
- G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, initable_iface_init)
- G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init)
- );
-@@ -75,8 +76,6 @@ ibus_config_class_init (IBusConfigClass *class)
- GDBusProxyClass *dbus_proxy_class = G_DBUS_PROXY_CLASS (class);
- IBusProxyClass *proxy_class = IBUS_PROXY_CLASS (class);
-
-- g_type_class_add_private (class, sizeof (IBusConfigPrivate));
--
- dbus_proxy_class->g_signal = ibus_config_g_signal;
- proxy_class->destroy = ibus_config_real_destroy;
-
-@@ -116,7 +115,7 @@ ibus_config_init (IBusConfig *config)
- static void
- ibus_config_real_destroy (IBusProxy *proxy)
- {
-- IBusConfigPrivate *priv = IBUS_CONFIG_GET_PRIVATE (proxy);
-+ IBusConfigPrivate *priv = IBUS_CONFIG_GET_PRIVATE (IBUS_CONFIG (proxy));
-
- _signal_unsubscribe (G_DBUS_PROXY (proxy), priv->watch_config_signal_id);
- _remove_all_match_rules (IBUS_CONFIG (proxy));
-diff --git a/src/ibusemoji.c b/src/ibusemoji.c
-index d56c48aa..ae8907a2 100644
---- a/src/ibusemoji.c
-+++ b/src/ibusemoji.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2017 Red Hat, Inc.
-+ * Copyright (C) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2017-2019 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
-@@ -47,9 +47,7 @@ struct _IBusEmojiDataPrivate {
- };
-
- #define IBUS_EMOJI_DATA_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
-- IBUS_TYPE_EMOJI_DATA, \
-- IBusEmojiDataPrivate))
-+ ((IBusEmojiDataPrivate *)ibus_emoji_data_get_instance_private (o))
-
- /* functions prototype */
- static void ibus_emoji_data_set_property (IBusEmojiData *emoji,
-@@ -68,7 +66,9 @@ static gint ibus_emoji_data_deserialize (IBusEmojiData *emoji,
- static gboolean ibus_emoji_data_copy (IBusEmojiData *emoji,
- const IBusEmojiData *src);
-
--G_DEFINE_TYPE (IBusEmojiData, ibus_emoji_data, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusEmojiData,
-+ ibus_emoji_data,
-+ IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_emoji_data_class_init (IBusEmojiDataClass *class)
-@@ -89,8 +89,6 @@ ibus_emoji_data_class_init (IBusEmojiDataClass *class)
- serializable_class->copy =
- (IBusSerializableCopyFunc) ibus_emoji_data_copy;
-
-- g_type_class_add_private (class, sizeof (IBusEmojiDataPrivate));
--
- /* install properties */
- /**
- * IBusEmojiData:emoji:
-diff --git a/src/ibusengine.c b/src/ibusengine.c
-index 7fb4e856..9aeafbf9 100644
---- a/src/ibusengine.c
-+++ b/src/ibusengine.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -32,7 +32,7 @@
- #include "ibusxevent.h"
-
- #define IBUS_ENGINE_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_ENGINE, IBusEnginePrivate))
-+ ((IBusEnginePrivate *)ibus_engine_get_instance_private (o))
-
- enum {
- PROCESS_KEY_EVENT,
-@@ -187,7 +187,7 @@ static void ibus_engine_dbus_property_changed
- GVariant *value);
-
-
--G_DEFINE_TYPE (IBusEngine, ibus_engine, IBUS_TYPE_SERVICE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusEngine, ibus_engine, IBUS_TYPE_SERVICE)
-
- static const gchar introspection_xml[] =
- "<node>"
-@@ -830,8 +830,6 @@ ibus_engine_class_init (IBusEngineClass *class)
- G_TYPE_UINT,
- G_TYPE_UINT);
-
-- g_type_class_add_private (class, sizeof (IBusEnginePrivate));
--
- text_empty = ibus_text_new_from_static_string ("");
- g_object_ref_sink (text_empty);
- }
-diff --git a/src/ibusenginedesc.c b/src/ibusenginedesc.c
-index 22622865..064588bd 100644
---- a/src/ibusenginedesc.c
-+++ b/src/ibusenginedesc.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2015 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -72,7 +72,7 @@ struct _IBusEngineDescPrivate {
- };
-
- #define IBUS_ENGINE_DESC_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_ENGINE_DESC, IBusEngineDescPrivate))
-+ ((IBusEngineDescPrivate *)ibus_engine_desc_get_instance_private (o))
-
- // static guint _signals[LAST_SIGNAL] = { 0 };
-
-@@ -95,7 +95,9 @@ static gboolean ibus_engine_desc_copy (IBusEngineDesc *des
- static gboolean ibus_engine_desc_parse_xml_node (IBusEngineDesc *desc,
- XMLNode *node);
-
--G_DEFINE_TYPE (IBusEngineDesc, ibus_engine_desc, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusEngineDesc,
-+ ibus_engine_desc,
-+ IBUS_TYPE_SERIALIZABLE)
-
-
- static void
-@@ -113,8 +115,6 @@ ibus_engine_desc_class_init (IBusEngineDescClass *class)
- serializable_class->deserialize = (IBusSerializableDeserializeFunc) ibus_engine_desc_deserialize;
- serializable_class->copy = (IBusSerializableCopyFunc) ibus_engine_desc_copy;
-
-- g_type_class_add_private (class, sizeof (IBusEngineDescPrivate));
--
- /* install properties */
- /**
- * IBusEngineDesc:name:
-diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
-index b623e149..43bd5283 100644
---- a/src/ibusenginesimple.c
-+++ b/src/ibusenginesimple.c
-@@ -45,7 +45,7 @@
-
- #define X11_DATADIR X11_DATA_PREFIX "/share/X11/locale"
- #define IBUS_ENGINE_SIMPLE_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_ENGINE_SIMPLE, IBusEngineSimplePrivate))
-+ ((IBusEngineSimplePrivate *)ibus_engine_simple_get_instance_private (o))
-
- #define SET_COMPOSE_BUFFER_ELEMENT_NEXT(buffer, index, value) { \
- if ((index) >= COMPOSE_BUFFER_SIZE && \
-@@ -150,7 +150,9 @@ static void ibus_engine_simple_commit_str (IBusEngineSimple *simple,
- static void ibus_engine_simple_update_preedit_text
- (IBusEngineSimple *simple);
-
--G_DEFINE_TYPE (IBusEngineSimple, ibus_engine_simple, IBUS_TYPE_ENGINE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusEngineSimple,
-+ ibus_engine_simple,
-+ IBUS_TYPE_ENGINE)
-
- static void
- ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
-@@ -170,8 +172,6 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
- engine_class->page_up = ibus_engine_simple_page_up;
- engine_class->candidate_clicked
- = ibus_engine_simple_candidate_clicked;
--
-- g_type_class_add_private (class, sizeof (IBusEngineSimplePrivate));
- }
-
- static void
-diff --git a/src/ibusfactory.c b/src/ibusfactory.c
-index e915c931..cb9b53cc 100644
---- a/src/ibusfactory.c
-+++ b/src/ibusfactory.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2015 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -26,7 +26,7 @@
- #include "ibusinternal.h"
-
- #define IBUS_FACTORY_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_FACTORY, IBusFactoryPrivate))
-+ ((IBusFactoryPrivate *)ibus_factory_get_instance_private (o))
-
- enum {
- CREATE_ENGINE,
-@@ -87,7 +87,7 @@ static void ibus_factory_engine_destroy_cb
- (IBusEngine *engine,
- IBusFactory *factory);
-
--G_DEFINE_TYPE (IBusFactory, ibus_factory, IBUS_TYPE_SERVICE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusFactory, ibus_factory, IBUS_TYPE_SERVICE)
-
- static const gchar introspection_xml[] =
- "<node>"
-@@ -158,8 +158,6 @@ ibus_factory_class_init (IBusFactoryClass *class)
-
- ibus_service_class_add_interfaces (IBUS_SERVICE_CLASS (class), introspection_xml);
-
-- g_type_class_add_private (class, sizeof (IBusFactoryPrivate));
--
- /**
- * IBusFactory::create-engine:
- * @factory: the factory which received the signal
-diff --git a/src/ibushotkey.c b/src/ibushotkey.c
-index 249ed5d2..d4ab7c23 100644
---- a/src/ibushotkey.c
-+++ b/src/ibushotkey.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -27,7 +27,7 @@
- #include "ibusshare.h"
-
- #define IBUS_HOTKEY_PROFILE_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_HOTKEY_PROFILE, IBusHotkeyProfilePrivate))
-+ ((IBusHotkeyProfilePrivate *)ibus_hotkey_profile_get_instance_private (o))
-
- enum {
- TRIGGER,
-@@ -79,7 +79,10 @@ static guint normalize_modifiers (guint key
- guint modifiers);
- static gboolean is_modifier (guint keyval);
-
--static IBusSerializableClass *parent_class = NULL;
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusHotkeyProfile,
-+ ibus_hotkey_profile,
-+ IBUS_TYPE_SERIALIZABLE)
-+
-
- static guint profile_signals[LAST_SIGNAL] = { 0 };
-
-@@ -141,43 +144,12 @@ ibus_hotkey_cmp_with_data (IBusHotkey *hotkey1,
-
-
-
--GType
--ibus_hotkey_profile_get_type (void)
--{
-- static GType type = 0;
--
-- static const GTypeInfo type_info = {
-- sizeof (IBusHotkeyProfileClass),
-- (GBaseInitFunc) NULL,
-- (GBaseFinalizeFunc) NULL,
-- (GClassInitFunc) ibus_hotkey_profile_class_init,
-- NULL, /* class finalize */
-- NULL, /* class data */
-- sizeof (IBusHotkeyProfile),
-- 0,
-- (GInstanceInitFunc) ibus_hotkey_profile_init,
-- };
--
-- if (type == 0) {
-- type = g_type_register_static (IBUS_TYPE_SERIALIZABLE,
-- "IBusHotkeyProfile",
-- &type_info,
-- 0);
-- }
--
-- return type;
--}
--
- static void
- ibus_hotkey_profile_class_init (IBusHotkeyProfileClass *class)
- {
- IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
- IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
-
-- parent_class = (IBusSerializableClass *) g_type_class_peek_parent (class);
--
-- g_type_class_add_private (class, sizeof (IBusHotkeyProfilePrivate));
--
- object_class->destroy = (IBusObjectDestroyFunc) ibus_hotkey_profile_destroy;
-
- serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_hotkey_profile_serialize;
-@@ -255,7 +227,8 @@ ibus_hotkey_profile_destroy (IBusHotkeyProfile *profile)
- priv->hotkeys = NULL;
- }
-
-- IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)profile);
-+ IBUS_OBJECT_CLASS (ibus_hotkey_profile_parent_class)->
-+ destroy ((IBusObject *)profile);
- }
-
- static gboolean
-@@ -264,7 +237,8 @@ ibus_hotkey_profile_serialize (IBusHotkeyProfile *profile,
- {
- gboolean retval;
-
-- retval = parent_class->serialize ((IBusSerializable *) profile, builder);
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_hotkey_profile_parent_class)->
-+ serialize ((IBusSerializable *) profile, builder);
- g_return_val_if_fail (retval, FALSE);
-
- return TRUE;
-@@ -276,7 +250,8 @@ ibus_hotkey_profile_deserialize (IBusHotkeyProfile *profile,
- {
- gint retval;
-
-- retval = parent_class->deserialize ((IBusSerializable *) profile, variant);
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_hotkey_profile_parent_class)->
-+ deserialize ((IBusSerializable *) profile, variant);
- g_return_val_if_fail (retval, 0);
-
- return retval;
-@@ -288,8 +263,8 @@ ibus_hotkey_profile_copy (IBusHotkeyProfile *dest,
- {
- gboolean retval;
-
-- retval = parent_class->copy ((IBusSerializable *)dest,
-- (IBusSerializable *)src);
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_hotkey_profile_parent_class)->
-+ copy ((IBusSerializable *)dest, (IBusSerializable *)src);
- g_return_val_if_fail (retval, FALSE);
-
- g_return_val_if_fail (IBUS_IS_HOTKEY_PROFILE (dest), FALSE);
-diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
-index a809ef08..2b1438fc 100644
---- a/src/ibusinputcontext.c
-+++ b/src/ibusinputcontext.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -31,7 +31,7 @@
- #include "ibuserror.h"
-
- #define IBUS_INPUT_CONTEXT_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_INPUT_CONTEXT, IBusInputContextPrivate))
-+ ((IBusInputContextPrivate *)ibus_input_context_get_instance_private (o))
-
- enum {
- ENABLED,
-@@ -83,7 +83,9 @@ static void ibus_input_context_g_signal (GDBusProxy *proxy,
- const gchar *signal_name,
- GVariant *parameters);
-
--G_DEFINE_TYPE (IBusInputContext, ibus_input_context, IBUS_TYPE_PROXY)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusInputContext,
-+ ibus_input_context,
-+ IBUS_TYPE_PROXY)
-
- static void
- ibus_input_context_class_init (IBusInputContextClass *class)
-@@ -91,8 +93,6 @@ ibus_input_context_class_init (IBusInputContextClass *class)
- IBusProxyClass *ibus_proxy_class = IBUS_PROXY_CLASS (class);
- GDBusProxyClass *g_dbus_proxy_class = G_DBUS_PROXY_CLASS (class);
-
-- g_type_class_add_private (class, sizeof (IBusInputContextPrivate));
--
- ibus_proxy_class->destroy = ibus_input_context_real_destroy;
-
- g_dbus_proxy_class->g_signal = ibus_input_context_g_signal;
-diff --git a/src/ibusobject.c b/src/ibusobject.c
-index 258048c0..15d9aa3a 100644
---- a/src/ibusobject.c
-+++ b/src/ibusobject.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -25,7 +25,7 @@
- #include "ibusinternal.h"
-
- #define IBUS_OBJECT_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_OBJECT, IBusObjectPrivate))
-+ ((IBusObjectPrivate *)ibus_object_get_instance_private (o))
-
- enum {
- DESTROY,
-@@ -53,7 +53,7 @@ static void ibus_object_dispose (IBusObject *obj);
- static void ibus_object_finalize (IBusObject *obj);
- static void ibus_object_real_destroy (IBusObject *obj);
-
--G_DEFINE_TYPE (IBusObject, ibus_object, G_TYPE_INITIALLY_UNOWNED)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusObject, ibus_object, G_TYPE_INITIALLY_UNOWNED)
-
- static void
- ibus_object_class_init (IBusObjectClass *class)
-@@ -86,8 +86,6 @@ ibus_object_class_init (IBusObjectClass *class)
- _ibus_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-- g_type_class_add_private (class, sizeof (IBusObjectPrivate));
--
- #ifdef DEBUG_MEMORY
- _count_table = g_hash_table_new (g_direct_hash, g_direct_equal);
- #endif
-diff --git a/src/ibusobservedpath.c b/src/ibusobservedpath.c
-index cbb846df..5b79f1fe 100644
---- a/src/ibusobservedpath.c
-+++ b/src/ibusobservedpath.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input IBus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2015 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -37,7 +37,7 @@ struct _IBusObservedPathPrivate {
- typedef struct _IBusObservedPathPrivate IBusObservedPathPrivate;
-
- #define IBUS_OBSERVED_PATH_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_OBSERVED_PATH, IBusObservedPathPrivate))
-+ ((IBusObservedPathPrivate *)ibus_observed_path_get_instance_private (o))
-
- // static guint _signals[LAST_SIGNAL] = { 0 };
-
-@@ -60,8 +60,6 @@ ibus_observed_path_class_init (IBusObservedPathClass *class)
- IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
- IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
-
-- // g_type_class_add_private (class, sizeof (IBusObservedPathPrivate));
--
- object_class->destroy = (IBusObjectDestroyFunc) ibus_observed_path_destroy;
-
- serializable_class->serialize = (IBusSerializableSerializeFunc) ibus_observed_path_serialize;
-diff --git a/src/ibusproperty.c b/src/ibusproperty.c
-index c6a37534..e87d26b6 100644
---- a/src/ibusproperty.c
-+++ b/src/ibusproperty.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* IBus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 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
-@@ -59,7 +59,7 @@ struct _IBusPropertyPrivate {
- };
-
- #define IBUS_PROPERTY_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_PROPERTY, IBusPropertyPrivate))
-+ ((IBusPropertyPrivate *)ibus_property_get_instance_private (o))
-
- /* functions prototype */
- static void ibus_property_set_property (IBusProperty *prop,
-@@ -78,7 +78,7 @@ static gint ibus_property_deserialize (IBusProperty *prop,
- static gboolean ibus_property_copy (IBusProperty *dest,
- const IBusProperty *src);
-
--G_DEFINE_TYPE (IBusProperty, ibus_property, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusProperty, ibus_property, IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_property_class_init (IBusPropertyClass *class)
-@@ -87,8 +87,6 @@ ibus_property_class_init (IBusPropertyClass *class)
- IBusObjectClass *object_class = IBUS_OBJECT_CLASS (class);
- IBusSerializableClass *serializable_class = IBUS_SERIALIZABLE_CLASS (class);
-
-- g_type_class_add_private (class, sizeof (IBusPropertyPrivate));
--
- gobject_class->set_property = (GObjectSetPropertyFunc) ibus_property_set_property;
- gobject_class->get_property = (GObjectGetPropertyFunc) ibus_property_get_property;
-
-diff --git a/src/ibusregistry.c b/src/ibusregistry.c
-index b0483998..43990d5f 100644
---- a/src/ibusregistry.c
-+++ b/src/ibusregistry.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2015 Red Hat, Inc.
-+ * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2015-2019 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
-@@ -55,7 +55,7 @@ struct _IBusRegistryPrivate {
- };
-
- #define IBUS_REGISTRY_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_REGISTRY, IBusRegistryPrivate))
-+ ((IBusRegistryPrivate *)ibus_registry_get_instance_private (o))
-
- /* functions prototype */
- static void ibus_registry_destroy (IBusRegistry *registry);
-@@ -67,7 +67,7 @@ static gint ibus_registry_deserialize (IBusRegistry *registry,
- static gboolean ibus_registry_copy (IBusRegistry *dest,
- const IBusRegistry *src);
-
--G_DEFINE_TYPE (IBusRegistry, ibus_registry, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusRegistry, ibus_registry, IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_registry_class_init (IBusRegistryClass *class)
-@@ -84,8 +84,6 @@ ibus_registry_class_init (IBusRegistryClass *class)
- (IBusSerializableDeserializeFunc) ibus_registry_deserialize;
- serializable_class->copy = (IBusSerializableCopyFunc) ibus_registry_copy;
-
-- g_type_class_add_private (class, sizeof (IBusRegistryPrivate));
--
- /* install signals */
- /**
- * IBusRegistry::changed:
-diff --git a/src/ibusserializable.c b/src/ibusserializable.c
-index a8d4dd65..231020b7 100644
---- a/src/ibusserializable.c
-+++ b/src/ibusserializable.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -24,7 +24,7 @@
- #include "ibusserializable.h"
-
- #define IBUS_SERIALIZABLE_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_SERIALIZABLE, IBusSerializablePrivate))
-+ ((IBusSerializablePrivate *)ibus_serializable_get_instance_private (o))
-
- enum {
- LAST_SIGNAL,
-@@ -50,7 +50,15 @@ static gboolean ibus_serializable_real_copy (IBusSerializable *des
- const IBusSerializable *src);
-
- static IBusObjectClass *parent_class = NULL;
-+static gint ibus_serializable_private_offset;
-
-+G_GNUC_UNUSED
-+static inline gpointer
-+ibus_serializable_get_instance_private (IBusSerializable *self)
-+{
-+ return (G_STRUCT_MEMBER_P (self, ibus_serializable_private_offset));
-+}
-+
- GType
- ibus_serializable_get_type (void)
- {
-@@ -73,6 +81,9 @@ ibus_serializable_get_type (void)
- "IBusSerializable",
- &type_info,
- 0);
-+ ibus_serializable_private_offset =
-+ g_type_add_instance_private (type,
-+ sizeof (IBusSerializablePrivate));
- }
-
- return type;
-@@ -101,7 +112,10 @@ ibus_serializable_class_init (IBusSerializableClass *class)
-
- parent_class = (IBusObjectClass *) g_type_class_peek_parent (class);
-
-- g_type_class_add_private (class, sizeof (IBusSerializablePrivate));
-+ if (ibus_serializable_private_offset) {
-+ g_type_class_adjust_private_offset (class,
-+ &ibus_serializable_private_offset);
-+ }
-
- object_class->destroy = (IBusObjectDestroyFunc) ibus_serializable_destroy;
-
-@@ -184,7 +198,7 @@ ibus_serializable_real_copy (IBusSerializable *dest,
- {
- IBusSerializablePrivate *src_priv;
- IBusSerializablePrivate *dest_priv;
-- src_priv = IBUS_SERIALIZABLE_GET_PRIVATE (src);
-+ src_priv = IBUS_SERIALIZABLE_GET_PRIVATE (IBUS_SERIALIZABLE (src));
- dest_priv = IBUS_SERIALIZABLE_GET_PRIVATE (dest);
-
- g_datalist_foreach (&src_priv->attachments,
-diff --git a/src/ibusservice.c b/src/ibusservice.c
-index eb370e8b..60255bd5 100644
---- a/src/ibusservice.c
-+++ b/src/ibusservice.c
-@@ -2,8 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -24,7 +24,7 @@
- #include "ibusinternal.h"
-
- #define IBUS_SERVICE_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_SERVICE, IBusServicePrivate))
-+ ((IBusServicePrivate *)ibus_service_get_instance_private (o))
-
- enum {
- LAST_SIGNAL
-@@ -133,6 +133,13 @@ static const GDBusInterfaceVTable ibus_service_interface_vtable = {
- };
-
- static IBusObjectClass *ibus_service_parent_class = NULL;
-+static gint ibus_service_private_offset;
-+
-+static inline gpointer
-+ibus_service_get_instance_private (IBusService *self)
-+{
-+ return (G_STRUCT_MEMBER_P (self, ibus_service_private_offset));
-+}
-
- GType
- ibus_service_get_type (void)
-@@ -156,6 +163,9 @@ ibus_service_get_type (void)
- "IBusService",
- &type_info,
- 0);
-+ ibus_service_private_offset =
-+ g_type_add_instance_private (type,
-+ sizeof (IBusServicePrivate));
- }
-
- return type;
-@@ -198,12 +208,20 @@ ibus_service_class_init (IBusServiceClass *class)
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
- IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (class);
-
-- ibus_service_parent_class = IBUS_OBJECT_CLASS (g_type_class_peek_parent (class));
-+ ibus_service_parent_class =
-+ IBUS_OBJECT_CLASS (g_type_class_peek_parent (class));
-+ if (ibus_service_private_offset) {
-+ g_type_class_adjust_private_offset (class,
-+ &ibus_service_private_offset);
-+ }
-
- gobject_class->constructed = ibus_service_constructed;
-- gobject_class->set_property = (GObjectSetPropertyFunc) ibus_service_set_property;
-- gobject_class->get_property = (GObjectGetPropertyFunc) ibus_service_get_property;
-- ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_service_destroy;
-+ gobject_class->set_property =
-+ (GObjectSetPropertyFunc) ibus_service_set_property;
-+ gobject_class->get_property =
-+ (GObjectGetPropertyFunc) ibus_service_get_property;
-+ ibus_object_class->destroy =
-+ (IBusObjectDestroyFunc) ibus_service_destroy;
-
- /* virtual functions */
- class->service_method_call = ibus_service_service_method_call;
-@@ -252,8 +270,6 @@ ibus_service_class_init (IBusServiceClass *class)
- G_PARAM_STATIC_NICK |
- G_PARAM_STATIC_BLURB)
- );
--
-- g_type_class_add_private (class, sizeof (IBusServicePrivate));
- }
-
- static void
-diff --git a/src/ibusunicode.c b/src/ibusunicode.c
-index aac9c135..9e6f6b2b 100644
---- a/src/ibusunicode.c
-+++ b/src/ibusunicode.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2019 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
-@@ -64,13 +64,9 @@ typedef struct {
- } IBusUnicodeDataLoadData;
-
- #define IBUS_UNICODE_DATA_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
-- IBUS_TYPE_UNICODE_DATA, \
-- IBusUnicodeDataPrivate))
-+ ((IBusUnicodeDataPrivate *)ibus_unicode_data_get_instance_private (o))
- #define IBUS_UNICODE_BLOCK_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
-- IBUS_TYPE_UNICODE_BLOCK, \
-- IBusUnicodeBlockPrivate))
-+ ((IBusUnicodeBlockPrivate *)ibus_unicode_block_get_instance_private (o))
-
- /* functions prototype */
- static void ibus_unicode_data_set_property (IBusUnicodeData *unicode,
-@@ -106,8 +102,12 @@ static gint ibus_unicode_block_deserialize (IBusUnicodeBlock *block,
- static gboolean ibus_unicode_block_copy (IBusUnicodeBlock *dest,
- const IBusUnicodeBlock *src);
-
--G_DEFINE_TYPE (IBusUnicodeData, ibus_unicode_data, IBUS_TYPE_SERIALIZABLE)
--G_DEFINE_TYPE (IBusUnicodeBlock, ibus_unicode_block, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusUnicodeData,
-+ ibus_unicode_data,
-+ IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusUnicodeBlock,
-+ ibus_unicode_block,
-+ IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_unicode_data_class_init (IBusUnicodeDataClass *class)
-@@ -128,8 +128,6 @@ ibus_unicode_data_class_init (IBusUnicodeDataClass *class)
- serializable_class->copy =
- (IBusSerializableCopyFunc) ibus_unicode_data_copy;
-
-- g_type_class_add_private (class, sizeof (IBusUnicodeDataPrivate));
--
- /* install properties */
- /**
- * IBusUnicodeData:code:
-@@ -690,8 +688,6 @@ ibus_unicode_block_class_init (IBusUnicodeBlockClass *class)
- serializable_class->copy =
- (IBusSerializableCopyFunc) ibus_unicode_block_copy;
-
-- g_type_class_add_private (class, sizeof (IBusUnicodeBlockPrivate));
--
- /* install properties */
- /**
- * IBusUnicodeBlock:start:
-diff --git a/src/ibusxevent.c b/src/ibusxevent.c
-index 287bb99b..a2ea7b57 100644
---- a/src/ibusxevent.c
-+++ b/src/ibusxevent.c
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2019 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
-@@ -24,13 +24,11 @@
-
- #define IBUS_EXTENSION_EVENT_VERSION 1
- #define IBUS_EXTENSION_EVENT_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
-- IBUS_TYPE_EXTENSION_EVENT, \
-- IBusExtensionEventPrivate))
-+ ((IBusExtensionEventPrivate *)ibus_extension_event_get_instance_private (o))
-
- #define IBUS_X_EVENT_VERSION 1
- #define IBUS_X_EVENT_GET_PRIVATE(o) \
-- (G_TYPE_INSTANCE_GET_PRIVATE ((o), IBUS_TYPE_X_EVENT, IBusXEventPrivate))
-+ ((IBusXEventPrivate *)ibus_x_event_get_instance_private (o))
-
- enum {
- PROP_0,
-@@ -128,8 +126,12 @@ static gint ibus_x_event_deserialize (IBusXEvent *event,
- static gboolean ibus_x_event_copy (IBusXEvent *dest,
- const IBusXEvent *src);
-
--G_DEFINE_TYPE (IBusExtensionEvent, ibus_extension_event, IBUS_TYPE_SERIALIZABLE)
--G_DEFINE_TYPE (IBusXEvent, ibus_x_event, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusExtensionEvent,
-+ ibus_extension_event,
-+ IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusXEvent,
-+ ibus_x_event,
-+ IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_extension_event_class_init (IBusExtensionEventClass *class)
-@@ -228,8 +230,6 @@ ibus_extension_event_class_init (IBusExtensionEventClass *class)
- "",
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
--
-- g_type_class_add_private (class, sizeof (IBusExtensionEventPrivate));
- }
-
- static void
-@@ -779,8 +779,6 @@ ibus_x_event_class_init (IBusXEventClass *class)
- "",
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
--
-- g_type_class_add_private (class, sizeof (IBusXEventPrivate));
- }
-
- static void
---
-2.21.0
-
-From 3d442dbf936d197aa11ca0a71663c2bc61696151 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 13 Sep 2019 15:59:03 +0900
-Subject: [PATCH] bus: Implement GDBusAuthObserver callback
-
-ibus uses a GDBusServer with G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS,
-and doesn't set a GDBusAuthObserver, which allows anyone who can connect
-to its AF_UNIX socket to authenticate and be authorized to send method calls.
-It also seems to use an abstract AF_UNIX socket, which does not have
-filesystem permissions, so the practical effect might be that a local
-attacker can connect to another user's ibus service and make arbitrary
-method calls.
-
-BUGS=rhbz#1717958
----
- bus/server.c | 89 ++++++++++++++++++++++++++++++++++++++++++----------
- 1 file changed, 73 insertions(+), 16 deletions(-)
-
-diff --git a/bus/server.c b/bus/server.c
-index 3a626230..2439de14 100644
---- a/bus/server.c
-+++ b/bus/server.c
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -69,17 +70,64 @@ _restart_server (void)
- exit (-1);
- }
-
-+/**
-+ * bus_allow_mechanism_cb:
-+ * @observer: A #GDBusAuthObserver.
-+ * @mechanism: The name of the mechanism.
-+ * @user_data: always %NULL.
-+ *
-+ * Check if @mechanism can be used to authenticate the other peer.
-+ * Returns: %TRUE if the peer's mechanism is allowed.
-+ */
-+static gboolean
-+bus_allow_mechanism_cb (GDBusAuthObserver *observer,
-+ const gchar *mechanism,
-+ G_GNUC_UNUSED gpointer user_data)
-+{
-+ if (g_strcmp0 (mechanism, "EXTERNAL") == 0)
-+ return TRUE;
-+ return FALSE;
-+}
-+
-+/**
-+ * bus_authorize_authenticated_peer_cb:
-+ * @observer: A #GDBusAuthObserver.
-+ * @stream: A #GIOStream.
-+ * @credentials: A #GCredentials.
-+ * @user_data: always %NULL.
-+ *
-+ * Check if a peer who has already authenticated should be authorized.
-+ * Returns: %TRUE if the peer's credential is authorized.
-+ */
-+static gboolean
-+bus_authorize_authenticated_peer_cb (GDBusAuthObserver *observer,
-+ GIOStream *stream,
-+ GCredentials *credentials,
-+ G_GNUC_UNUSED gpointer user_data)
-+{
-+ gboolean authorized = FALSE;
-+ if (credentials) {
-+ GCredentials *own_credentials = g_credentials_new ();
-+ if (g_credentials_is_same_user (credentials, own_credentials, NULL))
-+ authorized = TRUE;
-+ g_object_unref (own_credentials);
-+ }
-+ return authorized;
-+}
-+
- /**
- * bus_new_connection_cb:
-- * @user_data: always NULL.
-- * @returns: TRUE when the function can handle the connection.
-+ * @observer: A #GDBusAuthObserver.
-+ * @dbus_connection: A #GDBusconnection.
-+ * @user_data: always %NULL.
- *
- * Handle incoming connections.
-+ * Returns: %TRUE when the function can handle the connection.
- */
- static gboolean
--bus_new_connection_cb (GDBusServer *server,
-- GDBusConnection *dbus_connection,
-- gpointer user_data)
-+bus_new_connection_cb (GDBusServer *server,
-+ GDBusConnection *dbus_connection,
-+ G_GNUC_UNUSED gpointer user_data)
- {
- BusConnection *connection = bus_connection_new (dbus_connection);
- bus_dbus_impl_new_connection (dbus, connection);
-@@ -94,9 +142,9 @@ bus_new_connection_cb (GDBusServer *server,
- }
-
- static void
--_server_connect_start_portal_cb (GObject *source_object,
-- GAsyncResult *res,
-- gpointer user_data)
-+_server_connect_start_portal_cb (GObject *source_object,
-+ GAsyncResult *res,
-+ G_GNUC_UNUSED gpointer user_data)
- {
- GVariant *result;
- GError *error = NULL;
-@@ -113,9 +161,9 @@ _server_connect_start_portal_cb (GObject *source_object,
- }
-
- static void
--bus_acquired_handler (GDBusConnection *connection,
-- const gchar *name,
-- gpointer user_data)
-+bus_acquired_handler (GDBusConnection *connection,
-+ const gchar *name,
-+ G_GNUC_UNUSED gpointer user_data)
- {
- g_dbus_connection_call (connection,
- IBUS_SERVICE_PORTAL,
-@@ -136,14 +184,17 @@ void
- bus_server_init (void)
- {
- GError *error = NULL;
-+ GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE;
-+ gchar *guid;
-+ GDBusAuthObserver *observer;
-
- dbus = bus_dbus_impl_get_default ();
- ibus = bus_ibus_impl_get_default ();
- bus_dbus_impl_register_object (dbus, (IBusService *)ibus);
-
- /* init server */
-- GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS;
-- gchar *guid = g_dbus_generate_guid ();
-+ guid = g_dbus_generate_guid ();
-+ observer = g_dbus_auth_observer_new ();
- if (!g_str_has_prefix (g_address, "unix:tmpdir=") &&
- !g_str_has_prefix (g_address, "unix:path=")) {
- g_error ("Your socket address does not have the format unix:tmpdir=$DIR "
-@@ -152,7 +203,7 @@ bus_server_init (void)
- server = g_dbus_server_new_sync (
- g_address, /* the place where the socket file lives, e.g. /tmp, abstract namespace, etc. */
- flags, guid,
-- NULL /* observer */,
-+ observer,
- NULL /* cancellable */,
- &error);
- if (server == NULL) {
-@@ -162,7 +213,13 @@ bus_server_init (void)
- }
- g_free (guid);
-
-- g_signal_connect (server, "new-connection", G_CALLBACK (bus_new_connection_cb), NULL);
-+ g_signal_connect (observer, "allow-mechanism",
-+ G_CALLBACK (bus_allow_mechanism_cb), NULL);
-+ g_signal_connect (observer, "authorize-authenticated-peer",
-+ G_CALLBACK (bus_authorize_authenticated_peer_cb), NULL);
-+ g_object_unref (observer);
-+ g_signal_connect (server, "new-connection",
-+ G_CALLBACK (bus_new_connection_cb), NULL);
-
- g_dbus_server_start (server);
-
---
-2.21.0
-
-From a141a14102da038e3f35557ec42e14e322cfdff1 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 13 Sep 2019 20:19:36 +0900
-Subject: [PATCH] bus: Use XDG_RUNTIME_DIR for Unix socket directory
-
-g_dbus_server_new_sync() is failed with address "unix:tmpdir=/tmp/ibus"
-in BSD systems because BSD systems do not support abstract socket files
-and use the real files but no directory "/tmp/ibus". Now the default
-directory will be an unique "unix:tmpdir=$XDG_RUNTIME_DIR/ibus" by user
-in Linux and "unix:tmpdir=/tmp" in BSD and mkdir() runs with the directory
-mode 0700 not to modify by malicious users.
-
-BUG=https://github.com/ibus/ibus/issues/2116
----
- bus/global.c | 6 ++--
- bus/server.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++-----
- configure.ac | 25 +++++++++++++
- 3 files changed, 120 insertions(+), 10 deletions(-)
-
-diff --git a/bus/global.c b/bus/global.c
-index 2ba8b2a7..8758d923 100644
---- a/bus/global.c
-+++ b/bus/global.c
-@@ -2,7 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2010 Red Hat, Inc.
-+ * Copyright (C) 2008-2019 Red Hat, Inc.
- * Copyright (c) 2012 Google, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -21,10 +21,12 @@
- * USA
- */
-
-+#include <config.h>
-+
- #include "global.h"
-
- gchar **g_argv = NULL;
--gchar *g_address = "unix:tmpdir=/tmp/ibus";
-+gchar *g_address = IBUS_SOCKET_DIR;
- gchar *g_cache = "auto";
- gboolean g_mempro = FALSE;
- gboolean g_verbose = FALSE;
-diff --git a/bus/server.c b/bus/server.c
-index 2439de14..d9c30e44 100644
---- a/bus/server.c
-+++ b/bus/server.c
-@@ -22,6 +22,8 @@
- */
- #include "server.h"
-
-+#include <errno.h>
-+#include <glib/gstdio.h>
- #include <gio/gio.h>
- #include <stdlib.h>
- #include <string.h>
-@@ -180,28 +182,102 @@ bus_acquired_handler (GDBusConnection *connection,
- NULL);
- }
-
-+static gchar *
-+_bus_extract_address (void)
-+{
-+ gchar *socket_address = g_strdup (g_address);
-+ gchar *p;
-+
-+#define IF_REPLACE_VARIABLE_WITH_FUNC(variable, func, format) \
-+ if ((p = g_strstr_len (socket_address, -1, (variable)))) { \
-+ gchar *sub1 = g_strndup (socket_address, p - socket_address); \
-+ gchar *sub2 = g_strdup (p + strlen (variable)); \
-+ gchar *tmp = g_strdup_printf ("%s" format "%s", \
-+ sub1, (func) (), sub2); \
-+ g_free (sub1); \
-+ g_free (sub2); \
-+ g_free (socket_address); \
-+ socket_address = tmp; \
-+ }
-+
-+ IF_REPLACE_VARIABLE_WITH_FUNC ("$XDG_RUNTIME_DIR",
-+ g_get_user_runtime_dir,
-+ "%s")
-+ else
-+ IF_REPLACE_VARIABLE_WITH_FUNC ("$XDG_CACHE_HOME",
-+ g_get_user_cache_dir,
-+ "%s")
-+ else
-+ IF_REPLACE_VARIABLE_WITH_FUNC ("$UID", getuid, "%d")
-+
-+#undef IF_REPLACE_VARIABLE_WITH_FUNC
-+
-+ return socket_address;
-+}
-+
- void
- bus_server_init (void)
- {
-- GError *error = NULL;
-+#define IBUS_UNIX_TMPDIR "unix:tmpdir="
-+#define IBUS_UNIX_PATH "unix:path="
-+#define IBUS_UNIX_ABSTRACT "unix:abstract="
-+#define IBUS_UNIX_DIR "unix:dir="
-+
-+ gchar *socket_address;
- GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE;
- gchar *guid;
- GDBusAuthObserver *observer;
-+ GError *error = NULL;
-+ gchar *unix_dir = NULL;
-
- dbus = bus_dbus_impl_get_default ();
- ibus = bus_ibus_impl_get_default ();
- bus_dbus_impl_register_object (dbus, (IBusService *)ibus);
-
- /* init server */
-+ socket_address = _bus_extract_address ();
-+
-+#define IF_GET_UNIX_DIR(prefix) \
-+ if (g_str_has_prefix (socket_address, (prefix))) { \
-+ unix_dir = g_strdup (socket_address + strlen (prefix)); \
-+ }
-+
-+ IF_GET_UNIX_DIR (IBUS_UNIX_TMPDIR)
-+ else
-+ IF_GET_UNIX_DIR (IBUS_UNIX_PATH)
-+ else
-+ IF_GET_UNIX_DIR (IBUS_UNIX_ABSTRACT)
-+ else
-+ IF_GET_UNIX_DIR (IBUS_UNIX_DIR)
-+ else {
-+ g_error ("Your socket address \"%s\" does not correspond with "
-+ "one of the following formats; "
-+ IBUS_UNIX_TMPDIR "DIR, " IBUS_UNIX_PATH "FILE, "
-+ IBUS_UNIX_ABSTRACT "FILE, " IBUS_UNIX_DIR "DIR.",
-+ socket_address);
-+ }
-+ if (!g_file_test (unix_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
-+ /* Require mkdir for BSD system. */
-+ if (g_mkdir_with_parents (unix_dir, 0) != 0) {
-+ g_error ("mkdir is failed in: %s: %s",
-+ unix_dir, g_strerror (errno));
-+ }
-+ /* The mode 0700 can eliminate malicious users change the mode.
-+ * `chmod` runs for the last directory only not to change the modes
-+ * of the parent directories. E.g. "/tmp/ibus".
-+ */
-+ if (g_chmod (unix_dir, 0700) != 0) {
-+ g_error ("chmod(700) is failed in: %s: %s",
-+ unix_dir, g_strerror (errno));
-+ }
-+ }
-+ g_free (unix_dir);
- guid = g_dbus_generate_guid ();
- observer = g_dbus_auth_observer_new ();
-- if (!g_str_has_prefix (g_address, "unix:tmpdir=") &&
-- !g_str_has_prefix (g_address, "unix:path=")) {
-- g_error ("Your socket address does not have the format unix:tmpdir=$DIR "
-- "or unix:path=$FILE; %s", g_address);
-- }
- server = g_dbus_server_new_sync (
-- g_address, /* the place where the socket file lives, e.g. /tmp, abstract namespace, etc. */
-+ /* the place where the socket file lives, e.g. /tmp,
-+ * abstract namespace, etc. */
-+ socket_address,
- flags, guid,
- observer,
- NULL /* cancellable */,
-@@ -209,8 +285,9 @@ bus_server_init (void)
- if (server == NULL) {
- g_error ("g_dbus_server_new_sync() is failed with address %s "
- "and guid %s: %s",
-- g_address, guid, error->message);
-+ socket_address, guid, error->message);
- }
-+ g_free (socket_address);
- g_free (guid);
-
- g_signal_connect (observer, "allow-mechanism",
-@@ -235,6 +312,12 @@ bus_server_init (void)
- G_BUS_NAME_OWNER_FLAGS_NONE,
- bus_acquired_handler,
- NULL, NULL, NULL, NULL);
-+
-+#undef IF_GET_UNIX_DIR
-+#undef IBUS_UNIX_TMPDIR
-+#undef IBUS_UNIX_PATH
-+#undef IBUS_UNIX_ABSTRACT
-+#undef IBUS_UNIX_DIR
- }
-
- const gchar *
-diff --git a/configure.ac b/configure.ac
-index c47e23dc..0c1ee40e 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -702,6 +702,30 @@ the UCD files from https://www.unicode.org/Public/UNIDATA/)
- enable_unicode_dict="yes (enabled, use --disable-unicode-dict to disable)"
- fi
-
-+AC_ARG_WITH(socket-dir,
-+ AS_HELP_STRING([--with-socket-dir[=DIR]],
-+ [Set the default socket directory to connect ibus-daemon with D-Bus
-+ connections (default: "$XDG_RUNTIME_DIR/ibus").
-+ The best practice of the socket directory would be unique per user
-+ not to modify by malicious users but XDG_RUNTIME_DIR is not integrated
-+ in BSD systems and the BSD's default is "/tmp".
-+ "$XDG_RUMTIME_DIR", "$XDG_CACHE_HOME", "$UID" are extracted by
-+ ibus-daemon.
-+ ibus-daemon also runs mkdir for the socket directory since BSD
-+ systems do not support abstract socket paths.
-+ The socket path on a NFS mount would not be a good idea likes
-+ "/home/$USER" because the directory is not sometimes accessible
-+ with the network condition.]),
-+ [IBUS_SOCKET_DIR=$with_socket_dir],
-+ [case $host in
-+ *linux*) IBUS_SOCKET_DIR='unix:tmpdir=$XDG_RUNTIME_DIR/ibus';;
-+ *) IBUS_SOCKET_DIR='unix:tmpdir=/tmp';;
-+ esac]
-+
-+)
-+AC_DEFINE_UNQUOTED(IBUS_SOCKET_DIR, "$IBUS_SOCKET_DIR",
-+ [The default socket directory to connect ibus-daemon.])
-+
- # Check iso-codes.
- PKG_CHECK_MODULES(ISOCODES, [
- iso-codes
-@@ -793,6 +817,7 @@ Build options:
- CLDR annotation directory $EMOJI_ANNOTATION_DIR
- Enable Unicode dict $enable_unicode_dict
- UCD directory $UCD_DIR
-+ Socket directory "$IBUS_SOCKET_DIR"
- Run test cases $enable_tests
- Install tests $enable_install_tests
- ])
---
-2.21.0
-
-From 773420fad23078ceef83e8ae84bba4e139d0bea3 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 19 Sep 2019 17:09:46 +0900
-Subject: [PATCH] src: Fix to allocate compose output buffer with more than two
- chars
-
-If the compose output chars are more than two, IBusCompose calls
-g_renew() but the size is not enough to insert '\0'.
-
-BUG=https://github.com/ibus/ibus/issues/2123
----
- src/ibuscomposetable.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index 5fd37f10..dd9d31d4 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -148,7 +148,7 @@ parse_compose_value (IBusComposeData *compose_data,
- } else {
- compose_data->values = g_renew (gunichar,
- compose_data->values,
-- n_uchars + 1);
-+ n_uchars + 2);
- }
- compose_data->values[n_uchars++] = *up;
- }
---
-2.21.0
-
-From 5742e1b399e5d50f34f35b1cda74e548b95554da Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 2 Oct 2019 16:41:27 +0900
-Subject: [PATCH] Revert XDG_RUNTIME_DIR to XDG_CONFIG_HOME
-
-Some users failed to run ibus-daemon with XDG_RUNTIME_DIR because
-the directory is not created by `su` command.
-Now the IBus socket files will be generated in XDG_CACHE_HOME.
-
-BUG=https://github.com/ibus/ibus/issues/2135
----
- configure.ac | 6 ++++--
- 2 files changed, 8 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0c1ee40e..84589be0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -705,10 +705,12 @@ fi
- AC_ARG_WITH(socket-dir,
- AS_HELP_STRING([--with-socket-dir[=DIR]],
- [Set the default socket directory to connect ibus-daemon with D-Bus
-- connections (default: "$XDG_RUNTIME_DIR/ibus").
-+ connections (default: "$XDG_CACHE_HOME/ibus").
- The best practice of the socket directory would be unique per user
- not to modify by malicious users but XDG_RUNTIME_DIR is not integrated
- in BSD systems and the BSD's default is "/tmp".
-+ XDG_RUMTIME_DIR is not useful now because XDG_RUMTIME_DIR is available
-+ by login but not `su` command but ibus-daemon can be run with su.
- "$XDG_RUMTIME_DIR", "$XDG_CACHE_HOME", "$UID" are extracted by
- ibus-daemon.
- ibus-daemon also runs mkdir for the socket directory since BSD
-@@ -718,7 +720,7 @@ AC_ARG_WITH(socket-dir,
- with the network condition.]),
- [IBUS_SOCKET_DIR=$with_socket_dir],
- [case $host in
-- *linux*) IBUS_SOCKET_DIR='unix:tmpdir=$XDG_RUNTIME_DIR/ibus';;
-+ *linux*) IBUS_SOCKET_DIR='unix:tmpdir=$XDG_CACHE_HOME/ibus';;
- *) IBUS_SOCKET_DIR='unix:tmpdir=/tmp';;
- esac]
-
---
-2.21.0
-
-From 35863d81d15e3d3463cd5dafd0473afb193c57e3 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 30 Oct 2019 17:29:25 +0900
-Subject: [PATCH] Fix deprecated APIs
-
-- Fix deprecated gtk_misc_set_padding(), gtk_widget_set_margin_left(),
- gtk_widget_set_margin_right() in emojilang.py, enginedialog.py,
- setup.ui, candidatearea.vala, candidatepanel.vala, switcher.vala
- since GTK 3.12
-
-- Fix g_new0() argument 1 range [18446744071562067968, 18446744073709551615]
- exceeds maximum object size 9223372036854775807
- [-Walloc-size-larger-than=] by adding g_assert() in ibuscomposetable.c
-
-- Fix gdk_keymap_get_default() with gdk_keymap_get_for_display() in
- bindingcommon.vala
-
-- Fix string.utf8_offset() with string.next_char() in emojier.vala
-
-- Fix Posix.SIGUSR1 with Posix.Signal.USR1 in panel.vala
----
- bus/ibusimpl.c | 1 +
- configure.ac | 3 ++-
- setup/emojilang.py | 14 +++++++-------
- setup/enginedialog.py | 18 +++++++++---------
- setup/setup.ui | 34 +++++++++++++++++-----------------
- src/ibuscomposetable.c | 1 +
- ui/gtk3/bindingcommon.vala | 6 +++---
- ui/gtk3/candidatearea.vala | 9 +++++----
- ui/gtk3/candidatepanel.vala | 10 +++++-----
- ui/gtk3/emojier.vala | 4 +++-
- ui/gtk3/panel.vala | 4 ++--
- ui/gtk3/switcher.vala | 9 +++++----
- 12 files changed, 60 insertions(+), 53 deletions(-)
-
-diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
-index 39b16139..85761d30 100644
---- a/bus/ibusimpl.c
-+++ b/bus/ibusimpl.c
-@@ -2180,6 +2180,7 @@ bus_ibus_impl_registry_destroy (BusIBusImpl *ibus)
-
- g_clear_pointer (&ibus->engine_table, g_hash_table_destroy);
-
-+ /* g_clear_pointer() does not set the cast. */
- ibus_object_destroy (IBUS_OBJECT (ibus->registry));
- ibus->registry = NULL;
-
-diff --git a/configure.ac b/configure.ac
-index 84589be0..ab74a380 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -53,6 +53,7 @@ m4_define([ibus_binary_version],
-
- # Required versions of other packages.
- m4_define([glib_required_version], [2.46.0])
-+m4_define([gtk3_required_version], [3.12.0])
-
- # VALA_TARGET_GLIB_VERSION is used by valac --ccode --target-glib .
- # VALA_TARGET_GLIB_VERSION and glib_required_version will be different
-@@ -238,7 +239,7 @@ fi
- if test x"$enable_gtk3" = x"yes"; then
- # check for gtk3
- PKG_CHECK_MODULES(GTK3, [
-- gtk+-3.0
-+ gtk+-3.0 >= gtk3_required_version
- ])
- PKG_CHECK_EXISTS([gdk-wayland-3.0],
- [enable_gdk3_wayland=yes],
-diff --git a/setup/emojilang.py b/setup/emojilang.py
-index 8250589d..58757d86 100644
---- a/setup/emojilang.py
-+++ b/setup/emojilang.py
-@@ -3,7 +3,7 @@
- #
- # ibus - The Input Bus
- #
--# Copyright (c) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2017 Red Hat, Inc.
- #
- # This program is free software; you can redistribute it and/or
-@@ -83,8 +83,8 @@ class EmojiLangChooser(Gtk.Dialog):
- hscrollbar_policy = Gtk.PolicyType.NEVER,
- vscrollbar_policy = Gtk.PolicyType.NEVER,
- shadow_type = Gtk.ShadowType.IN,
-- margin_left = 6,
-- margin_right = 6,
-+ margin_start = 6,
-+ margin_end = 6,
- margin_top = 6,
- margin_bottom = 6)
- self.vbox.add(self.__scrolled)
-@@ -192,8 +192,8 @@ class EmojiLangChooser(Gtk.Dialog):
- label = Gtk.Label(label = text)
- label.set_halign(alignment)
- label.set_valign(Gtk.Align.CENTER)
-- label.set_margin_left(20)
-- label.set_margin_right(20)
-+ label.set_margin_start(20)
-+ label.set_margin_end(20)
- label.set_margin_top(6)
- label.set_margin_bottom(6)
- hbox.pack_start(label, True, True, 0)
-@@ -235,8 +235,8 @@ class EmojiLangChooser(Gtk.Dialog):
- row.set_tooltip_text(_("More…"))
- arrow = Gtk.Image.new_from_icon_name('view-more-symbolic',
- Gtk.IconSize.MENU)
-- arrow.set_margin_left(20)
-- arrow.set_margin_right(20)
-+ arrow.set_margin_start(20)
-+ arrow.set_margin_end(20)
- arrow.set_margin_top(6)
- arrow.set_margin_bottom(6)
- arrow.set_halign(Gtk.Align.CENTER)
-diff --git a/setup/enginedialog.py b/setup/enginedialog.py
-index 2c472deb..72deada8 100644
---- a/setup/enginedialog.py
-+++ b/setup/enginedialog.py
-@@ -4,7 +4,7 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2015 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2015 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- # Copyright (c) 2013-2015 Red Hat, Inc.
- #
- # This program is free software; you can redistribute it and/or
-@@ -70,8 +70,8 @@ class EngineDialog(Gtk.Dialog):
- hscrollbar_policy = Gtk.PolicyType.NEVER,
- vscrollbar_policy = Gtk.PolicyType.NEVER,
- shadow_type = Gtk.ShadowType.IN,
-- margin_left = 6,
-- margin_right = 6,
-+ margin_start = 6,
-+ margin_end = 6,
- margin_top = 6,
- margin_bottom = 6)
- self.vbox.add(self.__scrolled)
-@@ -94,8 +94,8 @@ class EngineDialog(Gtk.Dialog):
- self.__filter_timeout_id = 0
- self.__filter_word = None
- self.__filter_entry = Gtk.SearchEntry(hexpand = True,
-- margin_left = 6,
-- margin_right = 6,
-+ margin_start = 6,
-+ margin_end = 6,
- margin_top = 6,
- margin_bottom = 6)
- self.__filter_entry.set_no_show_all(True)
-@@ -164,8 +164,8 @@ class EngineDialog(Gtk.Dialog):
- label = Gtk.Label(label = text)
- label.set_halign(alignment)
- label.set_valign(Gtk.Align.CENTER)
-- label.set_margin_left(20)
-- label.set_margin_right(20)
-+ label.set_margin_start(20)
-+ label.set_margin_end(20)
- label.set_margin_top(6)
- label.set_margin_bottom(6)
- hbox.pack_start(label, True, True, 0)
-@@ -205,8 +205,8 @@ class EngineDialog(Gtk.Dialog):
- row.set_tooltip_text(_("More…"))
- arrow = Gtk.Image.new_from_icon_name('view-more-symbolic',
- Gtk.IconSize.MENU)
-- arrow.set_margin_left(20)
-- arrow.set_margin_right(20)
-+ arrow.set_margin_start(20)
-+ arrow.set_margin_end(20)
- arrow.set_margin_top(6)
- arrow.set_margin_bottom(6)
- arrow.set_halign(Gtk.Align.CENTER)
-diff --git a/setup/setup.ui b/setup/setup.ui
-index 9d9d7ee9..56453054 100644
---- a/setup/setup.ui
-+++ b/setup/setup.ui
-@@ -90,8 +90,8 @@
- <property name="spacing">18</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
-- <property name="margin_left">12</property>
-- <property name="margin_right">12</property>
-+ <property name="margin_start">12</property>
-+ <property name="margin_end">12</property>
- <child>
- <object class="GtkFrame" id="frame3">
- <property name="visible">True</property>
-@@ -105,7 +105,7 @@
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- <child>
- <object class="GtkLabel" id="label8">
- <property name="visible">True</property>
-@@ -366,7 +366,7 @@
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
-@@ -589,8 +589,8 @@
- <property name="can_focus">False</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
-- <property name="margin_left">12</property>
-- <property name="margin_right">12</property>
-+ <property name="margin_start">12</property>
-+ <property name="margin_end">12</property>
- <child>
- <object class="GtkBox" id="hbox1">
- <property name="orientation">horizontal</property>
-@@ -658,7 +658,7 @@
- <property name="can_focus">False</property>
- <property name="spacing">5</property>
- <property name="layout_style">start</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- <child>
- <object class="GtkButton" id="button_engine_add">
- <property name="label" translatable="yes">_Add</property>
-@@ -811,7 +811,7 @@
- <property name="max_width_chars">74</property>
- <property name="label" translatable="yes"><small><i>The active input method can be switched around from the selected ones in the above list by pressing the keyboard shortcut keys or clicking the panel icon.</i></small></property>
- <property name="use_markup">True</property>
-- <!-- property name="margin_left">0</property -->
-+ <!-- property name="margin_start">0</property -->
- </object>
- <packing>
- <property name="expand">True</property>
-@@ -850,8 +850,8 @@
- <property name="spacing">18</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
-- <property name="margin_left">12</property>
-- <property name="margin_right">12</property>
-+ <property name="margin_start">12</property>
-+ <property name="margin_end">12</property>
- <child>
- <object class="GtkFrame" id="frame_emoji1">
- <property name="visible">True</property>
-@@ -865,7 +865,7 @@
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- <child>
- <object class="GtkLabel" id="label_emoji1">
- <property name="visible">True</property>
-@@ -1004,7 +1004,7 @@
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- <property name="row_homogeneous">false</property>
- <child>
- <object class="GtkLabel" id="label_emoji_font">
-@@ -1187,8 +1187,8 @@
- <property name="can_focus">False</property>
- <property name="margin_top">12</property>
- <property name="margin_bottom">12</property>
-- <property name="margin_left">12</property>
-- <property name="margin_right">12</property>
-+ <property name="margin_start">12</property>
-+ <property name="margin_end">12</property>
- <child>
- <object class="GtkFrame" id="frame2">
- <property name="visible">True</property>
-@@ -1202,7 +1202,7 @@
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">24</property>
-+ <property name="margin_start">24</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_use_sys_layout">
- <property name="label" translatable="yes">Use system keyboard layout</property>
-@@ -1251,7 +1251,7 @@
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">24</property>
-+ <property name="margin_start">24</property>
- <child>
- <object class="GtkCheckButton" id="checkbutton_use_global_engine">
- <property name="label" translatable="yes">Share the same input method among all applications</property>
-@@ -1348,7 +1348,7 @@ Homepage: https://github.com/ibus/ibus/wiki
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <property name="margin_top">6</property>
-- <property name="margin_left">12</property>
-+ <property name="margin_start">12</property>
- </object>
- </child>
- <child type="label">
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index dd9d31d4..e4e3a7cd 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1058,6 +1058,7 @@ ibus_compose_table_list_add_array (GSList *compose_tables,
- int i;
- guint16 *ibus_compose_seqs = NULL;
-
-+ g_assert (length >= 0);
- g_return_val_if_fail (data != NULL, compose_tables);
- g_return_val_if_fail (max_seq_len <= IBUS_MAX_COMPOSE_LEN, compose_tables);
-
-diff --git a/ui/gtk3/bindingcommon.vala b/ui/gtk3/bindingcommon.vala
-index 4171f29d..150d4c39 100644
---- a/ui/gtk3/bindingcommon.vala
-+++ b/ui/gtk3/bindingcommon.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2018 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2018-2019 Takao Fujwiara <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
-@@ -75,8 +75,8 @@ class BindingCommon {
- // workaround a bug in gdk vapi vala > 0.18
- // https://bugzilla.gnome.org/show_bug.cgi?id=677559
- #if VALA_0_18
-- Gdk.Keymap.get_default().map_virtual_modifiers(
-- ref switch_modifiers);
-+ Gdk.Keymap.get_for_display(Gdk.Display.get_default()
-+ ).map_virtual_modifiers(ref switch_modifiers);
- #else
- if ((switch_modifiers & Gdk.ModifierType.SUPER_MASK) != 0)
- switch_modifiers |= Gdk.ModifierType.MOD4_MASK;
-diff --git a/ui/gtk3/candidatearea.vala b/ui/gtk3/candidatearea.vala
-index 781ecd1e..b22ab5da 100644
---- a/ui/gtk3/candidatearea.vala
-+++ b/ui/gtk3/candidatearea.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2011-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2015-2019 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
-@@ -215,9 +215,10 @@ class CandidateArea : Gtk.Box {
- candidate.show();
- m_candidates += candidate;
-
-- /* Use Gtk.Widget.set_margin_start() since gtk 3.12 */
-- label.set_padding(8, 0);
-- candidate.set_padding(8, 0);
-+ label.set_margin_start (8);
-+ label.set_margin_end (8);
-+ candidate.set_margin_start (8);
-+ candidate.set_margin_end (8);
-
- // Make a copy of i to workaround a bug in vala.
- // https://bugzilla.gnome.org/show_bug.cgi?id=628336
-diff --git a/ui/gtk3/candidatepanel.vala b/ui/gtk3/candidatepanel.vala
-index d404c659..8994cdb9 100644
---- a/ui/gtk3/candidatepanel.vala
-+++ b/ui/gtk3/candidatepanel.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2011-2015 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2015-2019 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
-@@ -242,16 +242,16 @@ public class CandidatePanel : Gtk.Box{
- m_preedit_label.set_size_request(20, -1);
- m_preedit_label.set_halign(Gtk.Align.START);
- m_preedit_label.set_valign(Gtk.Align.CENTER);
-- /* Use Gtk.Widget.set_margin_start() since gtk 3.12 */
-- m_preedit_label.set_padding(8, 0);
-+ m_preedit_label.set_margin_start(8);
-+ m_preedit_label.set_margin_end(8);
- m_preedit_label.set_no_show_all(true);
-
- m_aux_label = new Gtk.Label(null);
- m_aux_label.set_size_request(20, -1);
- m_aux_label.set_halign(Gtk.Align.START);
- m_aux_label.set_valign(Gtk.Align.CENTER);
-- /* Use Gtk.Widget.set_margin_start() since gtk 3.12 */
-- m_aux_label.set_padding(8, 0);
-+ m_aux_label.set_margin_start(8);
-+ m_aux_label.set_margin_end(8);
- m_aux_label.set_no_show_all(true);
-
- m_candidate_area = new CandidateArea(m_vertical_panel_system);
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index fc15cffe..4e52769c 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -2147,11 +2147,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- ncandidates));
- int char_count = text.text.char_count();
- int start_index = -1;
-+ unowned string title = text.text;
- for (int i = 0; i < char_count; i++) {
-- if (text.text.utf8_offset(i).has_prefix(language)) {
-+ if (title.has_prefix(language)) {
- start_index = i;
- break;
- }
-+ title = title.next_char();
- }
- if (start_index >= 0) {
- var attr = new IBus.Attribute(
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 2054658e..680c86ed 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -1053,7 +1053,7 @@ class Panel : IBus.PanelService {
-
- private void show_setup_dialog() {
- if (m_setup_pid != 0) {
-- if (Posix.kill(m_setup_pid, Posix.SIGUSR1) == 0)
-+ if (Posix.kill(m_setup_pid, Posix.Signal.USR1) == 0)
- return;
- m_setup_pid = 0;
- }
-@@ -1087,7 +1087,7 @@ class Panel : IBus.PanelService {
-
- string copyright =
- "Copyright © 2007-2015 Peng Huang\n" +
-- "Copyright © 2015 Takao Fujiwara\n" +
-+ "Copyright © 2015-2019 Takao Fujiwara\n" +
- "Copyright © 2007-2015 Red Hat, Inc.\n";
-
- m_about_dialog.set_copyright(copyright);
-diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala
-index 0de44e98..a4529c88 100644
---- a/ui/gtk3/switcher.vala
-+++ b/ui/gtk3/switcher.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2011-2016 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2015-2019 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
-@@ -125,9 +125,10 @@ class Switcher : Gtk.Window {
- Atk.Object obj = m_label.get_accessible();
- obj.set_role (Atk.Role.STATUSBAR);
-
-- /* Use Gtk.Widget.set_margin_start() and
-- * Gtk.Widget.set_margin_top() since gtk 3.12 */
-- m_label.set_padding(3, 3);
-+ m_label.set_margin_start(3);
-+ m_label.set_margin_end(3);
-+ m_label.set_margin_top(3);
-+ m_label.set_margin_bottom(3);
- vbox.pack_end(m_label, false, false, 0);
-
- grab_focus();
---
-2.21.0
-
-From efeb7b9689126e4f05bd1e10441cdc4a3720ff1c Mon Sep 17 00:00:00 2001
-From: Robert Hoffmann <externer.dl.hoffmann@muenchen.de>
-Date: Fri, 1 Nov 2019 21:55:13 +0900
-Subject: [PATCH] bus: Fix restart crash with inotify read()
-
-Do not close inotify desciptors when restarting the server. This
-may lead to crashes in glib.
-
-Fixes crash in libglib/libgio with
-GLib-GIO-ERROR : inotify read(): Bad file descriptor
-
-See also src/tests/ibus-bus.c: start_exit_async():
- /* 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"
-
-Test plan:
-Run
-$ ibus restart
-several times. Without the patch ibus-daemon will crash occasionally.
-
-BUG=https://github.com/ibus/ibus/pull/2148
----
- bus/server.c | 28 ++++++++++++++++++++++++----
- 1 file changed, 24 insertions(+), 4 deletions(-)
-
-diff --git a/bus/server.c b/bus/server.c
-index d9c30e44..a7554a88 100644
---- a/bus/server.c
-+++ b/bus/server.c
-@@ -26,6 +26,8 @@
- #include <glib/gstdio.h>
- #include <gio/gio.h>
- #include <stdlib.h>
-+#include <fcntl.h>
-+#include <errno.h>
- #include <string.h>
-
- #include "dbusimpl.h"
-@@ -45,16 +47,33 @@ _restart_server (void)
- {
- gchar *exe;
- gint fd;
-+ ssize_t r;
-+ int MAXSIZE = 0xFFF;
-+ char proclnk[MAXSIZE];
-+ char filename[MAXSIZE];
-
-- exe = g_strdup_printf ("/proc/%d/exe", getpid ());
-- exe = g_file_read_link (exe, NULL);
-+ exe = g_file_read_link ("/proc/self/exe", NULL);
-
- if (exe == NULL)
-- exe = BINDIR "/ibus-daemon";
-+ exe = g_strdup (BINDIR "/ibus-daemon");
-
- /* close all fds except stdin, stdout, stderr */
- for (fd = 3; fd <= sysconf (_SC_OPEN_MAX); fd ++) {
-- close (fd);
-+ errno = 0;
-+ /* only close valid fds */
-+ if (fcntl (fd, F_GETFD) != -1 || errno != EBADF) {
-+ g_sprintf (proclnk, "/proc/self/fd/%d", fd);
-+ r = readlink (proclnk, filename, MAXSIZE);
-+ if (r < 0) {
-+ continue;
-+ }
-+ filename[r] = '\0';
-+
-+ /* Do not close 'anon_inode:inotify' fds, that may crash in glib */
-+ if (g_strcmp0 (filename, "anon_inode:inotify") != 0) {
-+ close (fd);
-+ }
-+ }
- }
-
- _restart = FALSE;
-@@ -69,6 +88,7 @@ _restart_server (void)
- execv (exe, g_argv);
- }
- g_warning ("execv %s failed!", g_argv[0]);
-+ g_free (exe);
- exit (-1);
- }
-
---
-2.21.0
-
-From 26a8105b7003953e56bf04426ee89a93482a45c5 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Sun, 10 Nov 2019 09:53:27 +0900
-Subject: [PATCH] ui/gtk3: Fix to exit `ibus emoji` with Escape key
-
-When Escape key is pressed, the current ibus-ui-emojier should exit
-although another daemon one is alive.
-
-`ibus emoji` was used in Wayland desktop as a workaround but now
-IBus emoji functions are moved to the engine's pre-edit and the same
-function is available with Ctrl-Sfhit-e and space key so this problem
-would not be so visible.
-
-BUG=rhbz#1658187
----
- ui/gtk3/emojier.vala | 5 ++--
- ui/gtk3/emojierapp.vala | 63 +++++++++++++++++++++++++++++------------
- 2 files changed, 48 insertions(+), 20 deletions(-)
-
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index 4e52769c..13bacebd 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -320,6 +320,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
-
- public signal void candidate_clicked(uint index, uint button, uint state);
- public signal void commit_text(string text);
-+ public signal void cancel();
-
- public IBusEmojier() {
- GLib.Object(
-@@ -1789,8 +1790,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- show_emoji_variants(emojis);
- return true;
- }
-- if (m_input_context_path != "")
-- m_result = text;
-+ m_result = text;
- if (need_commit_signal)
- commit_text(text);
- return false;
-@@ -1897,6 +1897,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- // PageUp/PageDown.
- remove_all_children();
- }
-+ cancel();
- return false;
- }
-
-diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala
-index e8331989..783c611c 100644
---- a/ui/gtk3/emojierapp.vala
-+++ b/ui/gtk3/emojierapp.vala
-@@ -3,6 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright (c) 2017 Peng Wu <alexepico@gmail.com>
-+ * Copyright (c) 2017-2019 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
-@@ -40,6 +41,33 @@ public class EmojiApplication : Gtk.Application {
- }
-
-
-+ private void save_selected_string(string? selected_string,
-+ bool cancelled) {
-+ if (cancelled) {
-+ m_command_line.print("%s\n", _("Canceled to choose an emoji."));
-+ return;
-+ }
-+ GLib.return_if_fail(selected_string != null);
-+ Gtk.Clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD);
-+ clipboard.set_text(selected_string, -1);
-+ clipboard.store();
-+
-+ var emojier_favorites = m_settings_emoji.get_strv("favorites");
-+ bool has_favorite = false;
-+ foreach (unowned string favorite in emojier_favorites) {
-+ if (favorite == selected_string) {
-+ has_favorite = true;
-+ break;
-+ }
-+ }
-+ if (!has_favorite) {
-+ emojier_favorites += selected_string;
-+ m_settings_emoji.set_strv("favorites", emojier_favorites);
-+ }
-+ m_command_line.print("%s\n", _("Copied an emoji to your clipboard."));
-+ }
-+
-+
- private void show_dialog(ApplicationCommandLine command_line) {
- m_command_line = command_line;
- m_emojier.reset();
-@@ -55,7 +83,7 @@ public class EmojiApplication : Gtk.Application {
- return;
- if (button == IBusEmojier.BUTTON_CLOSE_BUTTON) {
- m_emojier.hide();
-- m_command_line.print("%s\n", _("Canceled to choose an emoji."));
-+ save_selected_string(null, true);
- m_command_line = null;
- return;
- }
-@@ -74,23 +102,7 @@ public class EmojiApplication : Gtk.Application {
- }
- string emoji = m_emojier.get_current_candidate();
- m_emojier.hide();
-- Gtk.Clipboard clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD);
-- clipboard.set_text(emoji, -1);
-- clipboard.store();
--
-- var emojier_favorites = m_settings_emoji.get_strv("favorites");
-- bool has_favorite = false;
-- foreach (unowned string favorite in emojier_favorites) {
-- if (favorite == emoji) {
-- has_favorite = true;
-- break;
-- }
-- }
-- if (!has_favorite) {
-- emojier_favorites += emoji;
-- m_settings_emoji.set_strv("favorites", emojier_favorites);
-- }
-- m_command_line.print("%s\n", _("Copied an emoji to your clipboard."));
-+ save_selected_string(emoji, false);
- m_command_line = null;
- }
-
-@@ -202,6 +214,21 @@ public class EmojiApplication : Gtk.Application {
- m_emojier.candidate_clicked.connect((i, b, s) => {
- candidate_clicked_lookup_table(i, b, s);
- });
-+ m_emojier.cancel.connect(() => {
-+ if (m_command_line == null)
-+ return;
-+ m_emojier.hide();
-+ save_selected_string(null, true);
-+ m_command_line = null;
-+ });
-+ m_emojier.commit_text.connect(() => {
-+ if (m_command_line == null)
-+ return;
-+ m_emojier.hide();
-+ string selected_string = m_emojier.get_selected_string();
-+ save_selected_string(selected_string, false);
-+ m_command_line = null;
-+ });
- }
-
- activate_dialog(command_line);
---
-2.21.0
-
-From 76b1773c6ef529888bcd62c4f8207c89ba23503f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Mangano-Tarumi?= <fmang@mg0.fr>
-Date: Mon, 18 Nov 2019 12:05:35 +0900
-Subject: [PATCH] engine-simple: Add the French bepo_afnor layout
-
-BUG=https://github.com/ibus/ibus/pull/2155
----
- engine/simple.xml.in | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index 4445c254..fc1541ec 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -283,6 +283,18 @@
- <icon>ibus-keyboard</icon>
- <rank>1</rank>
- </engine>
-+ <engine>
-+ <name>xkb:fr:bepo_afnor:fra</name>
-+ <language>fr</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>fr</layout>
-+ <layout_variant>bepo_afnor</layout_variant>
-+ <longname>French (Bepo, ergonomic, Dvorak way, AFNOR)</longname>
-+ <description>French (Bepo, ergonomic, Dvorak way, AFNOR)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
- <engine>
- <name>xkb:fr:dvorak:fra</name>
- <language>fr</language>
---
-2.21.0
-
-From 7f335dcc3dcfe51f74f1dc4e13315e1031d4561e Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Mon, 18 Nov 2019 11:33:04 +0900
-Subject: [PATCH] src: Add file list in registry file
-
-Under Fedora Silverblue, st_mtime in /usr/share/ibus/component is
-1 Jan 1970 even if ibus engines are installed and ibus-daemon
-cannot detect new engines.
-Now IBusObservedPath saves hashed file list besides st_mtime of
-the compnent directory to detect the installed engines newly.
-
-BUG=https://github.com/ibus/ibus/issues/2132
----
- src/ibuscomponent.c | 7 +-
- src/ibusobservedpath.c | 275 ++++++++++++++++++++++++++++++++++++-----
- src/ibusregistry.c | 2 +-
- 3 files changed, 250 insertions(+), 34 deletions(-)
-
-diff --git a/src/ibuscomponent.c b/src/ibuscomponent.c
-index 9837f47c..bbff10fd 100644
---- a/src/ibuscomponent.c
-+++ b/src/ibuscomponent.c
-@@ -2,6 +2,7 @@
- /* vim:set et sts=4: */
- /* bus - The Input Bus
- * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -499,11 +500,7 @@ ibus_component_output (IBusComponent *component,
-
- for (p = component->priv->observed_paths; p != NULL; p = p->next ) {
- IBusObservedPath *path = (IBusObservedPath *) p->data;
--
-- g_string_append_indent (output, indent + 2);
-- g_string_append_printf (output, "<path mtime=\"%ld\" >%s</path>\n",
-- path->mtime,
-- path->path);
-+ ibus_observed_path_output (path, output, indent + 2);
- }
-
- g_string_append_indent (output, indent + 1);
-diff --git a/src/ibusobservedpath.c b/src/ibusobservedpath.c
-index 5b79f1fe..bf7229b7 100644
---- a/src/ibusobservedpath.c
-+++ b/src/ibusobservedpath.c
-@@ -2,6 +2,7 @@
- /* vim:set et sts=4: */
- /* ibus - The Input IBus
- * Copyright (C) 2008-2015 Peng Huang <shawn.p.huang@gmail.com>
-+ * Copyright (C) 2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
-@@ -30,9 +31,9 @@ enum {
- };
-
-
--/* IBusObservedPathPriv */
-+/* IBusObservedPathPrivate */
- struct _IBusObservedPathPrivate {
-- gpointer pad;
-+ guint *file_hash_list;
- };
- typedef struct _IBusObservedPathPrivate IBusObservedPathPrivate;
-
-@@ -52,7 +53,9 @@ static gboolean ibus_observed_path_copy (IBusObservedPath *des
- static gboolean ibus_observed_path_parse_xml_node (IBusObservedPath *path,
- XMLNode *node);
-
--G_DEFINE_TYPE (IBusObservedPath, ibus_observed_path, IBUS_TYPE_SERIALIZABLE)
-+G_DEFINE_TYPE_WITH_PRIVATE (IBusObservedPath,
-+ ibus_observed_path,
-+ IBUS_TYPE_SERIALIZABLE)
-
- static void
- ibus_observed_path_class_init (IBusObservedPathClass *class)
-@@ -84,7 +87,9 @@ static gboolean
- ibus_observed_path_serialize (IBusObservedPath *path,
- GVariantBuilder *builder)
- {
-+ IBusObservedPathPrivate *priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
- gboolean retval;
-+ guint i;
-
- retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->
- serialize ((IBusSerializable *)path, builder);
-@@ -93,6 +98,15 @@ ibus_observed_path_serialize (IBusObservedPath *path,
- g_variant_builder_add (builder, "s", path->path);
- g_variant_builder_add (builder, "x", path->mtime);
-
-+ if (!priv->file_hash_list) {
-+ g_variant_builder_add (builder, "u", 0);
-+ return TRUE;
-+ }
-+ for (i = 0; priv->file_hash_list[i]; i++);
-+ g_variant_builder_add (builder, "u", i);
-+ for (i = 0; priv->file_hash_list[i]; i++)
-+ g_variant_builder_add (builder, "u", priv->file_hash_list[i]);
-+
- return TRUE;
- }
-
-@@ -100,7 +114,9 @@ static gint
- ibus_observed_path_deserialize (IBusObservedPath *path,
- GVariant *variant)
- {
-+ IBusObservedPathPrivate *priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
- gint retval;
-+ guint i, length = 0;
-
- retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->
- deserialize ((IBusSerializable *)path, variant);
-@@ -109,6 +125,15 @@ ibus_observed_path_deserialize (IBusObservedPath *path,
- ibus_g_variant_get_child_string (variant, retval++, &path->path);
- g_variant_get_child (variant, retval++, "x", &path->mtime);
-
-+ if (g_variant_n_children (variant) < retval + 2)
-+ return retval;
-+ g_variant_get_child (variant, retval++, "u", &length);
-+ if (!length)
-+ return retval;
-+ priv->file_hash_list = g_new0 (guint, length + 1);
-+ for (i = 0; i < length; i++)
-+ g_variant_get_child (variant, retval++, "u", &priv->file_hash_list[i]);
-+
- return retval;
- }
-
-@@ -116,14 +141,27 @@ static gboolean
- ibus_observed_path_copy (IBusObservedPath *dest,
- const IBusObservedPath *src)
- {
-+ IBusObservedPathPrivate *dest_priv = IBUS_OBSERVED_PATH_GET_PRIVATE (dest);
-+ IBusObservedPathPrivate *src_priv =
-+ IBUS_OBSERVED_PATH_GET_PRIVATE ((IBusObservedPath *)src);
- gboolean retval;
-+ guint i;
-
-- retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->copy ((IBusSerializable *)dest, (IBusSerializable *)src);
-+ retval = IBUS_SERIALIZABLE_CLASS (ibus_observed_path_parent_class)->
-+ copy ((IBusSerializable *)dest, (IBusSerializable *)src);
- g_return_val_if_fail (retval, FALSE);
-
- dest->path = g_strdup (src->path);
- dest->mtime = src->mtime;
-
-+ g_clear_pointer (&dest_priv->file_hash_list, g_free);
-+ if (!src_priv->file_hash_list)
-+ return TRUE;
-+ for (i = 0; src_priv->file_hash_list[i]; i++);
-+ dest_priv->file_hash_list = g_new0 (guint, i + 1);
-+ for (i = 0; src_priv->file_hash_list[i]; i++)
-+ dest_priv->file_hash_list[i] = src_priv->file_hash_list[i];
-+
- return TRUE;
- }
-
-@@ -137,23 +175,48 @@ ibus_observed_path_copy (IBusObservedPath *dest,
-
- void
- ibus_observed_path_output (IBusObservedPath *path,
-- GString *output,
-- gint indent)
-+ GString *output,
-+ gint indent)
- {
-+ IBusObservedPathPrivate *priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
-+ guint i;
-+
- g_assert (IBUS_IS_OBSERVED_PATH (path));
- g_assert (output);
-
-- g_string_append_indent (output, indent);
-- g_string_append_printf (output, "<path mtime=\"%ld\" >%s</path>\n",
-- path->mtime,
-- path->path);
-+ if (!priv->file_hash_list) {
-+ g_string_append_indent (output, indent);
-+ g_string_append_printf (output, "<path mtime=\"%ld\" >%s</path>\n",
-+ path->mtime,
-+ path->path);
-+ } else {
-+ g_string_append_indent (output, indent);
-+ g_string_append_printf (
-+ output,
-+ "<path mtime=\"%ld\" type=\"dir\" path=\"%s\">\n",
-+ path->mtime,
-+ path->path);
-+ for (i = 0; priv->file_hash_list[i]; i++) {
-+ g_string_append_indent (output, indent + 1);
-+ g_string_append_printf (output, "<file hash=\"%u\" />\n",
-+ priv->file_hash_list[i]);
-+ }
-+ g_string_append_indent (output, indent);
-+ g_string_append_printf (output, "</path>\n");
-+ }
- }
-
- gboolean
- ibus_observed_path_check_modification (IBusObservedPath *path)
- {
-+ IBusObservedPathPrivate *priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
- gchar *real_path = NULL;
- struct stat buf;
-+ gboolean retval = FALSE;
-+ GDir *dir = NULL;
-+ const gchar *name;
-+ guint i = 0;
-+ guint file_num = 0;
-
- g_assert (IBUS_IS_OBSERVED_PATH (path));
-
-@@ -169,11 +232,71 @@ ibus_observed_path_check_modification (IBusObservedPath *path)
- buf.st_mtime = 0;
- }
-
-- g_free (real_path);
-
-- if (path->mtime == buf.st_mtime)
-- return FALSE;
-- return TRUE;
-+ if (path->mtime != buf.st_mtime) {
-+ retval = TRUE;
-+ goto end_check_modification;
-+ }
-+
-+ /* If an ibus engine is installed, normal file system updates
-+ * the directory mtime of "/usr/share/ibus/component" and
-+ * path->mtime of the cache file and buf.st_mtime of the current directory
-+ * could have the different values.
-+ *
-+ * But under a special file system, the buf.st_mtime is not updated
-+ * even if an ibus engine is installed, likes Fedora Silverblue
-+ * and ibus_observed_path_check_modification() could not detect
-+ * the installed ibus engines.
-+ * Now path->priv->file_hash_list reserves the hash list of the files
-+ * in the observed directory and if a new ibus engine is installed,
-+ * the hash of the compose file does not exists in the cache's
-+ * file_hash_list and ibus-daemon regenerate the cache successfully.
-+ */
-+ if (!priv->file_hash_list) {
-+ /* If the cache version is old, ibus_registry_load_cache() returns
-+ * FALSE and ibus_registry_check_modification() and this are not
-+ * called.
-+ * If the cache version is the latest, the cache file includes the
-+ * filled file_hash_list for directories with ibus_observed_path_new()
-+ * when the cache was generated.
-+ * Then if file_hash_list is null, it's a simple file in ibus
-+ * components and return here simply.
-+ */
-+ goto end_check_modification;
-+ }
-+ dir = g_dir_open (real_path, 0, NULL);
-+ g_return_val_if_fail (dir, FALSE);
-+
-+ while ((name = g_dir_read_name (dir)) != NULL) {
-+ guint current_hash;
-+ gboolean has_file = FALSE;
-+
-+ if (!g_str_has_suffix (name, ".xml"))
-+ continue;
-+ current_hash = g_str_hash (name);
-+ for (i = 0; priv->file_hash_list[i]; i++) {
-+ if (current_hash == priv->file_hash_list[i]) {
-+ has_file = TRUE;
-+ break;
-+ }
-+ }
-+ if (!has_file) {
-+ retval = TRUE;
-+ goto end_check_modification;
-+ }
-+ file_num++;
-+ }
-+ if (!retval) {
-+ for (i = 0; priv->file_hash_list[i]; i++);
-+ if (file_num != i)
-+ retval = TRUE;
-+ }
-+
-+end_check_modification:
-+ if (dir)
-+ g_dir_close (dir);
-+ g_free (real_path);
-+ return retval;
- }
-
- static void
-@@ -224,7 +347,7 @@ ibus_observed_path_traverse (IBusObservedPath *path,
- paths = g_list_append (paths, sub);
- paths = g_list_concat (paths,
- ibus_observed_path_traverse (sub, dir_only));
-- } else if (!dir_only) {
-+ } else if (sub->is_exist && !dir_only) {
- paths = g_list_append (paths, sub);
- }
- }
-@@ -233,36 +356,102 @@ ibus_observed_path_traverse (IBusObservedPath *path,
- return paths;
- }
-
-+
-+static gboolean
-+ibus_observed_path_parse_file (IBusObservedPath *path,
-+ XMLNode *node,
-+ int *nth)
-+{
-+ IBusObservedPathPrivate *priv = IBUS_OBSERVED_PATH_GET_PRIVATE (path);
-+ gchar **attr;
-+
-+ for (attr = node->attributes; attr[0]; attr += 2) {
-+ guint hash = 0;
-+
-+ if (g_strcmp0 (*attr, "hash") == 0)
-+ hash = atol (attr[1]);
-+ else if (g_strcmp0 (*attr, "name") == 0)
-+ hash = g_str_hash (attr[1]);
-+ if (hash) {
-+ if (!priv->file_hash_list) {
-+ *nth = 0;
-+ priv->file_hash_list = g_new0 (guint, *nth + 2);
-+ } else {
-+ priv->file_hash_list = g_renew (guint, priv->file_hash_list,
-+ *nth + 2);
-+ }
-+ priv->file_hash_list[*nth] = hash;
-+ priv->file_hash_list[*nth + 1] = 0;
-+ *nth += 1;
-+ continue;
-+ }
-+ g_warning ("Unkonwn attribute %s", attr[0]);
-+ }
-+
-+ return TRUE;
-+}
-+
-+
- static gboolean
- ibus_observed_path_parse_xml_node (IBusObservedPath *path,
- XMLNode *node)
- {
-+ gchar **attr;
-+ const gchar *full_path = node->text;
-+ GList *p;
-+ int i = 0;
-+
- g_assert (IBUS_IS_OBSERVED_PATH (path));
- g_assert (node);
-
-- if (G_UNLIKELY (g_strcmp0 (node->name, "path") != 0)) {
-+ if (G_UNLIKELY (g_strcmp0 (node->name, "path") != 0))
- return FALSE;
-+
-+ for (attr = node->attributes; attr[0]; attr += 2) {
-+ if (g_strcmp0 (*attr, "mtime") == 0) {
-+ path->mtime = atol (attr[1]);
-+ continue;
-+ }
-+ if (g_strcmp0 (*attr, "path") == 0) {
-+ full_path = attr[1];
-+ continue;
-+ }
-+ if (g_strcmp0 (*attr, "type") == 0) {
-+ if (!g_strcmp0 (attr[1], "dir"))
-+ path->is_dir = TRUE;
-+ else if (!g_strcmp0 (attr[1], "file"))
-+ path->is_dir = FALSE;
-+ else
-+ g_warning ("The type attribute can be \"dir\" or \"file\".");
-+ continue;
-+ }
-+ g_warning ("Unkonwn attribute %s", attr[0]);
- }
-
-- if (node->text[0] == '~' && node->text[1] != G_DIR_SEPARATOR) {
-- g_warning ("Invalid path \"%s\"", node->text);
-+ if (full_path[0] == '~' && full_path[1] != G_DIR_SEPARATOR) {
-+ g_warning ("Invalid path \"%s\"", full_path);
- return FALSE;
- }
-
-- path->path = g_strdup (node->text);
-+ path->path = g_strdup (full_path);
-
-- gchar **attr;
-- for (attr = node->attributes; attr[0]; attr += 2) {
-- if (g_strcmp0 (*attr, "mtime") == 0) {
-- path->mtime = atol (attr[1]);
-+ if (!path->is_dir)
-+ return TRUE;
-+
-+ for (i = 0, p = node->sub_nodes; p != NULL; p = p->next) {
-+ XMLNode *sub_node = (XMLNode *)p->data;
-+
-+ if (G_UNLIKELY (g_strcmp0 (sub_node->name, "file") != 0)) {
-+ g_warning ("Unkonwn tag %s", sub_node->name);
- continue;
- }
-- g_warning ("Unkonwn attribute %s", attr[0]);
-+ ibus_observed_path_parse_file (path, sub_node, &i);
- }
-
- return TRUE;
- }
-
-+
- IBusObservedPath *
- ibus_observed_path_new_from_xml_node (XMLNode *node,
- gboolean fill_stat)
-@@ -288,16 +477,46 @@ IBusObservedPath *
- ibus_observed_path_new (const gchar *path,
- gboolean fill_stat)
- {
-- g_assert (path);
--
- IBusObservedPath *op;
-+ IBusObservedPathPrivate *priv;
-+ GList *file_list, *l;
-+ guint i = 0;
-
-+ g_assert (path);
- op = (IBusObservedPath *) g_object_new (IBUS_TYPE_OBSERVED_PATH, NULL);
- op->path = g_strdup (path);
-
-- if (fill_stat) {
-- ibus_observed_path_fill_stat (op);
-+ priv = IBUS_OBSERVED_PATH_GET_PRIVATE (op);
-+ l = file_list = ibus_observed_path_traverse (op, FALSE);
-+ for (; l; l = l->next) {
-+ IBusObservedPath *sub = l->data;
-+ const gchar *file = NULL;
-+
-+ g_return_val_if_fail (sub && sub->path, op);
-+
-+ file = sub->path;
-+ if (!g_str_has_suffix (file, ".xml"))
-+ continue;
-+ if (g_str_has_prefix (file, path)) {
-+ file += strlen (path);
-+ if (*file == '/')
-+ file++;
-+ /* Ignore sub directories */
-+ if (strchr (file, '/'))
-+ continue;
-+ }
-+ if (!i)
-+ priv->file_hash_list = g_new0 (guint, i + 2);
-+ else
-+ priv->file_hash_list = g_renew (guint, priv->file_hash_list, i + 2);
-+ priv->file_hash_list[i] = g_str_hash (file);
-+ priv->file_hash_list[i + 1] = 0;
-+ ++i;
- }
-+ g_list_free_full (file_list, (GDestroyNotify)ibus_observed_path_destroy);
-+
-+ if (fill_stat)
-+ ibus_observed_path_fill_stat (op);
-
- return op;
- }
-diff --git a/src/ibusregistry.c b/src/ibusregistry.c
-index 43990d5f..378388d9 100644
---- a/src/ibusregistry.c
-+++ b/src/ibusregistry.c
-@@ -29,7 +29,7 @@
- #include "ibusregistry.h"
-
- #define IBUS_CACHE_MAGIC 0x49425553 /* "IBUS" */
--#define IBUS_CACHE_VERSION 0x00010512
-+#define IBUS_CACHE_VERSION 0x00010522
-
- enum {
- CHANGED,
---
-2.21.0
-
-From bccf94d5ec1c5fc80d5aeac622f2ab8007d5a28a Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 29 Nov 2019 20:28:49 +0900
-Subject: [PATCH] src/tests: RHEL codereview for ibus-desktop-testing-runner
-
----
- src/tests/ibus-desktop-testing-runner.in | 16 ++++++++++------
- 1 file changed, 10 insertions(+), 6 deletions(-)
-
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 141e9b5b..72537cd4 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -28,6 +28,10 @@
- # # /root/ibus/tests/test-console.sh --tests ibus-compose \
- # --builddir /root/ibus/src/tests --srcdir /root/ibus/src/tests
-
-+# POSIX sh has no 'echo -e'
-+: ${ECHO:='/usr/bin/echo'}
-+
-+
- PROGNAME=`basename $0`
- VERSION=0.1
- DISPLAY=:99.0
-@@ -54,15 +58,15 @@ print_log()
- shift
- fi
- NO_ESCAPE=`echo $@ | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'`
-- echo $NO_ESCAPE >> $RESULT_LOG
-+ $ECHO $NO_ESCAPE >> $RESULT_LOG
- else
-- echo $@
-+ $ECHO $@
- fi
- }
-
- usage()
- {
-- echo -e \
-+ $ECHO -e \
- "This test runs /usr/bin/ibus-daemon after install ibus\n" \
- "$PROGNAME [OPTIONS…]\n" \
- "\n" \
-@@ -92,7 +96,7 @@ parse_args()
- while [ 1 ] ; do
- case "$1" in
- -h | --help ) usage; exit 0;;
-- -v | --version ) echo -e "$VERSION"; exit 0;;
-+ -v | --version ) $ECHO -e "$VERSION"; exit 0;;
- -b | --builddir ) BUILDDIR="$2"; shift 2;;
- -s | --srcdir ) SRCDIR="$2"; shift 2;;
- -c | --no-graphics ) HAVE_GRAPHICS=0; shift;;
-@@ -121,7 +125,7 @@ init_desktop()
- fi
- if [ "$TEST_LOG" = "" ] ; then
- print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: a log file is required to get return value with 'read' command"
-- exit -1
-+ exit 255
- elif [ -f $TEST_LOG ] ; then
- rm $TEST_LOG
- fi
-@@ -291,7 +295,7 @@ EOF
- done
- child_pass=`grep '^PASS:' $TEST_LOG | wc -l`
- child_fail=`grep '^FAIL:' $TEST_LOG | wc -l`
-- if [ $child_pass -ne 0 -o $child_fail -ne 0 ] ; then
-+ if [ $child_pass -ne 0 ] || [ $child_fail -ne 0 ] ; then
- pass=$child_pass
- if [ $child_fail -ne 0 ] ; then
- fail=`expr $child_fail / 2`
---
-2.21.0
-
-From d50627f0b7a000ee13ea6dcc02a4162be1fa853d Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 3 Dec 2019 21:42:49 +0900
-Subject: [PATCH] src/tests: RHEL codereview #2 for ibus-desktop-testing-runner
-
----
- src/tests/ibus-compose-locales.in | 21 +++++++--------
- src/tests/ibus-desktop-testing-runner.in | 33 ++++++++++++------------
- 2 files changed, 27 insertions(+), 27 deletions(-)
-
-diff --git a/src/tests/ibus-compose-locales.in b/src/tests/ibus-compose-locales.in
-index f650b584..b36165fe 100755
---- a/src/tests/ibus-compose-locales.in
-+++ b/src/tests/ibus-compose-locales.in
-@@ -7,27 +7,26 @@ BUILDDIR=`dirname $0`
- export IBUS_COMPOSE_CACHE_DIR=$PWD
-
- retval=0
--# Let for-loop notice '\n' as a delimiter
--IFS=$'\n'
--for var in `cat $SRCDIR/ibus-compose.env`
-+# Deleted for var in `cat *.env` because IFS=$'\n' is not supported in POSIX sh
-+while read var
- do
-- # Revert IFS to recognize env a=foo b=foo
-- IFS=' '
- IS_COMMENT=`echo "$var" | grep "^#"`
- if [ "x$IS_COMMENT" != x ] ; then
- continue
- fi
-- echo "# Starting $var $BUILDDIR/ibus-compose $SRCDIR $@"
-- env $var $BUILDDIR/ibus-compose $SRCDIR $@
-+ # Use $* instead of $@ not to mix strings and integers
-+ echo "# Starting $var $BUILDDIR/ibus-compose $SRCDIR $*"
-+ # Need to enclose $@ with double quotes not to split the array.
-+ env $var $BUILDDIR/ibus-compose $SRCDIR "$@"
- retval=`expr $retval + $?`
-- echo "# Finished $var $BUILDDIR/ibus-compose $SRCDIR $@ with $retval"
-+ echo "# Finished $var $BUILDDIR/ibus-compose $SRCDIR $* with $retval"
-
- CACHE_FILES=`ls *.cache`
- if [ x"$CACHE_FILES" != x ] ; then
- echo "Clean $CACHE_FILES"
- rm $CACHE_FILES
- fi
-- IFS=$'\n'
--done
--IFS=' '
-+done << EOF_ENVS
-+`cat $SRCDIR/ibus-compose.env`
-+EOF_ENVS
- exit $retval
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 72537cd4..981941d5 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -30,6 +30,8 @@
-
- # POSIX sh has no 'echo -e'
- : ${ECHO:='/usr/bin/echo'}
-+# POSIX sh has $UID
-+: ${UID:='`id -u`'}
-
-
- PROGNAME=`basename $0`
-@@ -57,10 +59,10 @@ print_log()
- if [ x"$1" = x'-e' ] ; then
- shift
- fi
-- NO_ESCAPE=`echo $@ | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'`
-+ NO_ESCAPE=`echo "$@" | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'`
- $ECHO $NO_ESCAPE >> $RESULT_LOG
- else
-- $ECHO $@
-+ $ECHO "$@"
- fi
- }
-
-@@ -231,9 +233,9 @@ run_direct_test_cases()
- if test x"$ENVS" = x ; then
- $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG
- retval=$?
-- read pass fail << EOF
-+ read pass fail << EOF_COUNT
- `count_case_result $retval $pass $fail`
--EOF
-+EOF_COUNT
- echo_case_result $retval $tst
- CACHE_FILES=`ls *.cache`
- if [ x"$CACHE_FILES" != x ] ; then
-@@ -242,11 +244,9 @@ EOF
- fi
- else
- i=1
-- # Let for-loop notice '\n' as a delimiter
-- IFS=$'\n'
-- for e in $ENVS; do
-- # Revert IFS to recognize env a=foo b=foo
-- IFS=' '
-+ # Deleted for var in "$ENVS" because IFS=$'\n' is not supported
-+ # in POSIX sh
-+ while read e ; do
- first=`echo "$e" | grep '^#'`
- if test x"$first" = x"#" ; then
- continue
-@@ -255,9 +255,9 @@ EOF
- env $e $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG
- retval=$?
- echo "# Finished $e $BUILDDIR/$tst $SRCDIR with $retval" >>$TEST_LOG
-- read pass fail << EOF
-+ read pass fail << EOF_COUNT
- `count_case_result $retval $pass $fail`
--EOF
-+EOF_COUNT
- echo_case_result $retval $tst $e
- CACHE_FILES=`ls *.cache`
- if [ x"$CACHE_FILES" != x ] ; then
-@@ -265,9 +265,9 @@ EOF
- rm $CACHE_FILES
- fi
- i=`expr $i + 1`
-- IFS=$'\n'
-- done
-- IFS=' '
-+ done << EOF_ENVS
-+ `echo "$ENVS"`
-+EOF_ENVS
- fi
- done
- echo $pass $fail
-@@ -357,7 +357,7 @@ finit()
-
- main()
- {
-- parse_args $@
-+ parse_args "$@"
- init_desktop
- run_dbus_daemon 2>>$TEST_LOG 1>>$TEST_LOG
- run_desktop 2>>$TEST_LOG 1>>$TEST_LOG
-@@ -365,4 +365,5 @@ main()
- finit
- }
-
--main $@
-+# Need to enclose $@ with double quotes not to split the array.
-+main "$@"
---
-2.21.0
-
-From 25d11f5cfd4c39e53be11a1348da29a61593cc4c Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 11 Dec 2019 16:28:22 +0900
-Subject: [PATCH] client/gtk2: Fix to set use_button_press_event after signals
- are connected
-
-_ibus_context_update_preedit_text_cb() can be called with reset signals
-before ibus_im_context_set_client_window() is called. Then
-use_button_press_event needs to be set only when the signals are connected.
-
-BUG=https://github.com/ibus/ibus/issues/1980
----
- client/gtk2/ibusimcontext.c | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index 5e3457ba..ac5de809 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -1074,8 +1074,9 @@ ibus_im_context_reset (GtkIMContext *context)
- /* 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.
-+ * by themselves.
-+ * IBus uses button-press-event instead until GTK is fixed.
-+ * https://gitlab.gnome.org/GNOME/gtk/issues/1534
- */
- ibus_input_context_reset (ibusimcontext->ibuscontext);
- }
-@@ -1657,10 +1658,13 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext,
- if (!ibusimcontext->use_button_press_event &&
- mode == IBUS_ENGINE_PREEDIT_COMMIT) {
- #if !GTK_CHECK_VERSION (3, 93, 0)
-- if (ibusimcontext->client_window)
-+ if (ibusimcontext->client_window) {
- _connect_button_press_event (ibusimcontext, TRUE);
--#endif
-+ ibusimcontext->use_button_press_event = TRUE;
-+ }
-+#else
- ibusimcontext->use_button_press_event = TRUE;
-+#endif
- }
-
- str = text->text;
---
-2.21.0
-
-From c662a02bf3b50914c697af12fc152ee97e2df961 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 25 Dec 2019 17:30:56 +0900
-Subject: [PATCH] client/gtk2: Fix to connect button-press-event signal
-
-IBus clients do not connect button-press-event in some conditions
-and it will be fixed.
-
-BUG=https://github.com/ibus/ibus/issues/1980
----
- client/gtk2/ibusimcontext.c | 21 ++++++++++++---------
- 1 file changed, 12 insertions(+), 9 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index ac5de809..30585403 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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2018 Red Hat, Inc.
-+ * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -73,7 +73,7 @@ struct _IBusIMContext {
- GCancellable *cancellable;
- GQueue *events_queue;
-
-- gboolean use_button_press_event;
-+ gboolean use_button_press_event;
- };
-
- struct _IBusIMContextClass {
-@@ -1125,6 +1125,10 @@ ibus_im_context_get_preedit_string (GtkIMContext *context,
-
-
- #if !GTK_CHECK_VERSION (3, 93, 0)
-+/* Use the button-press-event signal until GtkIMContext always emits the reset
-+ * signal.
-+ * https://gitlab.gnome.org/GNOME/gtk/merge_requests/460
-+ */
- static gboolean
- ibus_im_context_button_press_event_cb (GtkWidget *widget,
- GdkEventButton *event,
-@@ -1157,11 +1161,13 @@ _connect_button_press_event (IBusIMContext *ibusimcontext,
- "button-press-event",
- G_CALLBACK (ibus_im_context_button_press_event_cb),
- ibusimcontext);
-+ ibusimcontext->use_button_press_event = TRUE;
- } else {
- g_signal_handlers_disconnect_by_func (
- widget,
- G_CALLBACK (ibus_im_context_button_press_event_cb),
- ibusimcontext);
-+ ibusimcontext->use_button_press_event = FALSE;
- }
- }
- }
-@@ -1188,7 +1194,7 @@ 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)
-- if (ibusimcontext->use_button_press_event)
-+ if (!ibusimcontext->use_button_press_event)
- _connect_button_press_event (ibusimcontext, TRUE);
- #endif
- }
-@@ -1655,17 +1661,14 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext,
- ibusimcontext->preedit_attrs = NULL;
- }
-
-+#if !GTK_CHECK_VERSION (3, 93, 0)
- 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);
-- ibusimcontext->use_button_press_event = TRUE;
- }
--#else
-- ibusimcontext->use_button_press_event = TRUE;
--#endif
- }
-+#endif
-
- str = text->text;
- ibusimcontext->preedit_string = g_strdup (str);
---
-2.21.0
-
-From ecc3465a585448486b2ce68bcefc11d6aebae755 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 23 Jan 2020 16:13:05 +0900
-Subject: [PATCH 1/5] client/gtk2: Fix some format sentences
-
----
- client/gtk2/ibusimcontext.c | 23 +++++++++++------------
- 1 file changed, 11 insertions(+), 12 deletions(-)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index 30585403..50290c55 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -73,7 +73,9 @@ struct _IBusIMContext {
- GCancellable *cancellable;
- GQueue *events_queue;
-
-+#if !GTK_CHECK_VERSION (3, 93, 0)
- gboolean use_button_press_event;
-+#endif
- };
-
- struct _IBusIMContextClass {
-@@ -137,12 +139,12 @@ static void ibus_im_context_set_surrounding
-
- /* static methods*/
- static void _ibus_context_update_preedit_text_cb
-- (IBusInputContext *ibuscontext,
-- IBusText *text,
-- gint cursor_pos,
-- gboolean visible,
-- guint mode,
-- IBusIMContext *ibusimcontext);
-+ (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);
-@@ -172,7 +174,6 @@ static void _create_fake_input_context (void);
- static gboolean _set_content_type (IBusIMContext *context);
-
-
--
- static GType _ibus_type_im_context = 0;
- static GtkIMContextClass *parent_class = NULL;
-
-@@ -313,7 +314,6 @@ _process_key_event_done (GObject *object,
- {
- IBusInputContext *context = (IBusInputContext *)object;
- GdkEventKey *event = (GdkEventKey *) user_data;
--
- GError *error = NULL;
- gboolean retval = ibus_input_context_process_key_event_async_finish (
- context,
-@@ -362,12 +362,10 @@ _process_key_event (IBusInputContext *context,
- retval = TRUE;
- }
-
-- if (retval) {
-+ if (retval)
- event->state |= IBUS_HANDLED_MASK;
-- }
-- else {
-+ else
- event->state |= IBUS_IGNORED_MASK;
-- }
-
- return retval;
- }
-@@ -1508,6 +1506,7 @@ _key_is_modifier (guint keyval)
- return FALSE;
- }
- }
-+
- /* Copy from gdk */
- static GdkEventKey *
- _create_gdk_event (IBusIMContext *ibusimcontext,
---
-2.24.1
-
-From afc0a89c74950351c32df3d60abb343a0dbc06cc Mon Sep 17 00:00:00 2001
-From: Alex Henrie <alexhenrie24@gmail.com>
-Date: Fri, 24 Jan 2020 15:37:01 +0900
-Subject: [PATCH 2/5] Handle small final sigma in ibus_keyval_convert_case
-
-lowercase: GREEK SMALL LETTER FINAL SIGMA (U+03C2)
-uppercase: GREEK CAPITAL LETTER SIGMA (U+03A3)
-
-This mapping was correct in UCSConvertCase, but the "legacy" mapping
-must also be correct for Caps Lock to work with the final sigma key.
-
-https://gitlab.freedesktop.org/xorg/lib/libx11/commit/7f46a38139
-
-BUG=https://github.com/ibus/ibus/pull/2176
----
- src/ibuskeynames.c | 5 +++--
- 1 file changed, 3 insertions(+), 2 deletions(-)
-
-diff --git a/src/ibuskeynames.c b/src/ibuskeynames.c
-index 08505598..544c6ade 100644
---- a/src/ibuskeynames.c
-+++ b/src/ibuskeynames.c
-@@ -331,8 +331,9 @@ ibus_keyval_convert_case (guint symbol,
- xupper -= (IBUS_KEY_Greek_alphaaccent - IBUS_KEY_Greek_ALPHAaccent);
- else if (symbol >= IBUS_KEY_Greek_ALPHA && symbol <= IBUS_KEY_Greek_OMEGA)
- xlower += (IBUS_KEY_Greek_alpha - IBUS_KEY_Greek_ALPHA);
-- else if (symbol >= IBUS_KEY_Greek_alpha && symbol <= IBUS_KEY_Greek_omega &&
-- symbol != IBUS_KEY_Greek_finalsmallsigma)
-+ else if (symbol == IBUS_KEY_Greek_finalsmallsigma)
-+ xupper = IBUS_KEY_Greek_SIGMA;
-+ else if (symbol >= IBUS_KEY_Greek_alpha && symbol <= IBUS_KEY_Greek_omega)
- xupper -= (IBUS_KEY_Greek_alpha - IBUS_KEY_Greek_ALPHA);
- break;
- }
---
-2.24.1
-
-From 74863851e83972e86a5bdb3da3d99784fc8d4955 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 28 Jan 2020 18:46:13 +0900
-Subject: [PATCH 3/5] src/tests: Increase sleep to 3 waiting for IBusConfig
-
-Sleep 1 would be too short for ibus-daemon which could run all components.
-ibus-config test requires the running IBusConfig and the test could fail
-in some slow systems.
-Sleep time will be increased to 3 to run all components.
-
-BUG=https://github.com/ibus/ibus/issues/2170
----
- src/tests/ibus-config.c | 4 ++++
- src/tests/ibus-desktop-testing-runner.in | 2 +-
- src/tests/runtest | 2 +-
- 3 files changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/src/tests/ibus-config.c b/src/tests/ibus-config.c
-index 5e845f10..0d9812a3 100644
---- a/src/tests/ibus-config.c
-+++ b/src/tests/ibus-config.c
-@@ -16,6 +16,10 @@ finish_create_config_async_success (GObject *source_object,
- IBusConfig *config =
- ibus_config_new_async_finish (res, &error);
-
-+ if (error) {
-+ g_message ("Failed to generate IBusConfig: %s", error->message);
-+ g_error_free (error);
-+ }
- g_assert (IBUS_IS_CONFIG (config));
-
- /* Since we reuse single D-Bus connection, we need to remove the
-diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
-index 981941d5..0d9a847c 100755
---- a/src/tests/ibus-desktop-testing-runner.in
-+++ b/src/tests/ibus-desktop-testing-runner.in
-@@ -190,7 +190,7 @@ run_desktop()
- HAS_GNOME=`echo $DESKTOP_COMMAND | grep gnome-session`
- if [ x"$HAS_GNOME" = x ] ; then
- ibus-daemon --daemonize --verbose
-- sleep 1
-+ sleep 3
- fi
- }
-
-diff --git a/src/tests/runtest b/src/tests/runtest
-index ed38992f..a6e4194b 100755
---- a/src/tests/runtest
-+++ b/src/tests/runtest
-@@ -180,7 +180,7 @@ run_test_case()
- fi
-
- # Wait until all necessary components are up.
-- sleep 1
-+ sleep 3
-
- export GTK_IM_MODULE=ibus
- fi
---
-2.24.1
-
-From cd4fef5a3290869fc1c36392f5d404fa09932926 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 31 Jan 2020 15:35:02 +0900
-Subject: [PATCH 4/5] src: Fix SEGV to access NULL GError when compose length
- is zero
-
-BUG=rhbz#1788754
----
- src/ibuscomposetable.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index e4e3a7cd..3f439134 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -127,12 +127,14 @@ parse_compose_value (IBusComposeData *compose_data,
- compose_data->values[0] = g_ascii_strtoll(p, NULL, 8);
- compose_data->values[1] = 0;
- } else {
-- if (!(uchars = g_utf8_to_ucs4 (ustr, -1, NULL, NULL, &error)) ||
-- !uchars[0]) {
-+ if (!(uchars = g_utf8_to_ucs4 (ustr, -1, NULL, NULL, &error))) {
- g_warning ("Invalid Unicode: %s: %s in %s:",
- error->message, ustr, line);
- g_error_free (error);
- goto fail;
-+ } else if (!uchars[0]) {
-+ g_warning ("Invalid Unicode: \"\" in %s:", line);
-+ goto fail;
- }
-
- for (up = uchars; *up; up++) {
---
-2.24.1
-
-From a1705ad7e5f90cf8d87caf32d7b7acc7125e6778 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 13 Feb 2020 16:49:12 +0900
-Subject: [PATCH 5/5] bus: Fix recursive mkdir is failed in
- /var/lib/gdm/.cache/ibus
-
-If the parent directory (/var/lib/gdm/.cache) is not created,
-mkdir childdir (/var/lib/gdm/.cache/ibus) is failed by the parentdir
-with mode_t = 0.
-
-BUG=https://github.com/ibus/ibus/issues/2177
----
- bus/server.c | 12 ++++--------
- 1 file changed, 4 insertions(+), 8 deletions(-)
-
-diff --git a/bus/server.c b/bus/server.c
-index a7554a88..6c9e2c02 100644
---- a/bus/server.c
-+++ b/bus/server.c
-@@ -277,17 +277,13 @@ bus_server_init (void)
- socket_address);
- }
- if (!g_file_test (unix_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
-- /* Require mkdir for BSD system. */
-- if (g_mkdir_with_parents (unix_dir, 0) != 0) {
-- g_error ("mkdir is failed in: %s: %s",
-- unix_dir, g_strerror (errno));
-- }
-- /* The mode 0700 can eliminate malicious users change the mode.
-+ /* Require mkdir for BSD system.
-+ * The mode 0700 can eliminate malicious users change the mode.
- * `chmod` runs for the last directory only not to change the modes
- * of the parent directories. E.g. "/tmp/ibus".
- */
-- if (g_chmod (unix_dir, 0700) != 0) {
-- g_error ("chmod(700) is failed in: %s: %s",
-+ if (g_mkdir_with_parents (unix_dir, 0700) != 0) {
-+ g_error ("mkdir is failed in: %s: %s",
- unix_dir, g_strerror (errno));
- }
- }
---
-2.24.1
-
^ permalink raw reply related [flat|nested] 16+ messages in thread* [rpms/ibus] autotool: Delete upstreamed patches
@ 2026-05-31 2:07 Takao Fujiwara
0 siblings, 0 replies; 16+ messages in thread
From: Takao Fujiwara @ 2026-05-31 2:07 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : b2f9c21be91591730c5c0261ba963ac8d802def3
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2019-03-01T21:41:12+09:00
Stats : +0/-4120 in 1 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/b2f9c21be91591730c5c0261ba963ac8d802def3?branch=autotool
Log:
Delete upstreamed patches
---
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 <takao.fujiwara1@gmail.com>
-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<string, GLib.SList<string>>(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<unichar, IBus.UnicodeData>(
- 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<string, GLib.SList<unichar>>(GLib.str_hash,
- GLib.str_equal);
-+ }
- }
-
-
---
-2.17.1
-
-From 28d22176aee6be97d88dd6c60fa5395c79563ec0 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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<string>? 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 <takao.fujiwara1@gmail.com>
-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 <shawn.p.huang@gmail.com>
--# 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 <shawn.p.huang@gmail.com>
--# 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 @@
-+<?xml version="1.0"?>
-+<schemalist>
-+ <schema id="org.freedesktop.ibus" path="/desktop/ibus/">
-+ <child name="general" schema="org.freedesktop.ibus.general"/>
-+ <child name="panel" schema="org.freedesktop.ibus.panel"/>
-+ </schema>
-+ <schema id="org.freedesktop.ibus.general" path="/desktop/ibus/general/">
-+ <key name="preload-engines" type="as">
-+ <default>[]</default>
-+ <summary>Preload engines</summary>
-+ <description>Preload engines during ibus starts up</description>
-+ </key>
-+ <key name="engines-order" type="as">
-+ <default>[]</default>
-+ <summary>Engines order</summary>
-+ <description>Saved engines order in input method list</description>
-+ </key>
-+ <key name="switcher-delay-time" type="i">
-+ <default>400</default>
-+ <summary>Popup delay milliseconds for IME switcher window</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="version" type="s">
-+ <default>''</default>
-+ <summary>Saved version number</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="xkb-latin-layouts" type="as">
-+ <default>[ 'ara', 'bg', 'cz', 'dev', 'gr', 'gur', 'in', 'jp(kana)', 'mal', 'mkd', 'ru', 'ua' ]</default>
-+ <summary>Latin layouts which have no ASCII</summary>
-+ <description>US layout is appended to the Latin layouts. variant can be omitted.</description>
-+ </key>
-+ <key name="use-xmodmap" type="b">
-+ <default>true</default>
-+ <summary>Use xmodmap</summary>
-+ <description>Run xmodmap if .xmodmap or .Xmodmap exists when ibus engines are switched.</description>
-+ </key>
-+ <key name="use-system-keyboard-layout" type="b">
-+ <default>false</default>
-+ <summary>Use system keyboard layout</summary>
-+ <description>Use system keyboard (XKB) layout</description>
-+ </key>
-+ <key name="embed-preedit-text" type="b">
-+ <default>true</default>
-+ <summary>Embed Preedit Text</summary>
-+ <description>Embed Preedit Text in Application Window</description>
-+ </key>
-+ <key name="use-global-engine" type="b">
-+ <default>true</default>
-+ <summary>Use global input method</summary>
-+ <description>Share the same input method among all applications</description>
-+ </key>
-+ <key name="enable-by-default" type="b">
-+ <default>false</default>
-+ <summary>Enable input method by default</summary>
-+ <description>Enable input method by default when the application gets input focus</description>
-+ </key>
-+ <key name="dconf-preserve-name-prefixes" type="as">
-+ <default>[ '/desktop/ibus/engine/pinyin', '/desktop/ibus/engine/bopomofo', '/desktop/ibus/engine/hangul' ]</default>
-+ <summary>DConf preserve name prefixes</summary>
-+ <description>Prefixes of DConf keys to stop name conversion</description>
-+ </key>
-+ <child name="hotkey" schema="org.freedesktop.ibus.general.hotkey"/>
-+ </schema>
-+ <schema id="org.freedesktop.ibus.general.hotkey" path="/desktop/ibus/general/hotkey/">
-+ <key name="trigger" type="as">
-+ <default>[ 'Control+space', 'Zenkaku_Hankaku', 'Alt+Kanji', 'Alt+grave', 'Hangul', 'Alt+Release+Alt_R' ]</default>
-+ <summary>Trigger shortcut keys</summary>
-+ <description>The shortcut keys for turning input method on or off</description>
-+ </key>
-+ <key name="triggers" type="as">
-+ <default>[ '<Super>space' ]</default>
-+ <summary>Trigger shortcut keys for gtk_accelerator_parse</summary>
-+ <description>The shortcut keys for turning input method on or off</description>
-+ </key>
-+ <key name="enable-unconditional" type="as">
-+ <default>[]</default>
-+ <summary>Enable shortcut keys</summary>
-+ <description>The shortcut keys for turning input method on</description>
-+ </key>
-+ <key name="disable-unconditional" type="as">
-+ <default>[]</default>
-+ <summary>Disable shortcut keys</summary>
-+ <description>The shortcut keys for turning input method off</description>
-+ </key>
-+ <key name="next-engine" type="as">
-+ <default>[ 'Alt+Shift_L' ]</default>
-+ <summary>Next engine shortcut keys</summary>
-+ <description>The shortcut keys for switching to the next input method in the list</description>
-+ </key>
-+ <key name="next-engine-in-menu" type="as">
-+ <default>[ 'Alt+Shift_L' ]</default>
-+ <summary>Next engine shortcut keys</summary>
-+ <description>The shortcut keys for switching to the next input method in the list</description>
-+ </key>
-+ <key name="prev-engine" type="as">
-+ <default>[]</default>
-+ <summary>Prev engine shortcut keys</summary>
-+ <description>The shortcut keys for switching to the previous input method</description>
-+ </key>
-+ <key name="previous-engine" type="as">
-+ <default>[]</default>
-+ <summary>Prev engine shortcut keys</summary>
-+ <description>The shortcut keys for switching to the previous input method</description>
-+ </key>
-+ </schema>
-+ <schema id="org.freedesktop.ibus.panel" path="/desktop/ibus/panel/">
-+ <key name="show" type="i">
-+ <default>0</default>
-+ <summary>Auto hide</summary>
-+ <description>The behavior of property panel. 0 = Do not show, 1 = Auto hide, 2 = Always show</description>
-+ </key>
-+ <key name="x" type="i">
-+ <default>-1</default>
-+ <summary>Language panel position</summary>
-+ </key>
-+ <key name="y" type="i">
-+ <default>-1</default>
-+ <summary>Language panel position</summary>
-+ </key>
-+ <key name="follow-input-cursor-when-always-shown" type="b">
-+ <default>false</default>
-+ <summary>Follow the input cursor in case the panel is always shown</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="auto-hide-timeout" type="i">
-+ <default>10000</default>
-+ <summary>The milliseconds to show property panel</summary>
-+ <description>The milliseconds to show property panel after focus-in or properties are changed.</description>
-+ </key>
-+ <key name="lookup-table-orientation" type="i">
-+ <default>1</default>
-+ <summary>Orientation of lookup table</summary>
-+ <description>Orientation of lookup table. 0 = Horizontal, 1 = Vertical</description>
-+ </key>
-+ <key name="show-icon-on-systray" type="b">
-+ <default>true</default>
-+ <summary>Show icon on system tray</summary>
-+ <description>Show icon on system tray</description>
-+ </key>
-+ <key name="show-im-name" type="b">
-+ <default>false</default>
-+ <summary>Show input method name</summary>
-+ <description>Show input method name on language bar</description>
-+ </key>
-+ <key name="xkb-icon-rgba" type="s">
-+ <default>'#415099'</default>
-+ <summary>RGBA value of XKB icon</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="property-icon-delay-time" type="i">
-+ <default>500</default>
-+ <summary>The milliseconds to show the panel icon for a property</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="use-custom-font" type="b">
-+ <default>false</default>
-+ <summary>Use custom font</summary>
-+ <description>Use custom font name for language panel</description>
-+ </key>
-+ <key name="custom-font" type="s">
-+ <default>'Sans 10'</default>
-+ <summary>Custom font</summary>
-+ <description>Custom font name for language panel</description>
-+ </key>
-+ <child name="emoji" schema="org.freedesktop.ibus.panel.emoji"/>
-+ </schema>
-+ <schema id="org.freedesktop.ibus.panel.emoji" path="/desktop/ibus/panel/emoji/">
-+ <key name="unicode-hotkey" type="as">
-+ <default>[ '<Control><Shift>u' ]</default>
-+ <summary>Unicode shortcut keys for gtk_accelerator_parse</summary>
-+ <description>The shortcut keys for turning Unicode typing on or off</description>
-+ </key>
-+ <key name="hotkey" type="as">
-+ <default>[ '<Control><Shift>e' ]</default>
-+ <summary>Emoji shortcut keys for gtk_accelerator_parse</summary>
-+ <description>The shortcut keys for turning emoji typing on or off</description>
-+ </key>
-+ <key name="font" type="s">
-+ <default>'Monospace 16'</default>
-+ <summary>Custom font</summary>
-+ <description>Custom font name for emoji characters on emoji dialog</description>
-+ </key>
-+ <key name="lang" type="s">
-+ <default>'en'</default>
-+ <summary>Default language for emoji dictionary</summary>
-+ <description>Choose a default language of emoji dictionaries on the emoji dialog. The value $lang is applied to /usr/share/ibus/dicts/emoji-$lang.dict</description>
-+ </key>
-+ <key name="favorites" type="as">
-+ <default>[]</default>
-+ <summary>favorite emoji list on emoji dialog</summary>
-+ <description>You can show the favorite emojis on emoji list if this list has any characters.</description>
-+ </key>
-+ <key name="favorite-annotations" type="as">
-+ <default>[]</default>
-+ <summary>favorite emoji annotation list on emoji dialog</summary>
-+ <description>You can assign an annotation for a favorite emoji in this list.</description>
-+ </key>
-+ <key name="has-partial-match" type="b">
-+ <default>false</default>
-+ <summary>Whether emoji annotations can be match partially or not</summary>
-+ <description>Whether emoji annotations can be matched with a partial string instead of the exact match or not.</description>
-+ </key>
-+ <key name="partial-match-length" type="i">
-+ <default>3</default>
-+ <summary>Match emoji annotations with the specified length</summary>
-+ <description>Match emoji annotations partially with more than the specified number of characters instead of the exact match.</description>
-+ </key>
-+ <key name="partial-match-condition" type="i">
-+ <default>0</default>
-+ <summary>Choose a condition to match emoji annotations partially</summary>
-+ <description>Choose one of the following conditions to match emoji annotations partially: 0 == Prefix match, 1 == Suffix match, 2 == Containing match</description>
-+ </key>
-+ <key name="load-emoji-at-startup" type="b">
-+ <default>true</default>
-+ <summary>Load the emoji data at the time of startup</summary>
-+ <description>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.</description>
-+ </key>
-+ <key name="load-unicode-at-startup" type="b">
-+ <default>false</default>
-+ <summary>Load the Unicode data at the time of startup</summary>
-+ <description>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.</description>
-+ </key>
-+ </schema>
-+</schemalist>
---
-2.20.1
-
-From 74a00cc93ba99367e175ad3d3415e585d453d17f Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 @@
--<?xml version="1.0"?>
-+<?xml version="1.0" encoding="UTF-8"?>
- <schemalist>
- <schema id="org.freedesktop.ibus" path="/desktop/ibus/">
- <child name="general" schema="org.freedesktop.ibus.general"/>
-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 <shawn.p.huang@gmail.com>
--# Copyright (c) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
--# Copyright (c) 2007-2017 Red Hat, Inc.
-+# Copyright (c) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# 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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 @@
- <schema id="org.freedesktop.ibus.general" path="/desktop/ibus/general/">
- <key name="preload-engines" type="as">
- <default>[]</default>
-+ <!-- Translators: Here “Preload” is a verb" -->
- <summary>Preload engines</summary>
-+ <!-- Translators: Tooltip for the button “Preload Engines” -->
- <description>Preload engines during ibus starts up</description>
- </key>
- <key name="engines-order" type="as">
---
-2.20.1
-
-From b6086665bcf12914e6e1ac99b606dc6dee363f26 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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 @@
- <schema id="org.freedesktop.ibus.general" path="/desktop/ibus/general/">
- <key name="preload-engines" type="as">
- <default>[]</default>
-- <!-- Translators: Here “Preload” is a verb" -->
-+ <!-- Translators: Here “Preload” is a verb -->
- <summary>Preload engines</summary>
- <!-- Translators: Tooltip for the button “Preload Engines” -->
- <description>Preload engines during ibus starts up</description>
---
-2.20.1
-
-From 3172c3b23faefe76b3b7adfc75f9be34a0fb2e02 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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[] =
- "<node>"
- " <interface name='org.freedesktop.IBus.InputContext'>"
-+ /* properties */
-+ " <property name='ContentType' type='(uu)' access='write' />"
-+ " <property name='ClientCommitPreedit' type='(b)' access='write' />\n"
- /* methods */
- " <method name='ProcessKeyEvent'>"
- " <arg direction='in' type='u' name='keyval' />"
-@@ -273,6 +277,12 @@ static const gchar introspection_xml[] =
- " <arg type='u' name='cursor_pos' />"
- " <arg type='b' name='visible' />"
- " </signal>"
-+ " <signal name='UpdatePreeditTextWithMode'>"
-+ " <arg type='v' name='text' />"
-+ " <arg type='u' name='cursor_pos' />"
-+ " <arg type='b' name='visible' />"
-+ " <arg type='u' name='mode' />"
-+ " </signal>"
- " <signal name='ShowPreeditText'/>"
- " <signal name='HidePreeditText'/>"
- " <signal name='UpdateAuxiliaryText'>"
-@@ -297,9 +307,6 @@ static const gchar introspection_xml[] =
- " <signal name='UpdateProperty'>"
- " <arg type='v' name='prop' />"
- " </signal>"
--
-- /* properties */
-- " <property name='ContentType' type='(uu)' access='write' />"
- " </interface>"
- "</node>";
-
-@@ -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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2014 Red Hat, Inc.
-+ * Copyright (C) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * 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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2015-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2008-2017 Red Hat, Inc.
-+ * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * 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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * 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 <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * 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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <dglassey@gmail.com>
-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 <takao.fujiwara1@gmail.com>
-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 <shawn.p.huang@gmail.com>
--# 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 <takao.fujiwara1@gmail.com>
-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 <bochecha@daitauha.fr>
-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:
-
- <c:include name="ibus.h"/>
-
-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 <takao.fujiwara1@gmail.com>
-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 @@
- <?xml version="1.0"?>
- <!--
-- Copyright (C) 2017 Red Hat, Inc.
-+ Copyright (C) 2017-2019 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
-@@ -97,6 +97,12 @@
- <arg type='u' name='cursor_pos' />
- <arg type='b' name='visible' />
- </signal>
-+ <signal name='UpdatePreeditTextWithMode'>
-+ <arg type='v' name='text' />
-+ <arg type='u' name='cursor_pos' />
-+ <arg type='b' name='visible' />
-+ <arg type='u' name='mode' />
-+ </signal>
- <signal name='ShowPreeditText'/>
- <signal name='HidePreeditText'/>
- <signal name='UpdateAuxiliaryText'>
-@@ -123,6 +129,7 @@
- </signal>
-
- <property name='ContentType' type='(uu)' access='write' />
-+ <property name='ClientCommitPreedit' type='(b)' access='write' />
- </interface>
-
- <interface name='org.freedesktop.IBus.Service'>
-diff --git a/portal/portal.c b/portal/portal.c
-index cb24d257..e78bc92f 100644
---- a/portal/portal.c
-+++ b/portal/portal.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
-- * Copyright (C) 2017 Red Hat, Inc.
-+ * Copyright (C) 2017-2019 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
-@@ -67,6 +67,7 @@ struct _IBusPortalClass
- enum
- {
- PROP_CONTENT_TYPE = 1,
-+ PROP_CLIENT_COMMIT_PREEDIT,
- N_PROPERTIES
- };
-
-@@ -315,6 +316,20 @@ ibus_portal_context_set_property (IBusPortalContext *portal_context,
- NULL /* user_data */
- );
- break;
-+ case PROP_CLIENT_COMMIT_PREEDIT:
-+ g_dbus_proxy_call (G_DBUS_PROXY (portal_context->context),
-+ "org.freedesktop.DBus.Properties.Set",
-+ g_variant_new ("(ssv)",
-+ IBUS_INTERFACE_INPUT_CONTEXT,
-+ "ClientCommitPreedit",
-+ g_value_get_variant (value)),
-+ G_DBUS_CALL_FLAGS_NONE,
-+ -1,
-+ NULL, /* cancellable */
-+ NULL, /* callback */
-+ NULL /* user_data */
-+ );
-+ break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (portal_context, prop_id, pspec);
- }
-@@ -328,6 +343,7 @@ ibus_portal_context_get_property (IBusPortalContext *portal_context,
- {
- switch (prop_id) {
- case PROP_CONTENT_TYPE:
-+ case PROP_CLIENT_COMMIT_PREEDIT:
- g_warning ("No support for setting content type");
- break;
- default:
---
-2.19.1
-
-From be7fb813e530442897a9f9130b8a26380e5a12a1 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Tue, 8 Jan 2019 12:02:37 +0900
-Subject: [PATCH] client/gtk2: Fix Atom and Slack for Flatpak
-
-Seems Atom, slack, com.visualstudio.code does not enable
-gtk_key_snooper_install() and this issue causes to call
-gtk_im_context_filter_keypress instead of calling ibus APIs.
-
-BUG=https://github.com/ibus/ibus/issues/1991
----
- client/gtk2/ibusimcontext.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index f9310867..264a747a 100644
---- a/client/gtk2/ibusimcontext.c
-+++ b/client/gtk2/ibusimcontext.c
-@@ -565,6 +565,10 @@ daemon_name_appeared (GDBusConnection *connection,
- const gchar *owner,
- gpointer data)
- {
-+ if (!g_strcmp0 (ibus_bus_get_service_name (_bus), IBUS_SERVICE_PORTAL)) {
-+ _daemon_is_running = TRUE;
-+ return;
-+ }
- /* If ibus-daemon is running and run ssh -X localhost,
- * daemon_name_appeared() is called but ibus_get_address() == NULL
- * because the hostname and display number are different between
---
-2.19.1
-
-From 0f5084e07c215d74adc4eeeda40b374855cce59a Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 11 Jan 2019 12:56:42 +0900
-Subject: [PATCH] src/ibuscomposetable: Replace assert with warning for
- .XCompose
-
-BUG=rhbz#1470673
----
- src/ibuscomposetable.c | 12 +++++++-----
- 1 file changed, 7 insertions(+), 5 deletions(-)
-
-diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
-index b843e7e1..1c0ece41 100644
---- a/src/ibuscomposetable.c
-+++ b/src/ibuscomposetable.c
-@@ -1,7 +1,7 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* ibus - The Input Bus
- * Copyright (C) 2013-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2013-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2013-2019 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
-@@ -98,14 +98,16 @@ parse_compose_value (IBusComposeData *compose_data,
- uch = words[1][1];
-
- /* The escaped string "\"" is separated with '\\' and '"'. */
-- if (uch == '\0' && words[2][0] == '"')
-+ if (uch == '\0' && words[2][0] == '"') {
- uch = '"';
- /* The escaped octal */
-- else if (uch >= '0' && uch <= '8')
-+ } else if (uch >= '0' && uch <= '8') {
- uch = g_ascii_strtoll(words[1] + 1, NULL, 8);
- /* If we need to handle other escape sequences. */
-- else if (uch != '\\')
-- g_assert_not_reached ();
-+ } else if (uch != '\\') {
-+ g_warning ("Invalid backslash: %s: %s", val, line);
-+ goto fail;
-+ }
- }
-
- if (g_utf8_get_char (g_utf8_next_char (words[1])) > 0) {
---
-2.19.1
-
-From 9669a812a025e2c6bcac3f2262c6cfed8fff7db4 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Thu, 17 Jan 2019 16:12:49 +0900
-Subject: [PATCH] Delete weak pointer in GList.SList for vala 0.43.4
-
-Vala 0.43.4 does not allow to convert a weak pointer to the full one in SList.
-
-emojier.vala:424.36-425.73: error: Assignment: Cannot convert from
-`GLib.SList<weak IBus.EmojiData>' to `GLib.SList<IBus.EmojiData>?'
-emojier.vala:636.9-637.69: error: Assignment: Cannot convert from
-`GLib.SList<weak IBus.UnicodeBlock>' to `GLib.SList<IBus.UnicodeBlock>'
-panel.vala:526.36-526.65: error: Assignment: Cannot convert from
-`GLib.List<weak IBus.EngineDesc>' to `GLib.List<IBus.EngineDesc>?'
----
- src/ibusbus.h | 11 ++++++-----
- src/ibusemoji.h | 6 +++---
- src/ibusunicode.h | 8 ++++----
- ui/gtk3/emojier.vala | 24 ++++++++++++++++--------
- 4 files changed, 29 insertions(+), 20 deletions(-)
-
-diff --git a/src/ibusbus.h b/src/ibusbus.h
-index dff3dfb7..fddcf5b2 100644
---- a/src/ibusbus.h
-+++ b/src/ibusbus.h
-@@ -2,7 +2,8 @@
- /* vim:set et sts=4: */
- /* ibus - The Input Bus
- * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright (C) 2008-2013 Red Hat, Inc.
-+ * Copyright (C) 2013-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2008-2019 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
-@@ -692,7 +693,7 @@ gboolean ibus_bus_register_component_async_finish
- *
- * List engines synchronously.
- *
-- * Returns: (transfer container) (element-type IBusEngineDesc):
-+ * Returns: (transfer full) (element-type IBusEngineDesc):
- * A List of engines.
- */
- GList *ibus_bus_list_engines (IBusBus *bus);
-@@ -725,7 +726,7 @@ void ibus_bus_list_engines_async
- *
- * Finishes an operation started with ibus_bus_list_engines_async().
- *
-- * Returns: (transfer container) (element-type IBusEngineDesc):
-+ * Returns: (transfer full) (element-type IBusEngineDesc):
- * A List of engines.
- */
- GList *ibus_bus_list_engines_async_finish
-@@ -740,7 +741,7 @@ GList *ibus_bus_list_engines_async_finish
- *
- * List active engines synchronously.
- *
-- * Returns: (transfer container) (element-type IBusEngineDesc):
-+ * Returns: (transfer full) (element-type IBusEngineDesc):
- * A List of active engines.
- *
- * Deprecated: 1.5.3: Read dconf value
-@@ -782,7 +783,7 @@ void ibus_bus_list_active_engines_async
- *
- * Finishes an operation started with ibus_bus_list_active_engines_async().
- *
-- * Returns: (transfer container) (element-type IBusEngineDesc):
-+ * Returns: (transfer full) (element-type IBusEngineDesc):
- * A List of active engines.
- *
- * Deprecated: 1.5.3: Read dconf value
-diff --git a/src/ibusemoji.h b/src/ibusemoji.h
-index 4edee726..5e9fbcf4 100644
---- a/src/ibusemoji.h
-+++ b/src/ibusemoji.h
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2017 Red Hat, Inc.
-+ * Copyright (C) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2017-2019 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
-@@ -209,7 +209,7 @@ void ibus_emoji_data_save (const gchar *path,
- * ibus_emoji_data_load:
- * @path: A path of the saved dictionary file.
- *
-- * Returns: (element-type IBusEmojiData) (transfer container):
-+ * Returns: (element-type IBusEmojiData) (transfer full):
- * An #IBusEmojiData list loaded from the saved cache file.
- */
- GSList * ibus_emoji_data_load (const gchar *path);
-diff --git a/src/ibusunicode.h b/src/ibusunicode.h
-index 99de9451..473bdb19 100644
---- a/src/ibusunicode.h
-+++ b/src/ibusunicode.h
-@@ -1,8 +1,8 @@
- /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */
- /* vim:set et sts=4: */
- /* bus - The Input Bus
-- * Copyright (C) 2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-- * Copyright (C) 2018 Red Hat, Inc.
-+ * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (C) 2018-2019 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
-@@ -201,7 +201,7 @@ void ibus_unicode_data_save (const gchar *path,
- * #IBusUnicodeData, * the total number of #IBusUnicodeData) of uint values
- * with that signal by 100 times. Otherwise %NULL.
- *
-- * Returns: (element-type IBusUnicodeData) (transfer container):
-+ * Returns: (element-type IBusUnicodeData) (transfer full):
- * An #IBusUnicodeData list loaded from the saved cache file.
- */
- GSList * ibus_unicode_data_load (const gchar *path,
-@@ -290,7 +290,7 @@ void ibus_unicode_block_save (const gchar *path,
- * ibus_unicode_block_load:
- * @path: A path of the saved dictionary file.
- *
-- * Returns: (element-type IBusUnicodeBlock) (transfer container):
-+ * Returns: (element-type IBusUnicodeBlock) (transfer full):
- * An #IBusUnicodeBlock list loaded from the saved cache file.
- */
- GSList * ibus_unicode_block_load (const gchar *path);
-diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
-index 0b9b54a9..aedeb4cb 100644
---- a/ui/gtk3/emojier.vala
-+++ b/ui/gtk3/emojier.vala
-@@ -2,7 +2,7 @@
- *
- * ibus - The Input Bus
- *
-- * Copyright (c) 2017-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+ * Copyright (c) 2017-2019 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
-@@ -882,8 +882,13 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- update_unicode_blocks();
- return;
- } else {
-- unowned GLib.SList<unowned string> emojis =
-- m_category_to_emojis_dict.lookup(category);
-+ // Use copy_deep() since vala 0.43.4 does not allow to assign
-+ // a weak pointer to the full one in SList:
-+ // emojier.vala:885.48-886.62: error: Assignment: Cannot convert
-+ // from `GLib.SList<string>' to `GLib.SList<weak string>?'
-+ GLib.SList<string> emojis =
-+ m_category_to_emojis_dict.lookup(category).copy_deep(
-+ GLib.strdup);
- m_lookup_table.clear();
- m_candidate_panel_mode = true;
- foreach (unowned string emoji in emojis) {
-@@ -1547,8 +1552,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- m_vbox.add(widget);
- widget.show_all();
- }
-- unowned GLib.SList<unowned string>? annotations =
-- data.get_annotations();
-+ GLib.SList<string> annotations =
-+ data.get_annotations().copy_deep(GLib.strdup);
- var buff = new GLib.StringBuilder();
- int i = 0;
- foreach (unowned string annotation in annotations) {
-@@ -2001,17 +2006,20 @@ public class IBusEmojier : Gtk.ApplicationWindow {
- ) as IBus.EmojiData;
- m_emoji_to_data_dict.insert(favorite, new_data);
- } else {
-- unowned GLib.SList<string> annotations = data.get_annotations();
-+ GLib.SList<string> annotations =
-+ data.get_annotations().copy_deep(GLib.strdup);
- if (annotations.find_custom(annotation, GLib.strcmp) == null) {
- annotations.append(annotation);
-- data.set_annotations(annotations.copy());
-+ data.set_annotations(annotations.copy_deep(GLib.strdup));
- }
- }
- unowned GLib.SList<string> emojis =
- m_annotation_to_emojis_dict.lookup(annotation);
- if (emojis.find_custom(favorite, GLib.strcmp) == null) {
- emojis.append(favorite);
-- m_annotation_to_emojis_dict.replace(annotation, emojis.copy());
-+ m_annotation_to_emojis_dict.replace(
-+ annotation,
-+ emojis.copy_deep(GLib.strdup));
- }
- }
- }
---
-2.19.1
-
-From 4592ce512fd830e646beec0f7aa21add739bb6fa Mon Sep 17 00:00:00 2001
-From: bmansurov <45986298+bmansurov@users.noreply.github.com>
-Date: Tue, 29 Jan 2019 18:02:04 +0900
-Subject: [PATCH] engine: Add Uzbek layouts
-
-BUG=https://github.com/ibus/ibus/pull/2069
----
- engine/simple.xml.in | 83 +++++++++++++++++++++++++++++++-------------
- 1 file changed, 59 insertions(+), 24 deletions(-)
-
-diff --git a/engine/simple.xml.in b/engine/simple.xml.in
-index f35d7a58..4445c254 100644
---- a/engine/simple.xml.in
-+++ b/engine/simple.xml.in
-@@ -680,32 +680,67 @@
- <longname>Ukrainian</longname>
- <description>Ukrainian</description>
- <icon>ibus-keyboard</icon>
-- <rank>99</rank>
-- </engine>
-- <engine>
-- <name>xkb:gb:extd:eng</name>
-- <language>en</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb</layout>
-- <layout_variant>extd</layout_variant>
-- <longname>English (UK, extended WinKeys)</longname>
-- <description>English (UK, extended WinKeys)</description>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:uz::uzb</name>
-+ <language>uz</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>uz</layout>
-+ <longname>Uzbek</longname>
-+ <description>Uzbek</description>
- <icon>ibus-keyboard</icon>
-- <rank>1</rank>
-- </engine>
-- <engine>
-- <name>xkb:gb:dvorak:eng</name>
-- <language>en</language>
-- <license>GPL</license>
-- <author>Peng Huang <shawn.p.huang@gmail.com></author>
-- <layout>gb</layout>
-- <layout_variant>dvorak</layout_variant>
-- <longname>English (UK, Dvorak)</longname>
-- <description>English (UK, Dvorak)</description>
-+ <rank>99</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:uz:cyrillic:uzb</name>
-+ <language>uz</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>uz</layout>
-+ <layout_variant>cyrillic</layout_variant>
-+ <longname>Uzbek Cyrillic</longname>
-+ <description>Uzbek Cyrillic</description>
- <icon>ibus-keyboard</icon>
-- <rank>1</rank>
-- </engine>
-+ <rank>1</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:uz:latin:uzb</name>
-+ <language>uz</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>uz</layout>
-+ <layout_variant>latin</layout_variant>
-+ <longname>Uzbek Latin</longname>
-+ <description>Uzbek Latin</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:gb:extd:eng</name>
-+ <language>en</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>gb</layout>
-+ <layout_variant>extd</layout_variant>
-+ <longname>English (UK, extended WinKeys)</longname>
-+ <description>English (UK, extended WinKeys)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
-+ <engine>
-+ <name>xkb:gb:dvorak:eng</name>
-+ <language>en</language>
-+ <license>GPL</license>
-+ <author>Peng Huang <shawn.p.huang@gmail.com></author>
-+ <layout>gb</layout>
-+ <layout_variant>dvorak</layout_variant>
-+ <longname>English (UK, Dvorak)</longname>
-+ <description>English (UK, Dvorak)</description>
-+ <icon>ibus-keyboard</icon>
-+ <rank>1</rank>
-+ </engine>
- <engine>
- <name>xkb:my::msa</name>
- <language>ms</language>
---
-2.19.1
-
-From 4d3a8ff3d0bf69508551e65ae2dae676919a728d Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 13 Feb 2019 16:00:42 +0900
-Subject: [PATCH] Delete Super-space notification
-
-I'd assume most IBus 1.5.2 users are migrated to the latest 1.5.z now
-but the notification dialog gives much attention and could be deprecated.
-
-BUG=https://github.com/ibus/ibus/issues/2080
----
- configure.ac | 20 ++------------------
- ui/gtk3/Makefile.am | 19 ++-----------------
- ui/gtk3/panel.vala | 28 +---------------------------
- 3 files changed, 5 insertions(+), 62 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 77823c3c..0790d994 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -3,8 +3,8 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
--# Copyright (c) 2007-2018 Red Hat, Inc.
-+# Copyright (c) 2015-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2007-2019 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
-@@ -588,21 +588,6 @@ if test x"$enable_engine" = x"yes"; then
- enable_engine="yes (enabled, use --disable-engine to disable)"
- fi
-
--# --disable-libnotify
--AC_ARG_ENABLE(libnotify,
-- AS_HELP_STRING([--disable-libnotify],
-- [Disable to link libnotify]),
-- [enable_libnotify=$enableval],
-- [enable_libnotify=yes]
--)
--AM_CONDITIONAL([ENABLE_LIBNOTIFY], [test x"$enable_libnotify" = x"yes"])
--if test x"$enable_libnotify" = x"yes"; then
-- PKG_CHECK_MODULES(LIBNOTIFY, [
-- libnotify >= 0.7
-- ])
-- enable_libnotify="yes (enabled, use --disable-libnotify to disable)"
--fi
--
- PKG_CHECK_MODULES(XTEST,
- [x11 xtst],
- [enable_xtest=yes],
-@@ -782,7 +767,6 @@ Build options:
- No snooper regexes "$NO_SNOOPER_APPS"
- Panel icon "$IBUS_ICON_KEYBOARD"
- Enable surrounding-text $enable_surrounding_text
-- Enable libnotify $enable_libnotify
- Enable Emoji dict $enable_emoji_dict
- Unicode Emoji directory $UNICODE_EMOJI_DIR
- CLDR annotation directory $EMOJI_ANNOTATION_DIR
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index e40971f1..d0fa7c58 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -3,8 +3,8 @@
- # ibus - The Input Bus
- #
- # Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
--# Copyright (c) 2015-2018 Takao Fujwiara <takao.fujiwara1@gmail.com>
--# Copyright (c) 2007-2018 Red Hat, Inc.
-+# Copyright (c) 2015-2019 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+# Copyright (c) 2007-2019 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
-@@ -81,21 +81,6 @@ AM_VALAFLAGS = \
- --target-glib="$(VALA_TARGET_GLIB_VERSION)" \
- $(NULL)
-
--if ENABLE_LIBNOTIFY
--AM_CFLAGS += \
-- @LIBNOTIFY_CFLAGS@ \
-- $(NULL)
--
--AM_LDADD += \
-- @LIBNOTIFY_LIBS@ \
-- $(NULL)
--
--AM_VALAFLAGS += \
-- --pkg=libnotify \
-- -D ENABLE_LIBNOTIFY \
-- $(NULL)
--endif
--
- if ENABLE_APPINDICATOR
- AM_VALAFLAGS += --define=INDICATOR
- endif
-diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
-index 4c3b00ca..2054658e 100644
---- a/ui/gtk3/panel.vala
-+++ b/ui/gtk3/panel.vala
-@@ -3,7 +3,7 @@
- * ibus - The Input Bus
- *
- * Copyright(c) 2011-2014 Peng Huang <shawn.p.huang@gmail.com>
-- * Copyright(c) 2015-2018 Takao Fujwiara <takao.fujiwara1@gmail.com>
-+ * Copyright(c) 2015-2019 Takao Fujwiara <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
-@@ -700,29 +700,6 @@ class Panel : IBus.PanelService {
- return -1;
- }
-
-- private void update_version_1_5_3() {
--#if ENABLE_LIBNOTIFY
-- if (!Notify.is_initted()) {
-- Notify.init ("ibus");
-- }
--
-- var notification = new Notify.Notification(
-- _("IBus Update"),
-- _("Super+space is now the default hotkey."),
-- "ibus");
-- notification.set_timeout(30 * 1000);
-- notification.set_category("hotkey");
--
-- try {
-- notification.show();
-- } catch (GLib.Error e){
-- warning ("Notification is failed for IBus 1.5.3: %s", e.message);
-- }
--#else
-- warning(_("Super+space is now the default hotkey."));
--#endif
-- }
--
- private void update_version_1_5_8() {
- inited_engines_order = false;
- }
-@@ -731,9 +708,6 @@ class Panel : IBus.PanelService {
- string prev_version = m_settings_general.get_string("version");
- string current_version = null;
-
-- if (compare_versions(prev_version, "1.5.3") < 0)
-- update_version_1_5_3();
--
- if (compare_versions(prev_version, "1.5.8") < 0)
- update_version_1_5_8();
-
---
-2.20.1
-
-From b30eb5de95413c3977899fdddd04de6872dae991 Mon Sep 17 00:00:00 2001
-From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Fri, 22 Feb 2019 18:40:14 +0900
-Subject: [PATCH] Delete underscore in _Name in *.desktop for gettext migration
-
----
- po/Makevars | 2 +-
- setup/Makefile.am | 26 +++++++++++++++-----------
- setup/ibus-setup.desktop | 4 ++--
- ui/gtk3/Makefile.am | 1 -
- ui/gtk3/ibus-extension-gtk3.desktop.in | 2 +-
- ui/gtk3/ibus-ui-emojier.desktop.in | 2 +-
- 6 files changed, 20 insertions(+), 17 deletions(-)
-
-diff --git a/po/Makevars b/po/Makevars
-index 8cf0b78a..d3fbeab2 100644
---- a/po/Makevars
-+++ b/po/Makevars
-@@ -1,7 +1,7 @@
- # Makefile variables for PO directory in any package using GNU gettext.
-
- # Usually the message domain is the same as the package name.
--DOMAIN = $(PACKAGE)
-+DOMAIN = $(shell grep "GETTEXT_PACKAGE.*=" $(top_srcdir)/configure.ac | sed -e 's/\(.*\)=[ ]*\(.*\)/\2/')
-
- # These two variables depend on the location of this directory.
- subdir = po
-diff --git a/setup/Makefile.am b/setup/Makefile.am
-index 17d80c51..cb4dd8d1 100644
---- a/setup/Makefile.am
-+++ b/setup/Makefile.am
-@@ -40,8 +40,11 @@ ibussetup_DATA = \
- bin_SCRIPTS = ibus-setup
- ibussetupdir = $(pkgdatadir)/setup
-
--desktop_DATA = ibus-setup.desktop
-+desktop_notrans_files = ibus-setup.desktop
-+desktop_DATA = org.freedesktop.IBus.Setup.desktop
- desktopdir = $(datadir)/applications
-+org.freedesktop.IBus.Setup.desktop: ibus-setup.desktop
-+ $(AM_V_GEN) $(MSGFMT) --desktop --template $< -d $(top_srcdir)/po -o $@
-
- man_one_in_files = ibus-setup.1.in
- man_one_files = $(man_one_in_files:.1.in=.1)
-@@ -55,18 +58,19 @@ man_onedir = $(mandir)/man1
- $(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@
-
- CLEANFILES = \
-- $(man_one_DATA) \
-- $(man_one_files) \
-- *.pyc \
-- ibus-setup \
-- $(NULL)
-+ $(desktop_DATA) \
-+ $(man_one_DATA) \
-+ $(man_one_files) \
-+ *.pyc \
-+ ibus-setup \
-+ $(NULL)
-
- EXTRA_DIST = \
-- $(man_one_in_files) \
-- ibus-setup.in \
-- setup.ui \
-- ibus-setup.desktop \
-- $(NULL)
-+ $(desktop_notrans_files) \
-+ $(man_one_in_files) \
-+ ibus-setup.in \
-+ setup.ui \
-+ $(NULL)
-
- test:
- $(ENV_IBUS_TEST) \
-diff --git a/setup/ibus-setup.desktop b/setup/ibus-setup.desktop
-index 864b026e..0608a68f 100644
---- a/setup/ibus-setup.desktop
-+++ b/setup/ibus-setup.desktop
-@@ -1,6 +1,6 @@
- [Desktop Entry]
--_Name=IBus Preferences
--_Comment=Set IBus Preferences
-+Name=IBus Preferences
-+Comment=Set IBus Preferences
- Exec=ibus-setup
- Icon=ibus-setup
- Terminal=false
-diff --git a/ui/gtk3/Makefile.am b/ui/gtk3/Makefile.am
-index d0fa7c58..60205aa5 100644
---- a/ui/gtk3/Makefile.am
-+++ b/ui/gtk3/Makefile.am
-@@ -262,7 +262,6 @@ desktop_DATA = \
- desktopdir = $(datadir)/applications
- %.desktop: %.desktop.in
- $(AM_V_GEN) sed \
-- -e 's|^_Name=|Name=|g' \
- -e 's|@libexecdir[@]|$(libexecdir)|g' $< > $@.tmp && \
- mv $@.tmp $@
- $(NULL)
-diff --git a/ui/gtk3/ibus-extension-gtk3.desktop.in b/ui/gtk3/ibus-extension-gtk3.desktop.in
-index a119ec8e..5e0e910d 100644
---- a/ui/gtk3/ibus-extension-gtk3.desktop.in
-+++ b/ui/gtk3/ibus-extension-gtk3.desktop.in
-@@ -1,5 +1,5 @@
- [Desktop Entry]
--_Name=Emoji Choice
-+Name=Emoji Choice
- Icon=ibus
- Exec=@libexecdir@/ibus-extension-gtk3
- Type=Application
-diff --git a/ui/gtk3/ibus-ui-emojier.desktop.in b/ui/gtk3/ibus-ui-emojier.desktop.in
-index 6d9422d5..f65fe3d8 100644
---- a/ui/gtk3/ibus-ui-emojier.desktop.in
-+++ b/ui/gtk3/ibus-ui-emojier.desktop.in
-@@ -1,5 +1,5 @@
- [Desktop Entry]
--_Name=Emoji Choice
-+Name=Emoji Choice
- Icon=ibus
- Exec=ibus emoji
- Type=Application
---
-2.20.1
-
^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-05-31 2:09 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 2:07 [rpms/ibus] autotool: Delete upstreamed patches Takao Fujiwara
-- strict thread matches above, loose matches on Subject: below --
2026-05-31 2:09 Takao Fujiwara
2026-05-31 2:09 Takao Fujiwara
2026-05-31 2:09 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:08 [rpms/ibus] autotool: Delete Upstreamed patches Takao Fujiwara
2026-05-31 2:08 [rpms/ibus] autotool: Delete upstreamed patches Takao Fujiwara
2026-05-31 2:08 Takao Fujiwara
2026-05-31 2:07 Takao Fujiwara
2026-05-31 2:07 Takao Fujiwara
2026-05-31 2:07 Takao Fujiwara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox