diff --git a/ibus-1.5.26.tar.gz b/ibus-1.5.26.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7c025b340a2d6ac7db971fdab3d71fb70ac0a586 Binary files /dev/null and b/ibus-1.5.26.tar.gz differ diff --git a/ibus-1385349-segv-bus-proxy.patch b/ibus-1385349-segv-bus-proxy.patch new file mode 100644 index 0000000000000000000000000000000000000000..91ca4a781c7fd9c90c3ae147c7cee36901fc06f6 --- /dev/null +++ b/ibus-1385349-segv-bus-proxy.patch @@ -0,0 +1,403 @@ +From 41c325dfb32269c9aadfeedb4df44656aac4d883 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Fri, 20 Nov 2020 09:53:54 +0900 +Subject: [PATCH] Fix SEGV in bus_panel_proxy_focus_in() + +rhbz#1350291 SEGV in BUS_IS_CONNECTION(skip_connection) in +bus_dbus_impl_dispatch_message_by_rule() +check if dbus_connection is closed in bus_dbus_impl_connection_filter_cb(). + +rhbz#1767976 SEGV in assert(connection != NULL) in +bus_dbus_impl_connection_filter_cb() +call bus_connection_set_filter() in bus_dbus_impl_destroy(). + +rhbz#1601577 rhbz#1797726 SEGV in ibus_engine_desc_get_layout() in +bus_engine_proxy_new_internal() +WIP: Added a GError to get the error message to check why the SEGV happened. + +rhbz#1663528 SEGV in g_mutex_clear() in bus_dbus_impl_destroy() +If the mutex is not unlocked, g_mutex_clear() causes assert. + +rhbz#1767691 SEGV in client/x11/main.c:_sighandler(). +Do not call atexit functions in _sighandler(). + +rhbz#1795499 SEGV in ibus_bus_get_bus_address() because of no _bus->priv. +_changed_cb() should not be called after ibus_bus_destroy() is called. + +rhbz#1771238 SEGV in assert(m_loop == null) in switcher.vala. +Grabbing keyboard could be failed and switcher received the keyboard +events and m_loop was not released. + +rhbz#1797120 SEGV in assert(bus.is_connected()) in panel_binding_construct() +Check m_ibus in extension.vala:bus_name_acquired_cb() + +BUG=rhbz#1350291 +BUG=rhbz#1601577 +BUG=rhbz#1663528 +BUG=rhbz#1767691 +BUG=rhbz#1795499 +BUG=rhbz#1771238 +BUG=rhbz#1767976 +BUG=rhbz#1797120 +--- + bus/dbusimpl.c | 47 ++++++++++++++++++++++++--- + bus/engineproxy.c | 51 ++++++++++++++++++++++------- + client/x11/main.c | 8 ++++- + src/ibusbus.c | 5 +++ + ui/gtk3/extension.vala | 4 +++ + ui/gtk3/switcher.vala | 73 +++++++++++++++++++++++++----------------- + 6 files changed, 141 insertions(+), 47 deletions(-) + +diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c +index 59787a80..af2fbde2 100644 +--- a/bus/dbusimpl.c ++++ b/bus/dbusimpl.c +@@ -610,6 +610,7 @@ static void + bus_dbus_impl_destroy (BusDBusImpl *dbus) + { + GList *p; ++ int i; + + for (p = dbus->objects; p != NULL; p = p->next) { + IBusService *object = (IBusService *) p->data; +@@ -633,6 +634,10 @@ bus_dbus_impl_destroy (BusDBusImpl *dbus) + + for (p = dbus->connections; p != NULL; p = p->next) { + BusConnection *connection = BUS_CONNECTION (p->data); ++ /* rhbz#1767976 Fix connection == NULL in ++ * bus_dbus_impl_connection_filter_cb() ++ */ ++ bus_connection_set_filter (connection, NULL, NULL, NULL); + g_signal_handlers_disconnect_by_func (connection, + bus_dbus_impl_connection_destroy_cb, dbus); + ibus_object_destroy (IBUS_OBJECT (connection)); +@@ -647,12 +652,39 @@ bus_dbus_impl_destroy (BusDBusImpl *dbus) + dbus->unique_names = NULL; + dbus->names = NULL; + ++ for (i = 0; g_idle_remove_by_data (dbus); i++) { ++ if (i > 1000) { ++ g_warning ("Too many idle threads were generated by " \ ++ "bus_dbus_impl_forward_message_idle_cb and " \ ++ "bus_dbus_impl_dispatch_message_by_rule_idle_cb"); ++ break; ++ } ++ } + g_list_free_full (dbus->start_service_calls, + (GDestroyNotify) bus_method_call_free); + dbus->start_service_calls = NULL; + +- g_mutex_clear (&dbus->dispatch_lock); +- g_mutex_clear (&dbus->forward_lock); ++ /* rhbz#1663528 Call g_mutex_trylock() before g_mutex_clear() ++ * because if the mutex is not unlocked, g_mutex_clear() causes assert. ++ */ ++#define BUS_DBUS_MUTEX_SAFE_CLEAR(mtex) { \ ++ int count = 0; \ ++ while (!g_mutex_trylock ((mtex))) { \ ++ g_usleep (1); \ ++ if (count > 60) { \ ++ g_warning (#mtex " is dead lock"); \ ++ break; \ ++ } \ ++ ++count; \ ++ } \ ++ g_mutex_unlock ((mtex)); \ ++ g_mutex_clear ((mtex)); \ ++} ++ ++ BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->dispatch_lock); ++ BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->forward_lock); ++ ++#undef BUS_DBUS_MUTEX_SAFE_CLEAR + + /* FIXME destruct _lock and _queue members. */ + IBUS_OBJECT_CLASS(bus_dbus_impl_parent_class)->destroy ((IBusObject *) dbus); +@@ -1483,13 +1515,20 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection, + gboolean incoming, + gpointer user_data) + { ++ BusDBusImpl *dbus; ++ BusConnection *connection; ++ + g_assert (G_IS_DBUS_CONNECTION (dbus_connection)); + g_assert (G_IS_DBUS_MESSAGE (message)); + g_assert (BUS_IS_DBUS_IMPL (user_data)); + +- BusDBusImpl *dbus = (BusDBusImpl *) user_data; +- BusConnection *connection = bus_connection_lookup (dbus_connection); ++ if (g_dbus_connection_is_closed (dbus_connection)) ++ return NULL; ++ ++ dbus = (BusDBusImpl *) user_data; ++ connection = bus_connection_lookup (dbus_connection); + g_assert (connection != NULL); ++ g_assert (BUS_IS_CONNECTION (connection)); + + if (incoming) { + /* is incoming message */ +diff --git a/bus/engineproxy.c b/bus/engineproxy.c +index 2d98995c..bbbe5532 100644 +--- a/bus/engineproxy.c ++++ b/bus/engineproxy.c +@@ -660,20 +660,33 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy, + g_return_if_reached (); + } + ++#pragma GCC optimize ("O0") + static BusEngineProxy * + bus_engine_proxy_new_internal (const gchar *path, + IBusEngineDesc *desc, +- GDBusConnection *connection) ++ GDBusConnection *connection, ++ GError **error) + { ++ GDBusProxyFlags flags; ++ BusEngineProxy *engine; ++ + g_assert (path); + g_assert (IBUS_IS_ENGINE_DESC (desc)); + g_assert (G_IS_DBUS_CONNECTION (connection)); ++ g_assert (error && *error == NULL); + +- GDBusProxyFlags flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START; +- BusEngineProxy *engine = ++ /* rhbz#1601577 engine == NULL if connection is closed. */ ++ if (g_dbus_connection_is_closed (connection)) { ++ *error = g_error_new (G_DBUS_ERROR, ++ G_DBUS_ERROR_FAILED, ++ "Connection is closed."); ++ return NULL; ++ } ++ flags = G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START; ++ engine = + (BusEngineProxy *) g_initable_new (BUS_TYPE_ENGINE_PROXY, + NULL, +- NULL, ++ error, + "desc", desc, + "g-connection", connection, + "g-interface-name", IBUS_INTERFACE_ENGINE, +@@ -681,12 +694,19 @@ bus_engine_proxy_new_internal (const gchar *path, + "g-default-timeout", g_gdbus_timeout, + "g-flags", flags, + NULL); ++ /* FIXME: rhbz#1601577 */ ++ if (!engine) { ++ /* show abrt local variable */ ++ gchar *message = g_strdup ((*error)->message); ++ g_error ("%s", message); ++ } + const gchar *layout = ibus_engine_desc_get_layout (desc); + if (layout != NULL && layout[0] != '\0') { + engine->keymap = ibus_keymap_get (layout); + } + return engine; + } ++#pragma GCC reset_options + + typedef struct { + GTask *task; +@@ -748,23 +768,30 @@ create_engine_ready_cb (BusFactoryProxy *factory, + GAsyncResult *res, + EngineProxyNewData *data) + { ++ GError *error = NULL; ++ gchar *path; ++ BusEngineProxy *engine; ++ + g_return_if_fail (data->task != NULL); + +- GError *error = NULL; +- gchar *path = bus_factory_proxy_create_engine_finish (factory, +- res, +- &error); ++ path = bus_factory_proxy_create_engine_finish (factory, res, &error); + if (path == NULL) { + g_task_return_error (data->task, error); + engine_proxy_new_data_free (data); + return; + } + +- BusEngineProxy *engine = +- bus_engine_proxy_new_internal (path, +- data->desc, +- g_dbus_proxy_get_connection ((GDBusProxy *)data->factory)); ++ engine = bus_engine_proxy_new_internal ( ++ path, ++ data->desc, ++ g_dbus_proxy_get_connection ((GDBusProxy *)data->factory), ++ &error); + g_free (path); ++ if (!engine) { ++ g_task_return_error (data->task, error); ++ engine_proxy_new_data_free (data); ++ return; ++ } + + /* FIXME: set destroy callback ? */ + g_task_return_pointer (data->task, engine, NULL); +diff --git a/client/x11/main.c b/client/x11/main.c +index c9ee174d..768b91f0 100644 +--- a/client/x11/main.c ++++ b/client/x11/main.c +@@ -40,6 +40,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1104,7 +1105,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/src/ibusbus.c b/src/ibusbus.c +index b7ffbb47..668c8a26 100644 +--- a/src/ibusbus.c ++++ b/src/ibusbus.c +@@ -689,6 +689,11 @@ ibus_bus_destroy (IBusObject *object) + _bus = NULL; + + if (bus->priv->monitor) { ++ /* rhbz#1795499 _changed_cb() causes SEGV because of no bus->priv ++ * after ibus_bus_destroy() is called. ++ */ ++ g_signal_handlers_disconnect_by_func (bus->priv->monitor, ++ (GCallback) _changed_cb, bus); + g_object_unref (bus->priv->monitor); + bus->priv->monitor = NULL; + } +diff --git a/ui/gtk3/extension.vala b/ui/gtk3/extension.vala +index a6f2e8e6..b7a04081 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(); + } +diff --git a/ui/gtk3/switcher.vala b/ui/gtk3/switcher.vala +index a4529c88..29a70dd5 100644 +--- a/ui/gtk3/switcher.vala ++++ b/ui/gtk3/switcher.vala +@@ -140,8 +140,8 @@ class Switcher : Gtk.Window { + IBus.EngineDesc[] engines, + int index, + string input_context_path) { +- assert (m_loop == null); +- assert (index < engines.length); ++ assert(m_loop == null); ++ assert(index < engines.length); + + m_is_running = true; + m_keyval = keyval; +@@ -198,16 +198,18 @@ class Switcher : Gtk.Window { + null, + event, + null); +- if (status != Gdk.GrabStatus.SUCCESS) ++ if (status != Gdk.GrabStatus.SUCCESS) { + warning("Grab keyboard failed! status = %d", status); +- status = seat.grab(get_window(), +- Gdk.SeatCapabilities.POINTER, +- true, +- null, +- event, +- null); +- if (status != Gdk.GrabStatus.SUCCESS) +- warning("Grab pointer failed! status = %d", status); ++ } else { ++ status = seat.grab(get_window(), ++ Gdk.SeatCapabilities.POINTER, ++ true, ++ null, ++ event, ++ null); ++ if (status != Gdk.GrabStatus.SUCCESS) ++ warning("Grab pointer failed! status = %d", status); ++ } + #else + Gdk.Device device = event.get_device(); + if (device == null) { +@@ -243,30 +245,41 @@ class Switcher : Gtk.Window { + Gdk.EventMask.KEY_RELEASE_MASK, + null, + Gdk.CURRENT_TIME); +- if (status != Gdk.GrabStatus.SUCCESS) ++ 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); ++ } else { ++ // 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, +- out m_mouse_init_x, +- out m_mouse_init_y); +- m_mouse_moved = false; ++ /* Fix RHBZ #1771238 assert(m_loop == null) ++ * Grabbing keyboard can be failed when the second Super-e is typed ++ * before Switcher dialog is focused. And m_loop could not be released ++ * if the failed Super-e would call m_loop.run() below and could not ++ * call key_release_event(). And m_loop == null would be false in the ++ * third Super-e. ++ */ ++ if (status == Gdk.GrabStatus.SUCCESS) { ++ // Probably we can delete m_popup_delay_time in 1.6 ++ pointer.get_position_double(null, ++ out m_mouse_init_x, ++ out m_mouse_init_y); ++ m_mouse_moved = false; + + +- m_loop = new GLib.MainLoop(); +- m_loop.run(); +- m_loop = null; ++ m_loop = new GLib.MainLoop(); ++ m_loop.run(); ++ m_loop = null; ++ } + + #if VALA_0_34 + seat.ungrab(); +-- +2.24.1 + diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3ef9f99dd60875593a5acb551b3add749a6a661 --- /dev/null +++ b/ibus-HEAD.patch @@ -0,0 +1,513 @@ +From 17648f0522910480b6c5dd4f5356ca1f6c160bf5 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +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 +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 +- * Copyright (C) 2015-2021 Takao Fujiwara ++ * Copyright (C) 2015-2022 Takao Fujiwara + * 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 +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 + diff --git a/ibus-xinput b/ibus-xinput new file mode 100644 index 0000000000000000000000000000000000000000..4d7f4572c397c77372d6c902e02c109731402890 --- /dev/null +++ b/ibus-xinput @@ -0,0 +1,18 @@ +XIM=ibus +XIM_PROGRAM="/usr/bin/ibus-daemon" +ICON="ibus" +XIM_ARGS="-r --xim" +PREFERENCE_PROGRAM=/usr/bin/ibus-setup +SHORT_DESC="IBus" +GTK_IM_MODULE=ibus +NOT_RUN=gnome3 + +if test -f /usr/lib64/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so || \ + test -f /usr/lib/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so || \ + test -f /usr/lib64/qt4/plugins/inputmethods/libqtim-ibus.so || \ + test -f /usr/lib/qt4/plugins/inputmethods/libqtim-ibus.so; +then + QT_IM_MODULE=ibus +else + QT_IM_MODULE=xim +fi diff --git a/ibus.conf.5 b/ibus.conf.5 new file mode 100644 index 0000000000000000000000000000000000000000..c5795b37d1abe0cfe34ee562f5321661183824cf --- /dev/null +++ b/ibus.conf.5 @@ -0,0 +1,73 @@ +.\" This file is distributed under the same license as the ibus +.\" package. +.\" Copyright (C) Takao Fujiwara , 2013. +.\" +.TH IBUS.CONF "5" "August 2013" "1.5.3" "User Commands" +.SH NAME +.B ibus.conf +\- X input preload/configuration file for ibus + +.SH SYNOPSIS +.B /etc/X11/xinit/xinput.d/ibus.conf + +.SH DESCRIPTION + +.PP +IBus is an Intelligent Input Bus. It is a new input framework for Linux +OS. It provides full featured and user friendly input method user +interface. It also may help developers to develop input method easily. + +.PP +.B ibus.conf +is a configuration file containing X input setting values to be read in +and set by /etc/X11/xinit/xinitrc\-common. +.I imsettings-switch(1) +is called from XDG auto\-start and invokes +xinitrc\-common. +.LP +If this file is the alias of +.I /etc/X11/xinit/xinputrc +for the system setting +or +.I [$XDG_CONFIG_HOME|$HOME/.config]/imsettings/xinputrc +for the user setting, the setting can be default. +.I im\-chooser(1) +can choose the user setting. +.LP +The configuration options are: +.TP +\fBXIM\fP +XIM name for XMODIFIERS +.TP +\fBXIM_PROGRAM\fP +XIM executable program name +.TP +\fBXIM_ARGS\fP +XIM arguments for XIM_PROGRAM +.TP +\fBSHORT_DESC\fP +XIM human readable name for +.I im\-chooser(1) +.TP +\fBICON\fP +icon file for +.I im\-chooser(1) +.TP +\fBPREFERENCE_PROGRAM\fP +XIM setup program for +.I im\-chooser(1) +.TP +\fBGTK_IM_MODULE\fP +IM environment valuable for GTK+ applications. +.TP +\fBQT_IM_MODULE\fP +IM environment valuable for QT applications. + +.SH BUGS +If you find a bug, please report it at http://code.google.com/p/ibus/issues/list + +.SH "SEE ALSO" +.BR ibus\-daemon (1) +.BR imsettings\-switch (1) +.BR im\-chooser (1) +.BR X (7) diff --git a/ibus.spec b/ibus.spec new file mode 100644 index 0000000000000000000000000000000000000000..c071d65d9c76035a41a85487593f0c116c5d2e01 --- /dev/null +++ b/ibus.spec @@ -0,0 +1,420 @@ +%define anolis_release 1 +%global with_pkg_config %(pkg-config --version >/dev/null 2>&1 && echo -n "1" || echo -n "0") + +%global ibus_api_version 1.0 +%global pkgcache /var/cache/%name + +# for bytecompile in %%{_datadir}/ibus/setup +%global __python %{__python3} + +%bcond_without gtk4 + +%if %with_pkg_config +%{!?gtk2_binary_version: %global gtk2_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)} +%{!?gtk3_binary_version: %global gtk3_binary_version %(pkg-config --variable=gtk_binary_version gtk+-3.0)} +%if %{with gtk4} +%{!?gtk4_binary_version: %global gtk4_binary_version %(pkg-config --variable=gtk_binary_version gtk4)} +%else +%{!?gtk4_binary_version: %global gtk4_binary_version ?.?.?} +%endif +%global glib_ver %([ -a %{_libdir}/pkgconfig/glib-2.0.pc ] && pkg-config --modversion glib-2.0 | cut -d. -f 1,2 || echo -n "999") +%else +%{!?gtk2_binary_version: %global gtk2_binary_version ?.?.?} +%{!?gtk3_binary_version: %global gtk3_binary_version ?.?.?} +%{!?gtk4_binary_version: %global gtk4_binary_version ?.?.?} +%global glib_ver 0 +%endif + +%global dbus_python_version 0.83.0 + +Name: ibus +Version: 1.5.26 +Release: %{anolis_release}%{?dist} +Summary: Intelligent Input Bus for Linux OS +License: LGPLv2+ +URL: https://github.com/ibus/%name/wiki +Source0: https://github.com/ibus/%name/releases/download/%{version}/%{name}-%{version}.tar.gz +Source1: %{name}-xinput +Source2: %{name}.conf.5 +Patch0: %{name}-HEAD.patch +# Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577 +Patch1: %{name}-1385349-segv-bus-proxy.patch + +BuildRequires: gettext-devel +BuildRequires: libtool +# for gtkdoc-fixxref +BuildRequires: glib2-doc +BuildRequires: gtk2-devel +BuildRequires: gtk3-devel +%if %{with gtk4} +BuildRequires: gtk4-devel +%endif +BuildRequires: dbus-glib-devel +BuildRequires: dbus-python-devel >= %{dbus_python_version} +BuildRequires: desktop-file-utils +BuildRequires: gtk-doc +BuildRequires: dconf-devel +BuildRequires: dbus-x11 +BuildRequires: python3-devel +BuildRequires: python3-gobject +BuildRequires: git +BuildRequires: vala +BuildRequires: iso-codes-devel +BuildRequires: libnotify-devel +BuildRequires: wayland-devel +BuildRequires: cldr-emoji-annotation +BuildRequires: unicode-emoji +BuildRequires: unicode-ucd +BuildRequires: systemd +# for ibus-keypress +BuildRequires: libXtst-devel + +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: (%{name}-gtk2%{?_isa} = %{version}-%{release} if gtk2) +Requires: %{name}-gtk3%{?_isa} = %{version}-%{release} +Requires: %{name}-setup = %{version}-%{release} + +Requires: iso-codes +Requires: dconf +Requires: python3-gobject +%{?__python3:Requires: %{__python3}} +Requires: xorg-x11-xinit +Requires: setxkbmap + +Requires: desktop-file-utils +Requires(post): desktop-file-utils +Requires(postun): desktop-file-utils +Requires: dconf +Requires(postun): dconf +Requires(posttrans): dconf + +Requires: %{_sbindir}/alternatives +Requires(post): %{_sbindir}/alternatives +Requires(postun): %{_sbindir}/alternatives + +%global _xinputconf %{_sysconfdir}/X11/xinit/xinput.d/ibus.conf + +%description +IBus means Intelligent Input Bus. It is an input framework for Linux OS. + +%package libs +Summary: IBus libraries + +Requires: dbus >= 1.2.4 +Requires: glib2 >= %{glib_ver} +Requires: gobject-introspection + +%description libs +This package contains the libraries for IBus + +%package gtk2 +Summary: IBus IM module for GTK2 +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: glib2 >= %{glib_ver} +Requires(post): glib2 >= %{glib_ver} +Provides: ibus-gtk = %{version}-%{release} +Obsoletes: ibus-gtk < %{version}-%{release} + +%description gtk2 +This package contains IBus IM module for GTK2 + +%package gtk3 +Summary: IBus IM module for GTK3 +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: glib2 >= %{glib_ver} +Requires(post): glib2 >= %{glib_ver} + +%description gtk3 +This package contains IBus IM module for GTK3 + +%if %{with gtk4} +%package gtk4 +Summary: IBus IM module for GTK4 +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: glib2 >= %{glib_ver} +Requires(post): glib2 >= %{glib_ver} + +%description gtk4 +This package contains IBus IM module for GTK4 +%endif + +%package setup +Summary: IBus setup utility +Requires: %{name} = %{version}-%{release} +%{?__python3:Requires: %{__python3}} +Requires: python3-gobject +BuildRequires: gobject-introspection-devel +BuildRequires: pygobject3-devel +BuildRequires: make +BuildArch: noarch + +%description setup +This is a setup utility for IBus. + +%package wayland +Summary: IBus IM module for Wayland +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description wayland +This package contains IBus IM module for Wayland + +%package devel +Summary: Development tools for ibus +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: dbus-devel +Requires: glib2-devel +Requires: gettext + +%description devel +The ibus-devel package contains the header files and developer +docs for ibus. + +%package devel-docs +Summary: Developer documents for IBus +BuildArch: noarch + +%description devel-docs +The ibus-devel-docs package contains developer documentation for IBus + +%package desktop-testing +Summary: Wrapper of InstalledTests Runner for IBus +Requires: %{name} = %{version}-%{release} +BuildRequires: gnome-shell-extension-no-overview +Requires: gnome-shell-extension-no-overview +BuildArch: noarch + +%description desktop-testing +GNOME desktop testing runner implements the InstalledTests specification +and IBus also needs focus events to enable input contexts on text widgets. +The wrapper script runs gnome-session for the focus events and GNOME +desktop testing runner internally. + +%package tests +Summary: Tests for the %{name} package +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description tests +The %{name}-tests package contains tests that can be used to verify +the functionality of the installed %{name} package. + + +%prep +%autosetup -S git +cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || : +cp client/gtk2/ibusimcontext.c client/gtk4/ibusimcontext.c || : + + +# prep test +for f in ibusimcontext.c ibusim.c +do + diff client/gtk2/$f client/gtk3/$f + if test $? -ne 0 ; then + echo "Have to copy $f into client/gtk3" + abort + fi +done +diff client/gtk2/ibusimcontext.c client/gtk4/ibusimcontext.c +if test $? -ne 0 ; then + echo "Have to copy ibusimcontext.c into client/gtk4" + abort +fi + +%build +autoreconf -f -i -v +%configure \ + --disable-static \ + --enable-gtk2 \ + --enable-gtk3 \ +%if %{with gtk4} + --enable-gtk4 \ +%endif + --enable-xim \ + --enable-gtk-doc \ + --enable-surrounding-text \ + --with-python=python3 \ + --disable-python2 \ + --enable-wayland \ + --enable-introspection \ + --enable-install-tests \ + %{nil} + +%make_build + +%install +make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' +rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-*%{ibus_api_version}.la +rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.la +rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.la +%if %{with gtk4} +rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-4.0/%{gtk4_binary_version}/immodules/libim-ibus.la +%endif + +# install man page +for S in %{SOURCE2} +do + cp $S . + MP=`basename $S` + gzip $MP + install -pm 644 -D ${MP}.gz $RPM_BUILD_ROOT%{_datadir}/man/man5/${MP}.gz +done + +# install xinput config file +install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf} + +install -m 755 -d $RPM_BUILD_ROOT%pkgcache/bus + +# install .desktop files +echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop + +HAS_PREFIX=$(grep prefix $RPM_BUILD_ROOT%{_bindir}/ibus-setup | wc -l) +[ x"$HAS_PREFIX" == x1 ] && \ + sed -i -e '/prefix/d' $RPM_BUILD_ROOT%{_bindir}/ibus-setup + +desktop-file-install --delete-original \ + --dir $RPM_BUILD_ROOT%{_datadir}/applications \ + $RPM_BUILD_ROOT%{_datadir}/applications/* + +# FIXME: no version number +%find_lang %{name}10 + +%check +make check \ + DISABLE_GUI_TESTS="ibus-compose ibus-keypress test-stress" \ + VERBOSE=1 \ + %{nil} + +%post +%{_sbindir}/alternatives --install %{_sysconfdir}/X11/xinit/xinputrc xinputrc %{_xinputconf} 83 || : + +%postun +if [ "$1" -eq 0 ]; then + %{_sbindir}/alternatives --remove xinputrc %{_xinputconf} || : + # if alternative was set to manual, reset to auto + [ -L %{_sysconfdir}/alternatives/xinputrc -a "`readlink %{_sysconfdir}/alternatives/xinputrc`" = "%{_xinputconf}" ] && %{_sbindir}/alternatives --auto xinputrc || : + + # 'dconf update' sometimes does not update the db... + dconf update || : + [ -f %{_sysconfdir}/dconf/db/ibus ] && \ + rm %{_sysconfdir}/dconf/db/ibus || : +fi + +%posttrans +dconf update || : + +%transfiletriggerin -- %{_datadir}/ibus/component +[ -x %{_bindir}/ibus ] && \ + %{_bindir}/ibus write-cache --system &>/dev/null || : + +%transfiletriggerpostun -- %{_datadir}/ibus/component +[ -x %{_bindir}/ibus ] && \ + %{_bindir}/ibus write-cache --system &>/dev/null || : + + +%ldconfig_scriptlets libs + +%files -f %{name}10.lang +%doc AUTHORS COPYING README +%dir %{_datadir}/ibus/ +%{_bindir}/ibus +%{_bindir}/ibus-daemon +%{_datadir}/applications/org.freedesktop.IBus.Panel.Emojier.desktop +%{_datadir}/applications/org.freedesktop.IBus.Panel.Extension.Gtk3.desktop +%{_datadir}/bash-completion/completions/ibus.bash +%{_datadir}/dbus-1/services/*.service +%{_datadir}/GConf/gsettings/* +%{_datadir}/glib-2.0/schemas/*.xml +%{_datadir}/ibus/component +%{_datadir}/ibus/dicts +%dir %{_datadir}/ibus/engine +%{_datadir}/ibus/keymaps +%{_datadir}/icons/hicolor/*/apps/* +%{_datadir}/man/man1/ibus.1.gz +%{_datadir}/man/man1/ibus-daemon.1.gz +%{_datadir}/man/man7/ibus-emoji.7.gz +%{_datadir}/man/man5/00-upstream-settings.5.gz +%{_datadir}/man/man5/ibus.5.gz +%{_datadir}/man/man5/ibus.conf.5.gz +%{_libexecdir}/ibus-engine-simple +%{_libexecdir}/ibus-dconf +%{_libexecdir}/ibus-portal +%{_libexecdir}/ibus-extension-gtk3 +%{_libexecdir}/ibus-ui-emojier +%{_libexecdir}/ibus-ui-gtk3 +%{_libexecdir}/ibus-x11 +%{_sysconfdir}/dconf/db/ibus.d +%{_sysconfdir}/dconf/profile/ibus +%dir %{_sysconfdir}/xdg/Xwayland-session.d +%{_sysconfdir}/xdg/Xwayland-session.d/10-ibus-x11 +%{_prefix}/lib/systemd/user/gnome-session.target.wants/*.service +%{_prefix}/lib/systemd/user/org.freedesktop.IBus.session.*.service +%python3_sitearch/gi/overrides/__pycache__/*.py* +%python3_sitearch/gi/overrides/IBus.py +# ibus owns xinput.d because gnome does not like to depend on imsettings. +%dir %{_sysconfdir}/X11/xinit/xinput.d +# Do not use %%config(noreplace) to always get the new keywords in _xinputconf +# For user customization, $HOME/.xinputrc can be used instead. +%config %{_xinputconf} +%verify(not mtime) %dir %pkgcache +%verify(not mtime) %dir %pkgcache/bus +# 'ibus write-cache --system' updates the system cache. +%ghost %pkgcache/bus/registry + +%files libs +%{_libdir}/libibus-*%{ibus_api_version}.so.* +%dir %{_libdir}/girepository-1.0 +%{_libdir}/girepository-1.0/IBus*-1.0.typelib + +%files gtk2 +%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.so + +%files gtk3 +%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.so + +%if %{with gtk4} +%files gtk4 +%{_libdir}/gtk-4.0/%{gtk4_binary_version}/immodules/libim-ibus.so +%endif + +# The setup package won't include icon files so that +# gtk-update-icon-cache is executed in the main package only one time. +%files setup +%{_bindir}/ibus-setup +%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop +%{_datadir}/ibus/setup +%{_datadir}/man/man1/ibus-setup.1.gz + +%files wayland +%{_libexecdir}/ibus-wayland + +%files devel +%{_libdir}/lib*.so +%{_libdir}/pkgconfig/* +%{_includedir}/* +%{_datadir}/gettext/its/ibus.* +%dir %{_datadir}/gir-1.0 +%{_datadir}/gir-1.0/IBus*-1.0.gir +%dir %{_datadir}/vala +%dir %{_datadir}/vala/vapi +%{_datadir}/vala/vapi/ibus-*1.0.vapi +%{_datadir}/vala/vapi/ibus-*1.0.deps + +%files devel-docs +# Own html dir since gtk-doc is heavy. +%dir %{_datadir}/gtk-doc +%dir %{_datadir}/gtk-doc/html +%{_datadir}/gtk-doc/html/* + +%files desktop-testing +%{_bindir}/ibus-desktop-testing-runner +%{_datadir}/ibus/tests +%{_libexecdir}/ibus-desktop-testing-autostart + +%files tests +%dir %{_libexecdir}/installed-tests +%{_libexecdir}/installed-tests/ibus +%dir %{_datadir}/installed-tests +%{_datadir}/installed-tests/ibus + +%changelog +* Tue Apr 12 2022 Chunmei Xu - 1.5.25-1 +- init from upstream