diff --git a/ibus-1.5.19.tar.gz b/ibus-1.5.19.tar.gz deleted file mode 100644 index cf7e8b0..0000000 Binary files a/ibus-1.5.19.tar.gz and /dev/null differ diff --git a/ibus-1.5.22.tar.gz b/ibus-1.5.22.tar.gz new file mode 100644 index 0000000..3bda9c0 Binary files /dev/null and b/ibus-1.5.22.tar.gz differ diff --git a/ibus-1385349-segv-bus-proxy.patch b/ibus-1385349-segv-bus-proxy.patch index f206eda..0b8fc9a 100644 --- a/ibus-1385349-segv-bus-proxy.patch +++ b/ibus-1385349-segv-bus-proxy.patch @@ -1,108 +1,119 @@ -From 865b204f1c06b782cf7b4a479b358e76f4b3dfee Mon Sep 17 00:00:00 2001 +From 023d50db40912e4f7ee333543e05995a9c730bae Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Tue, 17 Jul 2018 13:39:30 +0900 -Subject: [PATCH] bus: Fix SEGV in bus_panel_proxy_focus_in() +Date: Fri, 15 May 2020 21:44:16 +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#1349148 -BUG=rhbz#1385349 BUG=rhbz#1350291 -BUG=rhbz#1406699 -BUG=rhbz#1432252 BUG=rhbz#1601577 +BUG=rhbz#1663528 +BUG=rhbz#1767691 +BUG=rhbz#1795499 +BUG=rhbz#1771238 +BUG=rhbz#1767976 +BUG=rhbz#1797120 --- - bus/dbusimpl.c | 38 ++++++++++++++++++++++++++++++++------ - bus/engineproxy.c | 5 ++++- - bus/ibusimpl.c | 21 ++++++++++++++++++--- - 3 files changed, 54 insertions(+), 10 deletions(-) + 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 b54ef817..e4dd8683 100644 +index 59787a80..af2fbde2 100644 --- a/bus/dbusimpl.c +++ b/bus/dbusimpl.c -@@ -2,7 +2,8 @@ - /* vim:set et sts=4: */ - /* ibus - The Input Bus - * Copyright (C) 2008-2013 Peng Huang -- * Copyright (C) 2008-2013 Red Hat, Inc. -+ * Copyright (C) 2015-2017 Takao Fujiwara -+ * Copyright (C) 2008-2017 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 -@@ -344,6 +345,8 @@ bus_name_service_set_primary_owner (BusNameService *service, - BusConnectionOwner *owner, - BusDBusImpl *dbus) +@@ -610,6 +610,7 @@ static void + bus_dbus_impl_destroy (BusDBusImpl *dbus) { -+ gboolean has_old_owner = FALSE; -+ - g_assert (service != NULL); - g_assert (owner != NULL); - g_assert (dbus != NULL); -@@ -351,6 +354,13 @@ bus_name_service_set_primary_owner (BusNameService *service, - BusConnectionOwner *old = service->owners != NULL ? - (BusConnectionOwner *)service->owners->data : NULL; + GList *p; ++ int i; -+ /* rhbz#1432252 If bus_connection_get_unique_name() == NULL, -+ * "Hello" method is not received yet. -+ */ -+ if (old != NULL && bus_connection_get_unique_name (old->conn) != NULL) { -+ has_old_owner = TRUE; + 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)); \ ++} + - if (old != NULL) { - g_signal_emit (dbus, - dbus_signals[NAME_LOST], -@@ -370,7 +380,8 @@ bus_name_service_set_primary_owner (BusNameService *service, - 0, - owner->conn, - service->name, -- old != NULL ? bus_connection_get_unique_name (old->conn) : "", -+ has_old_owner ? bus_connection_get_unique_name (old->conn) : -+ "", - bus_connection_get_unique_name (owner->conn)); ++ BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->dispatch_lock); ++ BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->forward_lock); ++ ++#undef BUS_DBUS_MUTEX_SAFE_CLEAR - if (old != NULL && old->do_not_queue != 0) { -@@ -427,6 +438,7 @@ bus_name_service_remove_owner (BusNameService *service, - BusDBusImpl *dbus) - { - GSList *owners; -+ gboolean has_new_owner = FALSE; - - g_assert (service != NULL); - g_assert (owner != NULL); -@@ -439,6 +451,13 @@ bus_name_service_remove_owner (BusNameService *service, - BusConnectionOwner *_new = NULL; - if (owners->next != NULL) { - _new = (BusConnectionOwner *)owners->next->data; -+ /* rhbz#1406699 If bus_connection_get_unique_name() == NULL, -+ * "Hello" method is not received yet. -+ */ -+ if (_new != NULL && -+ bus_connection_get_unique_name (_new->conn) != NULL) { -+ has_new_owner = TRUE; -+ } - } - - if (dbus != NULL) { -@@ -447,7 +466,7 @@ bus_name_service_remove_owner (BusNameService *service, - 0, - owner->conn, - service->name); -- if (_new != NULL) { -+ if (has_new_owner) { - g_signal_emit (dbus, - dbus_signals[NAME_ACQUIRED], - 0, -@@ -460,7 +479,7 @@ bus_name_service_remove_owner (BusNameService *service, - _new != NULL ? _new->conn : NULL, - service->name, - bus_connection_get_unique_name (owner->conn), -- _new != NULL ? bus_connection_get_unique_name (_new->conn) : ""); -+ has_new_owner ? bus_connection_get_unique_name (_new->conn) : ""); - - } - } -@@ -1464,13 +1483,20 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection, + /* 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) { @@ -126,89 +137,267 @@ index b54ef817..e4dd8683 100644 if (incoming) { /* is incoming message */ diff --git a/bus/engineproxy.c b/bus/engineproxy.c -index 2d98995c..d661673a 100644 +index 2d98995c..bbbe5532 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c -@@ -665,6 +665,7 @@ bus_engine_proxy_new_internal (const gchar *path, +@@ -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) ++ GDBusConnection *connection, ++ GError **error) { -+ GError *error = NULL; ++ GDBusProxyFlags flags; ++ BusEngineProxy *engine; ++ g_assert (path); g_assert (IBUS_IS_ENGINE_DESC (desc)); g_assert (G_IS_DBUS_CONNECTION (connection)); -@@ -673,7 +674,7 @@ bus_engine_proxy_new_internal (const gchar *path, - BusEngineProxy *engine = ++ 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, ++ error, "desc", desc, "g-connection", connection, "g-interface-name", IBUS_INTERFACE_ENGINE, -@@ -681,6 +682,8 @@ bus_engine_proxy_new_internal (const gchar *path, +@@ -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 */ -+ g_assert_no_error (error); ++ 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); -diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c -index ec1caea8..9ae3751b 100644 ---- a/bus/ibusimpl.c -+++ b/bus/ibusimpl.c -@@ -484,13 +484,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, - else if (!g_strcmp0 (name, IBUS_SERVICE_PANEL_EXTENSION_EMOJI)) - panel_type = PANEL_TYPE_EXTENSION_EMOJI; - -- if (panel_type != PANEL_TYPE_NONE) { -+ do { -+ if (panel_type == PANEL_TYPE_NONE) -+ break; - if (g_strcmp0 (new_name, "") != 0) { - /* a Panel process is started. */ - BusConnection *connection; - BusInputContext *context = NULL; - BusPanelProxy **panel = (panel_type == PANEL_TYPE_PANEL) ? - &ibus->panel : &ibus->emoji_extension; -+ GDBusConnection *dbus_connection = NULL; - - if (*panel != NULL) { - ibus_proxy_destroy ((IBusProxy *)(*panel)); -@@ -499,9 +502,21 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, - g_assert (*panel == NULL); - } - -- connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name); -+ connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, -+ new_name); - g_return_if_fail (connection != NULL); - -+ dbus_connection = bus_connection_get_dbus_connection (connection); -+ /* rhbz#1349148 rhbz#1385349 -+ * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel) -+ * This function is called during destroying the connection -+ * in this case? */ -+ if (dbus_connection == NULL || -+ g_dbus_connection_is_closed (dbus_connection)) { -+ new_name = ""; -+ break; -+ } -+ - *panel = bus_panel_proxy_new (connection, panel_type); - if (panel_type == PANEL_TYPE_EXTENSION_EMOJI) - ibus->enable_emoji_extension = FALSE; -@@ -555,7 +570,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, - } - } - } -- } -+ } while (0); - - bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name); + } + 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 ea3cd464..57ed1357 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.17.1 +2.24.1 diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch index 392d32a..1ed4aac 100644 --- a/ibus-HEAD.patch +++ b/ibus-HEAD.patch @@ -1,712 +1,599 @@ -From 7edaefdc1d80aefdbbc2dc52526c20715759da83 Mon Sep 17 00:00:00 2001 +From 7b0d091839a4f1315ba216175fb2787e86f7fa31 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Wed, 22 Aug 2018 17:20:53 +0900 -Subject: [PATCH] ui/gtk3: Do not clear unicode data when emoji annotation lang - is changed +Date: Tue, 3 Mar 2020 17:08:30 +0900 +Subject: [PATCH] src/tests: Delete graves in substitution in + ibus-desktop-testing-runner +Delete the single quotations to enclose grave chracters because +DASH saves the single quoted '`id -u`' as the raw string in the command +substitution not to be extracted. + +BUG=https://github.com/ibus/ibus/issues/2189 --- - ui/gtk3/emojier.vala | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) + src/tests/ibus-desktop-testing-runner.in | 7 ++++--- + 1 file changed, 4 insertions(+), 3 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>(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( - 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>(GLib.str_hash, - GLib.str_equal); -+ } - } +diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in +index 0d9a847c..f9238e69 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-2019 Takao Fujiwara ++# Copyright (c) 2018-2020 Takao Fujiwara + # Copyright (c) 2018 Red Hat, Inc. + # + # This program is free software; you can redistribute it and/or modify +@@ -31,7 +31,8 @@ + # POSIX sh has no 'echo -e' + : ${ECHO:='/usr/bin/echo'} + # POSIX sh has $UID +-: ${UID:='`id -u`'} ++# DASH saves the graves in '``' as characters not to be extracted ++: ${UID:=`id -u`} + PROGNAME=`basename $0` +@@ -170,7 +171,7 @@ _EOF + run_dbus_daemon() + { + # Use dbus-launch --exit-with-session later instead of --sh-syntax +- export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus ++ export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus" + } + + run_desktop() -- -2.17.1 +2.24.1 -From 28d22176aee6be97d88dd6c60fa5395c79563ec0 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 30 Aug 2018 12:57:33 +0900 -Subject: [PATCH] ui/gtk3: Fix SEGV when type ASCII on emojier +From 8ce25208c3f4adfd290a032c6aa739d2b7580eb1 Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Thu, 12 Mar 2020 16:02:16 +0900 +Subject: [PATCH] src: Use WAYLAND_DISPLAY on Wayland sessions to make up + IBus socket name -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. +In Wayland sessions, GNOME Shell 3.36 is leveraging 2 X11 Display +connections so one is used to set up all services for a "X11 session" +before user applications connected to the other display might require it. +This allows seamlessly starting Xwayland on demand to X11 user applications. -BUG=rhbz#1618682 +IBus here belongs to the first described connection, it is started +explicitly on that display by GNOME Shell as it is necessary to set up +ibus-x11 before any other X11 client might want to use it. + +However the use of this "secondary" display results in IBus daemon left +unable to talk to applications, as the socket name is dependent on the +DISPLAY envvar and ibus/applications don't agree on its content. + +For wayland sessions, make it look for WAYLAND_DISPLAY, as that'll have +the similar "per session bus" behavior that this seems to look after. + +BUG=https://gitlab.gnome.org/GNOME/gnome-shell/issues/2341 --- - ui/gtk3/emojier.vala | 139 +------------------------------------------ - 1 file changed, 1 insertion(+), 138 deletions(-) + src/ibusshare.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 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 { +diff --git a/src/ibusshare.c b/src/ibusshare.c +index 0d50d3f5..e0ef2ce0 100644 +--- a/src/ibusshare.c ++++ b/src/ibusshare.c +@@ -100,6 +100,7 @@ ibus_get_socket_path (void) + gchar *display; + gchar *displaynumber = "0"; + /* gchar *screennumber = "0"; */ ++ gboolean is_wayland = FALSE; + gchar *p; - 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; + path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE")); +@@ -108,13 +109,19 @@ ibus_get_socket_path (void) } - 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; + if (_display == NULL) { +- display = g_strdup (g_getenv ("DISPLAY")); ++ display = g_strdup (g_getenv ("WAYLAND_DISPLAY")); ++ if (display) ++ is_wayland = TRUE; ++ else ++ display = g_strdup (g_getenv ("DISPLAY")); + } + else { + display = g_strdup (_display); } -- -- 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); - } - +- if (display) { ++ if (is_wayland) { ++ displaynumber = display; ++ } else if (display) { + p = display; + hostname = display; + for (; *p != ':' && *p != '\0'; p++); -- -2.17.1 +2.24.1 -From e6badb494e0a31b7aca3a5078a5dc5b27b83390d Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Thu, 30 Aug 2018 12:57:46 +0900 -Subject: [PATCH] ui/gtk3: Support Shift-Space to insert a Space on Emojier - preedit +From 5765bfd69fb2ab1174378fbb0d8cac7f2bd2610f Mon Sep 17 00:00:00 2001 +From: Changwoo Ryu +Date: Wed, 15 Apr 2020 17:43:14 +0900 +Subject: [PATCH] client/gtk2: Remove glib_check_version() in gtk immodule -Implemented Shift-Space on preedit since Shift-Space had worked on -Emojier's GtkEntry in the previous release. +In the gtk2/gtk3 immodule, glib_check_version() is being used to make sure +that the installed glib version is not older than the glib version which ibus +is built with. + +But there is no reason why glib version is checked in runtime. Library +compatibility is already being checked more precisely by packaging systems and +linkers. + +This version check can break the ibus gtk immodule when used with an older but +compatible version of glib, such as glib 2.62.x which is compatible with +2.64.x. + +BUG=https://github.com/ibus/ibus/issues/2200 --- - ui/gtk3/panelbinding.vala | 27 ++++++++++++++++++++------- - 1 file changed, 20 insertions(+), 7 deletions(-) + client/gtk2/ibusim.c | 4 +--- + 1 file changed, 1 insertion(+), 3 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 { - } +diff --git a/client/gtk2/ibusim.c b/client/gtk2/ibusim.c +index bfacd0f0..d70800d3 100644 +--- a/client/gtk2/ibusim.c ++++ b/client/gtk2/ibusim.c +@@ -41,9 +41,7 @@ static const GtkIMContextInfo *info_list[] = { + G_MODULE_EXPORT const gchar* + g_module_check_init (GModule *module) + { +- return glib_check_version (GLIB_MAJOR_VERSION, +- GLIB_MINOR_VERSION, +- 0); ++ return null; + } + G_MODULE_EXPORT void +-- +2.24.1 + +From 8da016764cee9616cca4658d1fb311d6b3bfc0df Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 15 Apr 2020 17:55:03 +0900 +Subject: [PATCH] src/tests: Fix to get focus events with su in + ibus-desktop-testing-runner + +GtkWindow haven't received focus events in any test cases since Fedora 31 +whenever Ansible runs ibus-desktop-testing-runner after `su root`. +Seems su command does not run systemd automatically and now systemd +requires XDG_RUNTIME_DIR and Ansible requires root access with ssh. +This fix requires to restart sshd with modified /etc/ssh/sshd_config +with "PermitRootLogin yes" in order to run with su command. + +Ansible with ibus-desktop-testin-runner has worked fine if root console +login is used without this patch because PAM runs systemd by login. +--- + src/tests/ibus-desktop-testing-runner.in | 36 ++++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 3 deletions(-) + +diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in +index f9238e69..f760fd5b 100755 +--- a/src/tests/ibus-desktop-testing-runner.in ++++ b/src/tests/ibus-desktop-testing-runner.in +@@ -49,6 +49,7 @@ PID_XORG=0 + PID_GNOME_SESSION=0 + TESTING_RUNNER="default" + TESTS="" ++TIMEOUT=300 + GREEN='\033[0;32m' + RED='\033[0;31m' + NC='\033[0m' +@@ -84,6 +85,7 @@ usage() + "-r, --runner=RUNNER Run TESTS programs with a test RUNNER.\n" \ + " RUNNDER = gnome or default.\n" \ + " default is an embedded runner.\n" \ ++"-T, --timeout=TIMEOUT Set timeout (default TIMEOUT is 300 sec).\n" \ + "-o, --output=OUTPUT_FILE OUtput the log to OUTPUT_FILE\n" \ + "-O, --result=RESULT_FILE OUtput the result to RESULT_FILE\n" \ + "" +@@ -92,8 +94,8 @@ usage() + parse_args() + { + # This is GNU getopt. "sudo port getopt" in BSD? +- ARGS=`getopt -o hvb:s:cd:t:r:o:O: --long \ +- help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,output:,result:\ ++ ARGS=`getopt -o hvb:s:cd:t:r:T:o:O: --long \ ++ help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:\ + -- "$@"`; + eval set -- "$ARGS" + while [ 1 ] ; do +@@ -106,6 +108,7 @@ parse_args() + -d | --desktop ) DESKTOP_COMMAND="$2"; shift 2;; + -t | --tests ) TESTS="$2"; shift 2;; + -r | --runner ) TESTING_RUNNER="$2"; shift 2;; ++ -T | --timeout ) TIMEOUT="$2"; shift 2;; + -o | --output ) TEST_LOG="$2"; shift 2;; + -O | --result ) RESULT_LOG="$2"; shift 2;; + -- ) shift; break;; +@@ -166,11 +169,37 @@ _EOF + fi + # `su` command does not run loginctl + export XDG_SESSION_TYPE='x11' ++ export XDG_SESSION_CLASS=user ++ # `su` command does not get focus in events without this variable. ++ # Need to restart sshd after set "PermitRootLogin yes" in sshd_config ++ if [ "x$XDG_RUNTIME_DIR" = x ] ; then ++ export XDG_RUNTIME_DIR=/run/user/$UID ++ is_root_login=`grep "^PermitRootLogin" /etc/ssh/sshd_config | grep yes` ++ if [ "x$ANSIBLE" != x ] && [ "x$is_root_login" = x ] ; then ++ print_log -e "${RED}FAIL${NC}: No permission to get focus-in events in GtkWindow with ansible" ++ echo "su command does not configure necessary login info " \ ++ "with systemd and GtkWindow cannot receive focus-events " \ ++ "when ibus-desktop-testing-runner is executed by " \ ++ "ansible-playbook." >> $TEST_LOG ++ echo "Enabling root login via sshd, restarting sshd, set " \ ++ "XDG_RUNTIME_DIR can resolve the problem under " \ ++ "ansible-playbook." >> $TEST_LOG ++ exit 255 ++ fi ++ fi ++ # Do we need XDG_SESSION_ID and XDG_SEAT? ++ #export XDG_CONFIG_DIRS=/etc/xdg ++ #export XDG_SESSION_ID=10 ++ #export XDG_SESSION_DESKTOP=gnome ++ #export XDG_SEAT=seat0 + } -+ 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(); + run_dbus_daemon() + { + # Use dbus-launch --exit-with-session later instead of --sh-syntax ++ # GNOME uses a unix:abstract address and it effects gsettings set values ++ # in each test case. ++ # TODO: Should we comment out this line? + export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus" + } + +@@ -288,7 +317,8 @@ run_gnome_desktop_testing_runner() + fail=1 + continue + fi +- gnome-desktop-testing-runner $tst 2>>$TEST_LOG 1>>$TEST_LOG ++ gnome-desktop-testing-runner --timeout=$TIMEOUT $tst \ ++ 2>>$TEST_LOG 1>>$TEST_LOG + retval=$? + read pass fail << EOF + `count_case_result $retval $pass $fail` +-- +2.24.1 + +From 0b9d9365988a96a2bc31c48624f9c2b8081601b6 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Wed, 22 Apr 2020 20:17:12 +0900 +Subject: [PATCH] client/gtk2: Fix typo + +--- + client/gtk2/ibusim.c | 4 ++-- + src/tests/ibus-desktop-testing-runner.in | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/client/gtk2/ibusim.c b/client/gtk2/ibusim.c +index d70800d3..55609ce7 100644 +--- a/client/gtk2/ibusim.c ++++ b/client/gtk2/ibusim.c +@@ -2,7 +2,7 @@ + /* vim:set et ts=4: */ + /* ibus - The Input Bus + * Copyright (C) 2008-2010 Peng Huang +- * Copyright (C) 2008-2010 Red Hat, Inc. ++ * Copyright (C) 2008-2020 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 +@@ -41,7 +41,7 @@ static const GtkIMContextInfo *info_list[] = { + G_MODULE_EXPORT const gchar* + g_module_check_init (GModule *module) + { +- return null; ++ return NULL; + } + + G_MODULE_EXPORT void +diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in +index f760fd5b..4232c549 100755 +--- a/src/tests/ibus-desktop-testing-runner.in ++++ b/src/tests/ibus-desktop-testing-runner.in +@@ -173,7 +173,7 @@ _EOF + # `su` command does not get focus in events without this variable. + # Need to restart sshd after set "PermitRootLogin yes" in sshd_config + if [ "x$XDG_RUNTIME_DIR" = x ] ; then +- export XDG_RUNTIME_DIR=/run/user/$UID ++ export XDG_RUNTIME_DIR="/run/user/$UID" + is_root_login=`grep "^PermitRootLogin" /etc/ssh/sshd_config | grep yes` + if [ "x$ANSIBLE" != x ] && [ "x$is_root_login" = x ] ; then + print_log -e "${RED}FAIL${NC}: No permission to get focus-in events in GtkWindow with ansible" +-- +2.24.1 + +From 8c4125bc78ce3502b5aeb053e7029cc2594f83f2 Mon Sep 17 00:00:00 2001 +From: Changwoo Ryu +Date: Sun, 12 Apr 2020 05:28:15 +0900 +Subject: [PATCH] src: Build the Emoji dictionaries in parallel + +Instead of building Emoji dictionaries src/dicts/emoji-*.dict in sequence, a +pattern rule is specified for them. The make -jN option builds the +dictionaries in parallel. + +The GNU make extensions like pattern rule and patsubst function are used for +it. But src/Makefile.am has had other GNU make extensions for a while, so +using more extensions should not make portability worse. + +BUG=https://github.com/ibus/ibus/pull/2209 +--- + src/Makefile.am | 55 ++++++++++++++++++++++++------------------------- + 1 file changed, 27 insertions(+), 28 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index a8e3d07d..99de1ab7 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -246,42 +246,41 @@ if ENABLE_EMOJI_DICT + AM_CPPFLAGS += -DENABLE_EMOJI_DICT + + dictdir = $(pkgdatadir)/dicts +-dict_DATA = dicts/emoji-en.dict + LANG_FILES = $(basename $(notdir $(wildcard $(EMOJI_ANNOTATION_DIR)/*.xml))) ++EMOJI_DICT_FILES = $(patsubst %,dicts/emoji-%.dict,$(LANG_FILES)) ++dict_DATA = $(EMOJI_DICT_FILES) + + noinst_PROGRAMS += emoji-parser + +-dicts/emoji-en.dict: emoji-parser ++dicts/emoji-%.dict: emoji-parser + $(AM_V_at)if test x"$(LANG_FILES)" = x ; then \ + echo "WARNING: Not found $(EMOJI_ANNOTATION_DIR)/en.xml" 1>&2; \ + fi; \ +- for f in $(LANG_FILES) ; do \ +- if test -f dicts/emoji-$$f.dict; then \ +- echo "Already exists dicts/emoji-$$f.dict"; \ +- continue; \ +- fi; \ +- if test -f \ +- "$(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$$f.xml" ; then \ +- xml_derived_option="--xml-derived $(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$$f.xml"; \ ++ if test -f $@; then \ ++ echo "Already exists $@"; \ ++ exit 0; \ ++ fi; \ ++ if test -f \ ++ "$(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$*.xml" ; then \ ++ xml_derived_option="--xml-derived $(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$*.xml"; \ + plus_comment="derived"; \ +- fi; \ +- if test x"$$f" = xen ; then \ +- $(builddir)/emoji-parser \ +- --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \ +- --xml $(EMOJI_ANNOTATION_DIR)/$$f.xml \ +- $$xml_derived_option \ +- --xml-ascii $(top_srcdir)/data/annotations/en_ascii.xml \ +- --out-category ibusemojigen.h \ +- --out $@; \ +- else \ +- $(builddir)/emoji-parser \ +- --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \ +- --xml $(EMOJI_ANNOTATION_DIR)/$$f.xml \ +- $$xml_derived_option \ +- --out dicts/emoji-$$f.dict; \ +- fi; \ +- echo "Generated $$plus_comment dicts/emoji-$$f.dict"; \ +- done ++ fi; \ ++ if test x"$*" = xen ; then \ ++ $(builddir)/emoji-parser \ ++ --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \ ++ --xml $(EMOJI_ANNOTATION_DIR)/$*.xml \ ++ $$xml_derived_option \ ++ --xml-ascii $(top_srcdir)/data/annotations/en_ascii.xml \ ++ --out-category ibusemojigen.h \ ++ --out $@; \ ++ else \ ++ $(builddir)/emoji-parser \ ++ --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \ ++ --xml $(EMOJI_ANNOTATION_DIR)/$*.xml \ ++ $$xml_derived_option \ ++ --out $@; \ ++ fi; \ ++ echo "Generated $$plus_comment $@" + + ibusemojigen.h: dicts/emoji-en.dict + $(NULL) +-- +2.23.0.rc1 + +From 02105c4d486283e6b561181d9c934d4d23f2d65e Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Thu, 14 May 2020 15:48:34 +0900 +Subject: [PATCH] bus: Fix SEGV in bus_panel_proxy_focus_in() + +SEGV in BUS_IS_PANEL_PROXY() in bus_panel_proxy_focus_in() +Check if GDBusConnect is closed before bus_panel_proxy_new() is called. + +BUG=rhbz#1349148 +BUG=rhbz#1385349 +--- + bus/ibusimpl.c | 25 ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c +index 85761d30..e432e849 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 +- * Copyright (C) 2011-2019 Takao Fujiwara +- * Copyright (C) 2008-2019 Red Hat, Inc. ++ * Copyright (C) 2011-2020 Takao Fujiwara ++ * Copyright (C) 2008-2020 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 +@@ -464,13 +464,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + else if (!g_strcmp0 (name, IBUS_SERVICE_PANEL_EXTENSION_EMOJI)) + panel_type = PANEL_TYPE_EXTENSION_EMOJI; + +- if (panel_type != PANEL_TYPE_NONE) { ++ do { ++ if (panel_type == PANEL_TYPE_NONE) ++ break; + if (g_strcmp0 (new_name, "") != 0) { + /* a Panel process is started. */ + BusConnection *connection; + BusInputContext *context = NULL; + BusPanelProxy **panel = (panel_type == PANEL_TYPE_PANEL) ? + &ibus->panel : &ibus->emoji_extension; ++ GDBusConnection *dbus_connection = NULL; + + if (*panel != NULL) { + ibus_proxy_destroy ((IBusProxy *)(*panel)); +@@ -479,9 +482,21 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + g_assert (*panel == NULL); + } + +- connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name); ++ connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, ++ new_name); + g_return_if_fail (connection != NULL); + ++ dbus_connection = bus_connection_get_dbus_connection (connection); ++ /* rhbz#1349148 rhbz#1385349 ++ * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel) ++ * This function is called during destroying the connection ++ * in this case? */ ++ if (dbus_connection == NULL || ++ g_dbus_connection_is_closed (dbus_connection)) { ++ new_name = ""; + 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 -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 -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? 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; + *panel = bus_panel_proxy_new (connection, panel_type); + if (panel_type == PANEL_TYPE_EXTENSION_EMOJI) + ibus->enable_emoji_extension = FALSE; +@@ -535,7 +550,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, + } } } - 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 { ++ } while (0); - 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); -+ } + bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name); } -- -2.17.1 +2.24.1 + +From f591381e3c892947ecaffe9131b9039ab9014498 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Thu, 14 May 2020 16:02:00 +0900 +Subject: [PATCH] bus: Fix SEGV in bus_dbus_impl_name_owner_changed() + +rhbz#1406699 SEGV in new_owner!=NULL in bus_dbus_impl_name_owner_changed() +which is called by bus_name_service_remove_owner() +If bus_connection_get_unique_name()==NULL, set new_owner="" in +bus_name_service_remove_owner() + +rhbz#1432252 SEGV in old_owner!=NULL in bus_dbus_impl_name_owner_changed() +which is called by bus_name_service_set_primary_owner() +If bus_connection_get_unique_name()==NULL, set old_owner="" in +bus_name_service_set_primary_owner() + +BUG=rhbz#1406699 +BUG=rhbz#1432252 +--- + bus/dbusimpl.c | 27 +++++++++++++++++++++++---- + 1 file changed, 23 insertions(+), 4 deletions(-) + +diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c +index b54ef817..59787a80 100644 +--- a/bus/dbusimpl.c ++++ b/bus/dbusimpl.c +@@ -2,7 +2,8 @@ + /* vim:set et sts=4: */ + /* ibus - The Input Bus + * Copyright (C) 2008-2013 Peng Huang +- * Copyright (C) 2008-2013 Red Hat, Inc. ++ * Copyright (C) 2015-2020 Takao Fujiwara ++ * Copyright (C) 2008-2020 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 +@@ -344,6 +345,8 @@ bus_name_service_set_primary_owner (BusNameService *service, + BusConnectionOwner *owner, + BusDBusImpl *dbus) + { ++ gboolean has_old_owner = FALSE; ++ + g_assert (service != NULL); + g_assert (owner != NULL); + g_assert (dbus != NULL); +@@ -351,6 +354,13 @@ bus_name_service_set_primary_owner (BusNameService *service, + BusConnectionOwner *old = service->owners != NULL ? + (BusConnectionOwner *)service->owners->data : NULL; + ++ /* rhbz#1432252 If bus_connection_get_unique_name() == NULL, ++ * "Hello" method is not received yet. ++ */ ++ if (old != NULL && bus_connection_get_unique_name (old->conn) != NULL) { ++ has_old_owner = TRUE; ++ } ++ + if (old != NULL) { + g_signal_emit (dbus, + dbus_signals[NAME_LOST], +@@ -370,7 +380,8 @@ bus_name_service_set_primary_owner (BusNameService *service, + 0, + owner->conn, + service->name, +- old != NULL ? bus_connection_get_unique_name (old->conn) : "", ++ has_old_owner ? bus_connection_get_unique_name (old->conn) : ++ "", + bus_connection_get_unique_name (owner->conn)); + + if (old != NULL && old->do_not_queue != 0) { +@@ -427,6 +438,7 @@ bus_name_service_remove_owner (BusNameService *service, + BusDBusImpl *dbus) + { + GSList *owners; ++ gboolean has_new_owner = FALSE; + + g_assert (service != NULL); + g_assert (owner != NULL); +@@ -439,6 +451,13 @@ bus_name_service_remove_owner (BusNameService *service, + BusConnectionOwner *_new = NULL; + if (owners->next != NULL) { + _new = (BusConnectionOwner *)owners->next->data; ++ /* rhbz#1406699 If bus_connection_get_unique_name() == NULL, ++ * "Hello" method is not received yet. ++ */ ++ if (_new != NULL && ++ bus_connection_get_unique_name (_new->conn) != NULL) { ++ has_new_owner = TRUE; ++ } + } + + if (dbus != NULL) { +@@ -447,7 +466,7 @@ bus_name_service_remove_owner (BusNameService *service, + 0, + owner->conn, + service->name); +- if (_new != NULL) { ++ if (has_new_owner) { + g_signal_emit (dbus, + dbus_signals[NAME_ACQUIRED], + 0, +@@ -460,7 +479,7 @@ bus_name_service_remove_owner (BusNameService *service, + _new != NULL ? _new->conn : NULL, + service->name, + bus_connection_get_unique_name (owner->conn), +- _new != NULL ? bus_connection_get_unique_name (_new->conn) : ""); ++ has_new_owner ? bus_connection_get_unique_name (_new->conn) : ""); + + } + } +-- +2.24.1 diff --git a/ibus-po-1.5.19-20180822.tar.gz b/ibus-po-1.5.19-20180822.tar.gz deleted file mode 100644 index 0de8463..0000000 Binary files a/ibus-po-1.5.19-20180822.tar.gz and /dev/null differ diff --git a/ibus.spec b/ibus.spec index 3aa7ea9..4d13a96 100644 --- a/ibus.spec +++ b/ibus.spec @@ -5,8 +5,8 @@ %global dbus_python_version 0.83.0 Name: ibus -Version: 1.5.19 -Release: 7 +Version: 1.5.22 +Release: 1 Summary: Intelligent Input Bus for Linux OS License: LGPLv2+ URL: https://github.com/ibus/%name/wiki @@ -14,14 +14,15 @@ Source0: https://github.com/ibus/%name/releases/download/%{versio #Source1,2 come form fedora Source1: %{name}-xinput Source2: %{name}.conf.5 -Source3: https://fujiwara.fedorapeople.org/ibus/po/%{name}-po-1.5.19-20180822.tar.gz Patch0: %{name}-HEAD.patch Patch1: %{name}-1385349-segv-bus-proxy.patch BuildRequires: gettext-devel libtool glib2-doc gtk2-devel gtk3-devel dbus-glib-devel gtk-doc dconf-devel dbus-x11 python3-devel -BuildRequires: dbus-python-devel >= %{dbus_python_version} desktop-file-utils python3-gobject python2-devel vala vala-devel vala-tools -BuildRequires: GConf2-devel intltool iso-codes-devel libnotify-devel libwayland-client-devel qt5-qtbase-devel cldr-emoji-annotation +BuildRequires: dbus-python-devel >= %{dbus_python_version} desktop-file-utils python3-gobject vala vala-devel vala-tools +BuildRequires: iso-codes-devel libnotify-devel libwayland-client-devel qt5-qtbase-devel cldr-emoji-annotation BuildRequires: unicode-emoji unicode-ucd libXtst-devel libxslt gobject-introspection-devel pygobject3-devel +#tmp buildrequire for update +BuildRequires: ibus-libs Requires: iso-codes dbus-x11 dconf python3-gobject python3 Requires: xorg-x11-xinit xorg-x11-xkb-utils @@ -70,7 +71,6 @@ docs for ibus. %prep %autosetup -p1 -zcat %SOURCE3 | tar xfv - diff client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c if test $? -ne 0 ; then @@ -100,7 +100,7 @@ done install -pm 644 -D %{SOURCE1} $RPM_BUILD_ROOT%{_xinputconf} -echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop +echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop desktop-file-install --delete-original \ --dir $RPM_BUILD_ROOT%{_datadir}/applications \ @@ -108,6 +108,9 @@ desktop-file-install --delete-original \ %find_lang %{name}10 +#tmp add for update +cp -a %{_libdir}/libibus-*%{ibus_api_version}.so.* %{buildroot}/%{_libdir} + %check make check DISABLE_GUI_TESTS="ibus-compose ibus-keypress test-stress" VERBOSE=1 %{nil} @@ -165,6 +168,7 @@ dconf update || : %{_libdir}/lib*.so %{_libdir}/pkgconfig/* %{_includedir}/* +%{_datadir}/gettext/its/ibus.* %{_datadir}/gir-1.0/IBus*-1.0.gir %{_datadir}/vala/vapi/ibus-*1.0.vapi %{_datadir}/vala/vapi/ibus-*1.0.deps @@ -176,6 +180,12 @@ dconf update || : %{_datadir}/gtk-doc/html/* %changelog +* Wed Jun 10 2020 zhujunhao - 1.5.22-1 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:update to 1.5.22 + * Wed Feb 26 2020 hexiujun - 1.5.19-7 - Type:enhancement - ID:NA