commit eea7b322115b6421a08fd4373c5b388cde9f534d Author: MSVSphere Packaging Team Date: Tue Nov 26 16:41:01 2024 +0300 import ibus-1.5.31~beta1-12.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7b955ed --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ibus-1.5.31-beta1.tar.gz diff --git a/.ibus.metadata b/.ibus.metadata new file mode 100644 index 0000000..329877b --- /dev/null +++ b/.ibus.metadata @@ -0,0 +1 @@ +ca2f53757e6bbdaaa758441dfa53c5afb07e93a4 SOURCES/ibus-1.5.31-beta1.tar.gz diff --git a/SOURCES/ibus-1.5.31-beta1.tar.gz.sum b/SOURCES/ibus-1.5.31-beta1.tar.gz.sum new file mode 100644 index 0000000..80e3d93 --- /dev/null +++ b/SOURCES/ibus-1.5.31-beta1.tar.gz.sum @@ -0,0 +1,4 @@ +cksum 3313147683 4137125 ibus-1.5.31-beta1.tar.gz +sha1sum ca2f53757e6bbdaaa758441dfa53c5afb07e93a4 ibus-1.5.31-beta1.tar.gz +sha256sum f8c6560cd6ee4487ec568c85347091208759965660ced238c0fb2fcc049fe829 ibus-1.5.31-beta1.tar.gz +sha512sum 4aa27ce1df56afd0a75019fd0398bc892d1697dfe2fed20b3cc5fe5596d14c3531a430e83a513b79b7811abea01241091f5c0f51a38bddb4a24309cc58a76122 ibus-1.5.31-beta1.tar.gz diff --git a/SOURCES/ibus-1385349-segv-bus-proxy.patch b/SOURCES/ibus-1385349-segv-bus-proxy.patch new file mode 100644 index 0000000..d4ea329 --- /dev/null +++ b/SOURCES/ibus-1385349-segv-bus-proxy.patch @@ -0,0 +1,638 @@ +From 1286ce92a5ccf68b5dcf1b4a7c0884ce29d5c51b Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Fri, 12 Jul 2024 23:30:25 +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#2213445 SEGV in bus_panel_proxy_new() +WIP: Add a GError. + +rhbz#1601577 rhbz#1797726 SEGV in ibus_engine_desc_get_layout() in +bus_engine_proxy_new_internal() +WIP: Add 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#2195895 SEGV in client/x11/main.c:_xim_set_cursor_location() +check if IBusInputContext was disconnected. + +rhbz#1795499 rhbz#1936777 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() + +rhbz#2151344 SEGV with portal_context->owner in name_owner_changed() +Maybe g_object_unref() is called but not finalized yet. + +rhbz#2239633 SEGV with g_object_unref() in +ibus_portal_context_handle_destroy() +Connect "handle-destroy" signal after g_list_prepend(). + +BUG=rhbz#1350291 +BUG=rhbz#1601577 +BUG=rhbz#1663528 +BUG=rhbz#1767691 +BUG=rhbz#1795499 +BUG=rhbz#1771238 +BUG=rhbz#1767976 +BUG=rhbz#1797120 +BUG=rhbz#2151344 +BUG=rhbz#2195895 +BUG=rhbz#2239633 +--- + bus/dbusimpl.c | 47 ++++++++++++++++++++++++--- + bus/engineproxy.c | 44 +++++++++++++++++++------ + bus/panelproxy.c | 9 +++++- + client/x11/main.c | 56 ++++++++++++++++++++++++++++---- + portal/portal.c | 25 ++++++++++++--- + src/ibusbus.c | 6 ++++ + ui/gtk3/extension.vala | 4 +++ + ui/gtk3/switcher.vala | 73 +++++++++++++++++++++++++----------------- + 8 files changed, 208 insertions(+), 56 deletions(-) + +diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c +index 110d864a..391d576a 100644 +--- a/bus/dbusimpl.c ++++ b/bus/dbusimpl.c +@@ -621,6 +621,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; +@@ -644,6 +645,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)); +@@ -658,12 +663,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); +@@ -1539,13 +1571,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 b3e16066..ba479b59 100644 +--- a/bus/engineproxy.c ++++ b/bus/engineproxy.c +@@ -696,7 +696,8 @@ bus_engine_proxy_g_signal (GDBusProxy *proxy, + static BusEngineProxy * + bus_engine_proxy_new_internal (const gchar *path, + IBusEngineDesc *desc, +- GDBusConnection *connection) ++ GDBusConnection *connection, ++ GError **error) + { + GDBusProxyFlags flags; + BusEngineProxy *engine; +@@ -706,12 +707,20 @@ bus_engine_proxy_new_internal (const gchar *path, + g_assert (path); + g_assert (IBUS_IS_ENGINE_DESC (desc)); + g_assert (G_IS_DBUS_CONNECTION (connection)); ++ g_assert (error && *error == NULL); + ++ /* 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, +@@ -719,6 +728,12 @@ 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); +@@ -818,23 +833,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/bus/panelproxy.c b/bus/panelproxy.c +index e6001ebf..00828fbc 100644 +--- a/bus/panelproxy.c ++++ b/bus/panelproxy.c +@@ -122,6 +122,8 @@ bus_panel_proxy_new (BusConnection *connection, + const gchar *path = NULL; + GObject *obj; + BusPanelProxy *panel; ++ GError *error = NULL; ++ const gchar *message; + + g_assert (BUS_IS_CONNECTION (connection)); + +@@ -138,7 +140,7 @@ bus_panel_proxy_new (BusConnection *connection, + + obj = g_initable_new (BUS_TYPE_PANEL_PROXY, + NULL, +- NULL, ++ &error, + "g-object-path", path, + "g-interface-name", IBUS_INTERFACE_PANEL, + "g-connection", bus_connection_get_dbus_connection (connection), +@@ -146,6 +148,11 @@ bus_panel_proxy_new (BusConnection *connection, + "g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START | G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES, + NULL); + ++ if (error) { ++ /* TODO: rhbz#2213445 Why does this issue happen? */ ++ message = error->message; ++ g_critical ("Failed to generate BusPanelProxy: %s", message); ++ } + panel = BUS_PANEL_PROXY (obj); + panel->panel_type = panel_type; + return panel; +diff --git a/client/x11/main.c b/client/x11/main.c +index b7eb5961..3075d5d0 100644 +--- a/client/x11/main.c ++++ b/client/x11/main.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #include + +@@ -69,6 +70,7 @@ typedef struct _X11ICONN X11ICONN; + typedef struct _X11IC X11IC; + struct _X11IC { + IBusInputContext *context; ++ gboolean ibus_connected; + Window client_window; + Window focus_window; + gint32 input_style; +@@ -327,6 +329,18 @@ _xim_store_ic_values (X11IC *x11ic, IMChangeICStruct *call_data) + return 1; + } + ++static void ++ibus_ic_connection_closed_cb (GDBusConnection *connection, ++ gboolean remote_peer_vanished, ++ GError *error, ++ X11IC *x11ic) ++{ ++ /* rhbz#2195895 The moment of the IBusBus disconnection would be ++ * different from the moment of XIM_DISCONNECT. ++ */ ++ x11ic->ibus_connected = FALSE; ++} ++ + + static int + xim_create_ic (XIMS xims, IMChangeICStruct *call_data) +@@ -334,6 +348,7 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data) + static int base_icid = 1; + X11IC *x11ic; + guint32 capabilities = IBUS_CAP_FOCUS; ++ GDBusConnection *connection; + + call_data->icid = base_icid ++; + +@@ -345,8 +360,9 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data) + + x11ic->icid = call_data->icid; + x11ic->connect_id = call_data->connect_id; +- x11ic->conn = (X11ICONN *)g_hash_table_lookup (_connections, +- GINT_TO_POINTER ((gint) call_data->connect_id)); ++ x11ic->conn = (X11ICONN *)g_hash_table_lookup ( ++ _connections, ++ GINT_TO_POINTER ((gint) call_data->connect_id)); + if (x11ic->conn == NULL) { + g_slice_free (X11IC, x11ic); + g_return_val_if_reached (0); +@@ -376,6 +392,10 @@ xim_create_ic (XIMS xims, IMChangeICStruct *call_data) + G_CALLBACK (_context_enabled_cb), x11ic); + g_signal_connect (x11ic->context, "disabled", + G_CALLBACK (_context_disabled_cb), x11ic); ++ connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (x11ic->context)); ++ x11ic->ibus_connected = !g_dbus_connection_is_closed (connection); ++ g_signal_connect (connection, "closed", ++ G_CALLBACK (ibus_ic_connection_closed_cb), x11ic); + + + if (x11ic->input_style & XIMPreeditCallbacks) +@@ -400,11 +420,19 @@ xim_destroy_ic (XIMS xims, IMChangeICStruct *call_data) + LOG (1, "XIM_DESTROY_IC ic=%d connect_id=%d", + call_data->icid, call_data->connect_id); + +- x11ic = (X11IC *)g_hash_table_lookup (_x11_ic_table, +- GINT_TO_POINTER ((gint) call_data->icid)); ++ x11ic = (X11IC *)g_hash_table_lookup ( ++ _x11_ic_table, ++ GINT_TO_POINTER ((gint) call_data->icid)); + g_return_val_if_fail (x11ic != NULL, 0); + + if (x11ic->context) { ++ GDBusConnection *connection = ++ g_dbus_proxy_get_connection (G_DBUS_PROXY (x11ic->context)); ++ x11ic->ibus_connected = FALSE; ++ g_signal_handlers_disconnect_by_func ( ++ connection, ++ (GCallback)ibus_ic_connection_closed_cb, ++ x11ic); + ibus_proxy_destroy ((IBusProxy *)x11ic->context); + g_object_unref (x11ic->context); + x11ic->context = NULL; +@@ -412,7 +440,8 @@ xim_destroy_ic (XIMS xims, IMChangeICStruct *call_data) + + g_hash_table_remove (_x11_ic_table, + GINT_TO_POINTER ((gint) call_data->icid)); +- x11ic->conn->clients = g_list_remove (x11ic->conn->clients, (gconstpointer)x11ic); ++ x11ic->conn->clients = g_list_remove (x11ic->conn->clients, ++ (gconstpointer)x11ic); + + g_free (x11ic->preedit_string); + x11ic->preedit_string = NULL; +@@ -439,6 +468,8 @@ xim_set_ic_focus (XIMS xims, IMChangeFocusStruct *call_data) + x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table, + GINT_TO_POINTER ((gint) call_data->icid)); + g_return_val_if_fail (x11ic != NULL, 0); ++ if (!x11ic->ibus_connected) ++ return 1; + + ibus_input_context_focus_in (x11ic->context); + _xim_set_cursor_location (x11ic); +@@ -458,6 +489,8 @@ xim_unset_ic_focus (XIMS xims, IMChangeFocusStruct *call_data) + x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table, + GINT_TO_POINTER ((gint) call_data->icid)); + g_return_val_if_fail (x11ic != NULL, 0); ++ if (!x11ic->ibus_connected) ++ return 1; + + ibus_input_context_focus_out (x11ic->context); + +@@ -712,6 +745,8 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data) + _x11_ic_table, + GINT_TO_POINTER ((gint) call_data->icid)); + g_return_val_if_fail (x11ic != NULL, 0); ++ if (!x11ic->ibus_connected) ++ return 0; + + xevent = (XKeyEvent*) &(call_data->event); + +@@ -870,6 +905,8 @@ _xim_set_cursor_location (X11IC *x11ic) + } + } + ++ if (!x11ic->ibus_connected) ++ return; + ibus_input_context_set_cursor_location (x11ic->context, + preedit_area.x, + preedit_area.y, +@@ -950,6 +987,8 @@ xim_reset_ic (XIMS xims, IMResetICStruct *call_data) + x11ic = (X11IC *) g_hash_table_lookup (_x11_ic_table, + GINT_TO_POINTER ((gint) call_data->icid)); + g_return_val_if_fail (x11ic != NULL, 0); ++ if (!x11ic->ibus_connected) ++ return 1; + + ibus_input_context_reset (x11ic->context); + +@@ -1309,7 +1348,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/portal/portal.c b/portal/portal.c +index 5cd38779..5110baad 100644 +--- a/portal/portal.c ++++ b/portal/portal.c +@@ -92,6 +92,11 @@ static void portal_context_g_signal (GDBusProxy *proxy, + GVariant *parameters, + IBusPortalContext *portal_context); + ++#define IBUS_TYPE_PORTAL_CONTEXT \ ++ (ibus_portal_context_get_type ()) ++#define IBUS_IS_PORTAL_CONTEXT(obj) \ ++ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), IBUS_TYPE_PORTAL_CONTEXT)) ++ + G_DEFINE_TYPE_WITH_CODE (IBusPortalContext, + ibus_portal_context, + IBUS_DBUS_TYPE_INPUT_CONTEXT_SKELETON, +@@ -492,11 +497,6 @@ ibus_portal_context_new (IBusInputContext *context, + g_strdup_printf (IBUS_PATH_INPUT_CONTEXT, portal_context->id); + portal_context->service = ibus_dbus_service_skeleton_new (); + +- g_signal_connect (portal_context->service, +- "handle-destroy", +- G_CALLBACK (ibus_portal_context_handle_destroy), +- portal_context); +- + if (!g_dbus_interface_skeleton_export ( + G_DBUS_INTERFACE_SKELETON (portal_context->service), + connection, portal_context->object_path, +@@ -509,8 +509,17 @@ ibus_portal_context_new (IBusInputContext *context, + return NULL; + } + ++ /* rhbz#2239633 g_list_prepend() needs to be callsed before ++ * ibus_portal_context_handle_destroy() is connected ++ * for g_list_remove() in ibus_portal_context_finalize(). ++ */ + all_contexts = g_list_prepend (all_contexts, portal_context); + ++ g_signal_connect (portal_context->service, ++ "handle-destroy", ++ G_CALLBACK (ibus_portal_context_handle_destroy), ++ portal_context); ++ + return portal_context; + } + +@@ -667,6 +676,12 @@ name_owner_changed (GDBusConnection *connection, + IBusPortalContext *portal_context = l->data; + next = l->next; + ++ /* rhbz#2151344 portal_context might not be finalized? */ ++ if (!G_LIKELY (IBUS_IS_PORTAL_CONTEXT (portal_context))) { ++ g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, ++ "portal_context is not IBusPortalContext"); ++ continue; ++ } + if (g_strcmp0 (portal_context->owner, name) == 0) { + g_object_unref (portal_context); + } +diff --git a/src/ibusbus.c b/src/ibusbus.c +index 0e6d67f1..fcc742b6 100644 +--- a/src/ibusbus.c ++++ b/src/ibusbus.c +@@ -742,6 +742,12 @@ 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_file_monitor_cancel (bus->priv->monitor); + 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 26bded99..21ede7be 100644 +--- a/ui/gtk3/switcher.vala ++++ b/ui/gtk3/switcher.vala +@@ -176,8 +176,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); + + if (m_is_running) + return index; +@@ -236,16 +236,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) { +@@ -281,30 +283,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.45.0 + diff --git a/SOURCES/ibus-HEAD.patch b/SOURCES/ibus-HEAD.patch new file mode 100644 index 0000000..282b75f --- /dev/null +++ b/SOURCES/ibus-HEAD.patch @@ -0,0 +1,3976 @@ +From a1a2fe5d13ad76956a94c0695af15d76e3edfdca Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Thu, 18 Jul 2024 01:25:41 +0900 +Subject: [PATCH] Fix memory leaks in error handlings + +- bus/ibusimpl: Free keys not in case of TYPE_IME_SWITCHER +- src/ibuscomposetable: Correct handling G_MAXSIZE * G_MAXSIZE +- src/ibuscomposetable: Fee ibus_compose_seqs in error handlings +--- + bus/ibusimpl.c | 3 ++- + src/ibuscomposetable.c | 6 +++++- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c +index 31a095f3..445c062b 100644 +--- a/bus/ibusimpl.c ++++ b/bus/ibusimpl.c +@@ -1986,7 +1986,8 @@ _ibus_set_global_shortcut_keys (BusIBusImpl *ibus, + } + ibus->ime_switcher_keys = keys; + break; +- default:; ++ default: ++ g_slice_free1 (sizeof (IBusProcessKeyEventData) * (size + 1), keys); + } + return TRUE; + } +diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c +index 7531a4b2..a8e41a33 100644 +--- a/src/ibuscomposetable.c ++++ b/src/ibuscomposetable.c +@@ -849,7 +849,7 @@ compose_data_to_variant (gconstpointer compose_data, + g_assert (compose_data); + if (error) + *error = NULL; +- if ((index_stride * n_seqs) > G_MAXUINT64) { ++ if (n_seqs == 0 || index_stride > (G_MAXSIZE / n_seqs)) { + if (error) { + g_set_error (error, IBUS_ERROR, IBUS_ERROR_FAILED, + "Length %u x %lu is too long", +@@ -1404,6 +1404,7 @@ ibus_compose_table_new_with_list (GList *compose_list, + (G_MAXSIZE / sizeof (guint16)))) { + g_warning ("Too long allocation %lu x %u", + s_size_total - s_size_16bit, n_index_stride); ++ g_free (ibus_compose_seqs); + return NULL; + } + rawdata = (gpointer)g_new ( +@@ -1416,6 +1417,8 @@ ibus_compose_table_new_with_list (GList *compose_list, + s_size_total - s_size_16bit, + n_index_stride, + v_size_32bit); ++ g_free (ibus_compose_seqs); ++ g_free (rawdata); + return NULL; + } + if (G_LIKELY (rawdata)) { +@@ -1432,6 +1435,7 @@ ibus_compose_table_new_with_list (GList *compose_list, + } + if (!ibus_compose_seqs_32bit_first || !ibus_compose_seqs_32bit_second) { + g_warning ("Failed g_new"); ++ g_free (ibus_compose_seqs); + g_free (rawdata); + return NULL; + } +-- +2.45.0 + +From a52861385bb5d15598f6c3c3d86c7a9ee19f140a Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Sat, 27 Jul 2024 19:00:53 +0900 +Subject: [PATCH 1/6] src/tests: Enable CI in GNOME Wayland + +- Implement headless desktop to test Wayland sessions +- Implement ibus-desktop-testing-autostart to be executed in XDG + autostart in GNOME Wayland +- Move shared codes to ibus-desktop-testing-module between + ibus-desktop-testing-runner and ibus-desktop-testing-autostart +- Add --no-systemd option to enable the previous testing frame with running + gnome-session directly +- Rename --desktop option to --session +- Move save_screen() from runner to module +- Copy gnome-shell service file to user home for headless & virtual-monitor +- Add --delete-tests option to clean up tests +- Add AutostartCondition=if-exists in XDG autostart desktop file +- Add 60 secs in ibus-compose-locales for systemd desktop sessions +- Quote file names as much as possible. +- Check file existant and not to use "rm -f" as much as possible +- Do not set GTK_IM_MODULE=ibus for Wayland + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + src/tests/Makefile.am | 23 +- + src/tests/ibus-compose-locales.in | 16 +- + src/tests/ibus-desktop-testing-autostart | 57 -- + src/tests/ibus-desktop-testing-autostart.in | 83 ++ + src/tests/ibus-desktop-testing-module | 876 ++++++++++++++++++++ + src/tests/ibus-desktop-testing-runner.in | 495 +---------- + src/tests/ibus-desktop-testing.desktop.in | 2 +- + 7 files changed, 1034 insertions(+), 518 deletions(-) + delete mode 100755 src/tests/ibus-desktop-testing-autostart + create mode 100755 src/tests/ibus-desktop-testing-autostart.in + create mode 100755 src/tests/ibus-desktop-testing-module + +diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am +index b30a39fb..6c4c86cf 100644 +--- a/src/tests/Makefile.am ++++ b/src/tests/Makefile.am +@@ -106,6 +106,7 @@ test_sourcesdir = $(datadir)/installed-tests/ibus + + CLEANFILES += \ + $(test_metas) \ ++ ibus-desktop-testing-autostart \ + ibus-desktop-testing-runner \ + org.freedesktop.IBus.Desktop.Testing.desktop \ + $(NULL) +@@ -119,7 +120,10 @@ CLEANFILES += \ + $(NULL) + endif + test_execsdir = $(libexecdir)/installed-tests/ibus +-libexec_SCRIPTS = ibus-desktop-testing-autostart ++libexec_SCRIPTS = \ ++ ibus-desktop-testing-autostart \ ++ ibus-desktop-testing-module \ ++ $(NULL) + + test_frame_DATA = org.freedesktop.IBus.Desktop.Testing.desktop + test_framedir = $(pkgdatadir)/tests +@@ -142,9 +146,21 @@ ibus-compose-locales: ibus-compose-locales.in + mv $@.tmp $@; \ + $(NULL) + ++ibus-desktop-testing-autostart: ibus-desktop-testing-autostart.in ++ INSTALLEDDIR=$(datadir)/installed-tests; \ ++ sed -e "s|@DATADIR[@]|$(datadir)|g" \ ++ -e "s|@INSTALLEDDIR[@]|$$INSTALLEDDIR|g" \ ++ -e "s|@LIBEXECDIR[@]|$(libexecdir)|g" \ ++ $< > $@.tmp; \ ++ mv $@.tmp $@; \ ++ $(NULL) ++ + ibus-desktop-testing-runner: ibus-desktop-testing-runner.in + INSTALLEDDIR=$(datadir)/installed-tests; \ +- sed -e "s|@INSTALLEDDIR[@]|$$INSTALLEDDIR|g" $< > $@.tmp; \ ++ sed -e "s|@DATADIR[@]|$(datadir)|g" \ ++ -e "s|@INSTALLEDDIR[@]|$$INSTALLEDDIR|g" \ ++ -e "s|@LIBEXECDIR[@]|$(libexecdir)|g" \ ++ $< > $@.tmp; \ + mv $@.tmp $@; \ + $(NULL) + +@@ -157,7 +173,8 @@ EXTRA_DIST = \ + ibus-compose.env \ + ibus-compose-locales.in \ + ibus-desktop-testing.desktop.in \ +- ibus-desktop-testing-autostart \ ++ ibus-desktop-testing-autostart.in \ ++ ibus-desktop-testing-module \ + ibus-desktop-testing-runner.in \ + $(NULL) + +diff --git a/src/tests/ibus-compose-locales.in b/src/tests/ibus-compose-locales.in +index b36165fe..7a133ce0 100755 +--- a/src/tests/ibus-compose-locales.in ++++ b/src/tests/ibus-compose-locales.in +@@ -6,7 +6,8 @@ BUILDDIR=`dirname $0` + + export IBUS_COMPOSE_CACHE_DIR=$PWD + +-retval=0 ++RETVAL=0 ++INITED=0 + # Deleted for var in `cat *.env` because IFS=$'\n' is not supported in POSIX sh + while read var + do +@@ -14,19 +15,26 @@ do + if [ "x$IS_COMMENT" != x ] ; then + continue + fi ++ while [ x"$IBUS_DAEMON_WITH_SYSTEMD" != x ] && [ $INITED -lt 6 ] ; do ++ echo "Waiting for ${INITED}0 secs till 60 secs" ++ sleep 10 ++ INITED=`expr $INITED + 1` ++ done + # Use $* instead of $@ not to mix strings and integers + echo "# Starting $var $BUILDDIR/ibus-compose $SRCDIR $*" + # Need to enclose $@ with double quotes not to split the array. + env $var $BUILDDIR/ibus-compose $SRCDIR "$@" +- retval=`expr $retval + $?` +- echo "# Finished $var $BUILDDIR/ibus-compose $SRCDIR $* with $retval" ++ RETVAL=`expr $RETVAL + $?` ++ echo "# Finished $var $BUILDDIR/ibus-compose $SRCDIR $* with $RETVAL" + + CACHE_FILES=`ls *.cache` + if [ x"$CACHE_FILES" != x ] ; then + echo "Clean $CACHE_FILES" + rm $CACHE_FILES + fi ++ # Need to wait for 1 sec not to be freezed with gnome-shell in Wayland ++ sleep 1 + done << EOF_ENVS + `cat $SRCDIR/ibus-compose.env` + EOF_ENVS +-exit $retval ++exit $RETVAL +diff --git a/src/tests/ibus-desktop-testing-autostart b/src/tests/ibus-desktop-testing-autostart +deleted file mode 100755 +index 1e1eb180..00000000 +--- a/src/tests/ibus-desktop-testing-autostart ++++ /dev/null +@@ -1,57 +0,0 @@ +-#!/bin/sh +-# -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- +-# vim:set noet ts=4: +-# +-# ibus - The Input Bus +-# +-# Copyright (c) 2021 Takao Fujiwara +-# Copyright (c) 2021 Red Hat, Inc. +-# +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# This program is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License along +-# with this program; if not, write to the Free Software Foundation, Inc., +-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +- +-TEST_LOG= +-COMMANDS=' +-id +-echo $DISPLAY +-pwd +-pstree -asp $$ +-gsettings list-recursively org.gnome.shell +-rpm -q gnome-shell-extension-no-overview gnome-shell gnome-session +-ps -ef | grep ibus | grep -v grep +-ibus address +-' +- +-if [ $# -gt 0 ] ; then +- TEST_LOG=$1 +-fi +- +-run_test() +-{ +-while read cmd ; do +- if [ x"$cmd" = x ] ; then +- continue +- fi +- echo "# $cmd" +- eval "$cmd" +-done << EOF_COMMANDS +-`echo "$COMMANDS"` +-EOF_COMMANDS +-} +- +-if [ x"$TEST_LOG" = x ] ; then +- run_test +-else +- run_test 2>>$TEST_LOG 1>>$TEST_LOG +-fi +diff --git a/src/tests/ibus-desktop-testing-autostart.in b/src/tests/ibus-desktop-testing-autostart.in +new file mode 100755 +index 00000000..d50354df +--- /dev/null ++++ b/src/tests/ibus-desktop-testing-autostart.in +@@ -0,0 +1,83 @@ ++#!/bin/sh ++# -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- ++# vim:set noet ts=4: ++# ++# ibus - The Input Bus ++# ++# Copyright (c) 2021-2024 Takao Fujiwara ++# Copyright (c) 2021 Red Hat, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program; if not, write to the Free Software Foundation, Inc., ++# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++ ++PROGNAME=`basename $0` ++TEST_CASE_DIR="@INSTALLEDDIR@" ++MODULE_SH='ibus-desktop-testing-module' ++MODULE_SH_PATH="@LIBEXECDIR@/$MODULE_SH" ++TEST_LOG="test-autostart.log" ++TESTING_RUNNER="" ++ ++ ++if test -f $MODULE_SH_PATH ; then ++ . $MODULE_SH_PATH ++elif test -f $(dirname $0)/$MODULE_SH ; then ++ . $(dirname $0)/$MODULE_SH ++else ++ echo "Not found $MODULE_SH" ++ exit 1 ++fi ++ ++ ++usage() ++{ ++ $ECHO -e \ ++"This test suite is called from /etc/xdg/autostart for systemd sessions\n" \ ++"$PROGNAME [OPTIONS…]\n" \ ++"\n" \ ++"OPTIONS:\n" \ ++"-h, --help This help\n" \ ++"-v, --version Show version\n" \ ++"-b, --builddir=BUILDDIR Set the BUILDDIR\n" \ ++"-s, --srcdir=SOURCEDIR Set the SOURCEDIR\n" \ ++"-V, --verbose Verbose log for ibus-daemon\n" \ ++"-t, --tests=\"TESTS...\" Run TESTS programs which is separated by space\n" \ ++"-r, --runner=RUNNER Run TESTS programs with a test RUNNER.\n" \ ++" RUNNDER = 'gnome', 'default' or ''.\n" \ ++" 'default' is an embedded runner.\n" \ ++" '' is no tests.\n" \ ++"-T, --timeout=TIMEOUT Set timeout (default TIMEOUT is 300 sec).\n" \ ++"-o, --output=OUTPUT_FILE Output the log to OUTPUT_FILE\n" \ ++" default is $TEST_LOG\n" \ ++"-O, --result=RESULT_FILE Output the result to RESULT_FILE\n" \ ++" default is stdout\n" \ ++"-S, --screendump=DUMP_FILE Output the screen to DUMP_FILE ('STDOUT' can be stdout)\n" \ ++"-e, --envcheck Retrieve environment variables\n" \ ++"" ++} ++ ++ ++main() ++{ ++ parse_args "$@" ++ init_session ++ check_env ++ save_screen ++ run_test_suite ++ finit ++} ++ ++ ++# Need to enclose $@ with double quotes not to split the array. ++main "$@" +diff --git a/src/tests/ibus-desktop-testing-module b/src/tests/ibus-desktop-testing-module +new file mode 100755 +index 00000000..2d686813 +--- /dev/null ++++ b/src/tests/ibus-desktop-testing-module +@@ -0,0 +1,876 @@ ++#!/bin/sh ++# -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- ++# vim:set noet ts=4: ++# ++# ibus - The Input Bus ++# ++# Copyright (c) 2018-2024 Takao Fujiwara ++# Copyright (c) 2018 Red Hat, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License along ++# with this program; if not, write to the Free Software Foundation, Inc., ++# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++ ++# POSIX sh has no 'echo -e' ++: ${ECHO:='/usr/bin/echo'} ++# POSIX sh has $UID ++# DASH saves the graves in '``' as characters not to be extracted ++: ${UID:=`id -u`} ++: ${TEST_CASE_DIR='/usr/share/installed-tests'} ++: ${AUTOSTART_DESKTOP_DIR='/usr/share/ibus/tests'} ++ ++ ++VERSION=0.4 ++BUILDDIR="." ++SRCDIR="." ++TEST_LOG_STDOUT=0 ++RESULT_LOG="" ++SCREEN_LOG="" ++HAVE_GRAPHICS=1 ++VERBOSE=0 ++SESSION_COMMAND="dbus-launch --exit-with-session gnome-session" ++SESSION_LANG= ++SESSION_IS_GNOME=1 ++GNOME_SHELL_WAYLAND_COMMAND="gnome-shell --wayland --headless --virtual-monitor 1024x768" ++SYSTEMD_SYSTEM_DIR="/usr/lib/systemd/user" ++PID_XORG=0 ++PID_GNOME_SESSION=0 ++ENABLED_SYSTEMD=1 ++TEST_USER=itestuser ++TEST_USER_HOME=/export/home/$TEST_USER ++GDM_CONF=/run/gdm/custom.conf ++AUTOSTART_DESKTOP_FILE="org.freedesktop.IBus.Desktop.Testing.desktop" ++TESTS="" ++TIMEOUT=300 ++GREEN='\033[0;32m' ++RED='\033[0;31m' ++NC='\033[0m' ++ENV_CHECK=0 ++ENV_COMMANDS=' ++id ++pwd ++pstree -asp $$ ++gsettings list-recursively org.gnome.shell ++rpm -q gnome-shell-extension-no-overview gnome-shell gnome-session ++ps -ef | grep ibus | grep -v grep ++ibus address ++env ++#dbus-send --session --print-reply --dest=org.gnome.Shell.Introspect /org/gnome/Shell/Introspect org.gnome.Shell.Introspect.GetWindows ++' ++ ++ ++print_log() ++{ ++ if [ x"$RESULT_LOG" != x ] ; then ++ # avoid 'echo -e' before call 'sed'. ++ if [ x"$1" = x'-e' ] ; then ++ shift ++ fi ++ NO_ESCAPE=`echo "$@" | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'` ++ $ECHO $NO_ESCAPE >> $RESULT_LOG ++ else ++ $ECHO "$@" ++ fi ++} ++ ++ ++parse_args() ++{ ++ # This is GNU getopt. "sudo port getopt" in BSD? ++ ARGS=`getopt -o hvb:s:cVd:t:r:iT:o:O:S:el:D --long \ ++help,version,builddir:,srcdir:,no-graphics,verbose,desktop:,session:,tests:,\ ++runner:,no-systemd,timeout:,output:,result:,screendump:,envcheck,lang:,\ ++delete-tests\ ++ -- "$@"`; ++ eval set -- "$ARGS" ++ while [ 1 ] ; do ++ case "$1" in ++ -h | --help ) usage; exit 0;; ++ -v | --version ) $ECHO -e "$VERSION"; exit 0;; ++ -b | --builddir ) BUILDDIR="$2"; shift 2;; ++ -s | --srcdir ) SRCDIR="$2"; shift 2;; ++ -c | --no-graphics ) HAVE_GRAPHICS=0; shift;; ++ -V | --verbose ) VERBOSE=1; shift;; ++ --desktop ) SESSION_COMMAND="$2" ++ print_log -e "--desktop is deprecated. Use --session instead" ++ shift 2;; ++ -d | --session ) SESSION_COMMAND="$2"; shift 2;; ++ -t | --tests ) TESTS="$2"; shift 2;; ++ -r | --runner ) TESTING_RUNNER="$2"; shift 2;; ++ -i | --no-systemd ) ENABLED_SYSTEMD=0; shift;; ++ -T | --timeout ) TIMEOUT="$2"; shift 2;; ++ -o | --output ) TEST_LOG="$2"; shift 2;; ++ -O | --result ) RESULT_LOG="$2"; shift 2;; ++ -S | --screendump ) SCREEN_LOG="$2"; shift 2;; ++ -e | --envcheck ) ENV_CHECK=1; shift;; ++ -l | --lang ) SESSION_LANG="$2"; shift 2;; ++ -D | --delete-tests ) delete_test_user; exit 0;; ++ -- ) shift; break;; ++ * ) usage; exit 1;; ++ esac ++ done ++ DL='$' ++ if echo "$SESSION_COMMAND" | grep -q -E ".*-with-dbus$DL" ; then ++ SESSION_COMMAND=`echo "$SESSION_COMMAND" | sed -e 's/-with-dbus$//'` ++ SESSION_COMMAND="dbus-launch --exit-with-session $SESSION_COMMAND" ++ fi ++} ++ ++ ++check_tty() ++{ ++ TTY=`tty` ++ if echo $PROGNAME | grep -q runner ; then ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ if echo "$TTY" | grep -E 'tty|console' ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Changing runlevel does not support console. Please log into the host with ssh." ++ exit 1 ++ fi ++ fi ++ if [ $ENABLED_SYSTEMD -eq 0 ] ; then ++ if echo "$TTY" | grep -E 'pts' ; then ++ print_log -e "Running session with ssh. It might be good to use console instead." ++ fi ++ fi ++ SESSION=`ps -ef | grep session | grep -v grep` ++ if [ x"$SESSION" != x ] ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Session is running: $SESSION" ++ exit 1 ++ fi ++ fi ++} ++ ++ ++check_env() ++{ ++ if test $ENV_CHECK -eq 0 ; then ++ return ++ fi ++ while read cmd ; do ++ if test x"$cmd" = x ; then ++ continue ++ fi ++ if echo "$cmd" | grep -q "^#"; then ++ continue ++ fi ++ echo "# $cmd" 2>>$TEST_LOG 1>>$TEST_LOG ++ eval "$cmd" 2>>$TEST_LOG 1>>$TEST_LOG ++ done << EOF_ENV_COMMANDS ++`echo "$ENV_COMMANDS"` ++EOF_ENV_COMMANDS ++} ++ ++ ++save_screen_real() ++{ ++ SCREEN_PNG="`date '+%Y%m%d%H%M%S'`.png" ++ gnome-screenshot --file=$SCREEN_PNG ++ if test x"$SCREEN_LOG" = xSTDOUT ; then ++ base64 $SCREEN_PNG ++ touch /var/tmp/STDOUT.log ++ else ++ base64 $SCREEN_PNG > $SCREEN_LOG ++ fi ++} ++ ++ ++save_screen() ++{ ++ if test x"$SCREEN_LOG" = x ; then ++ return ++ fi ++ if test x"$SCREEN_LOG" = xSTDOUT ; then ++ if test -f /var/tmp/STDOUT.log ; then ++ rm /var/tmp/STDOUT.log ++ fi ++ else ++ if test -f "$SCREEN_LOG" ; then ++ rm "$SCREEN_LOG" ++ fi ++ fi ++ save_screen_real & ++ while test 1 ; do ++ if test x"$SCREEN_LOG" = xSTDOUT ; then ++ if test -f /var/tmp/STDOUT.log ; then ++ break ++ fi ++ else ++ if test -f "$SCREEN_LOG" ; then ++ break ++ fi ++ fi ++ sleep 1 ++ done ++} ++ ++ ++create_test_user() ++{ ++ if grep -q $TEST_USER /etc/passwd; then ++ return; ++ fi ++ useradd -d $TEST_USER_HOME -m -s /bin/bash $TEST_USER ++ pwconv ++ passwd -d $TEST_USER ++} ++ ++ ++create_autologin_gdm() ++{ ++ if test -f $GDM_CONF && grep -q $TEST_USER $GDM_CONF; then ++ return; ++ fi ++ cat > $GDM_CONF << _EOF_GDM_CONF ++[daemon] ++AutomaticLoginEnable=true ++AutomaticLogin=$TEST_USER ++_EOF_GDM_CONF ++} ++ ++ ++create_xdg_autostart() ++{ ++ if test -f "$TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" ; then ++ return ++ fi ++ if test ! -d "$TEST_USER_HOME" ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: No $TEST_USER_HOME" ++ exit 1 ++ fi ++ desktop_file="$AUTOSTART_DESKTOP_DIR/$AUTOSTART_DESKTOP_FILE" ++ if test ! -f $desktop_file ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: No $desktop_file" ++ exit 1 ++ fi ++ mkdir -p "$TEST_USER_HOME/.config/autostart" ++ cp "$desktop_file" "$TEST_USER_HOME/.config/autostart" ++ LINE="AutostartCondition=if-exists $TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" ++ echo "$LINE" >> "$TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" ++ chown -R "$TEST_USER" "$TEST_USER_HOME/.config" ++} ++ ++ ++delete_test_user() ++{ ++ print_log "Deleting $TEST_USER" ++ pkill -u $TEST_USER ++ if grep -q $TEST_USER /etc/passwd; then ++ userdel -r $TEST_USER ++ fi ++ if test -f $GDM_CONF && grep -q $TEST_USER $GDM_CONF; then ++ rm $GDM_CONF ++ fi ++ ++ if echo "$SESSION_COMMAND" | grep -q gnome-session ; then ++ SESSION_IS_GNOME=1 ++ else ++ SESSION_IS_GNOME=0 ++ fi ++ ++ LOGIN_USER=$USER ++ LOGIN_HOME=$HOME ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ LOGIN_USER=$TEST_USER ++ LOGIN_HOME=$TEST_USER_HOME ++ fi ++ ++ print_log "Deleting $LOGIN_USER environments" ++ if test -f "$LOGIN_HOME/.config/gnome-initial-setup-done" ; then ++ rm "$LOGIN_HOME/.config/gnome-initial-setup-done" ++ fi ++ if test -f "$LOGIN_HOME/.config/user-dirs.locale" ; then ++ rm "$LOGIN_HOME/.config/user-dirs.locale" ++ fi ++ if test -f /var/lib/AccountsService/users/$LOGIN_USER ; then ++ rm /var/lib/AccountsService/users/$LOGIN_USER ++ fi ++ sync ++} ++ ++ ++init_session() ++{ ++ if [ "$RESULT_LOG" != "" ] ; then ++ if [ -f $RESULT_LOG ] ; then ++ rm $RESULT_LOG ++ fi ++ fi ++ echo "$TEST_LOG" | grep ':stdout' > /dev/null ++ HAS_STDOUT=$? ++ if [ $HAS_STDOUT -eq 0 ] ; then ++ TEST_LOG=`echo "$TEST_LOG" | sed -e 's|:stdout||'` ++ TEST_LOG_STDOUT=1 ++ fi ++ if [ "$TEST_LOG" = "" ] ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: a log file is required to get return value with 'read' command" ++ exit 1 ++ elif [ -f $TEST_LOG ] ; then ++ rm $TEST_LOG ++ fi ++ ++ if echo "$SESSION_COMMAND" | grep -q gnome-session ; then ++ SESSION_IS_GNOME=1 ++ else ++ SESSION_IS_GNOME=0 ++ fi ++ ++ LOGIN_USER=$USER ++ LOGIN_HOME=$HOME ++ check_tty ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ SESSION_FILE1="/usr/lib/systemd/system/gnome-headless-session@.service" ++ SESSION_FILE2="/usr/lib/systemd/system/graphical.target" ++ if [ $HAVE_GRAPHICS -eq 0 ] && [ ! -f "$SESSION_FILE1" ] ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: No $SESSION_FILE1: You need to install 'gdm' and 'systemd' package" ++ exit 1 ++ fi ++ if [ $HAVE_GRAPHICS -eq 1 ] ; then ++ if [ ! -f "$SESSION_FILE2" ] ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: No $SESSION_FILE2: You need to install 'systemd' package" ++ exit 1 ++ fi ++ if [ ! -f /usr/sbin/gdm ] ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: No /usr/sbin/gdm: Currently only gdm is supported for auto login." ++ exit 1 ++ fi ++ fi ++ create_test_user ++ create_autologin_gdm ++ create_xdg_autostart ++ LOGIN_USER=$TEST_USER ++ LOGIN_HOME=$TEST_USER_HOME ++ else ++ rm -f $TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE ++ fi ++ ++ if [ ! -f $LOGIN_HOME/.config/gnome-initial-setup-done ] ; then ++ mkdir -p $LOGIN_HOME/.config ++ touch $LOGIN_HOME/.config/gnome-initial-setup-done ++ chown -R $LOGIN_USER $LOGIN_HOME/.config ++ fi ++ IS_SYSTEM_ACCOUNT=false ++ if [ "$LOGIN_USER" = "root" ] ; then ++ IS_SYSTEM_ACCOUNT=true ++ fi ++ if test x"$SESSION_LANG" = x ; then ++ SESSION_LANG=$LANG ++ fi ++ if test -f /var/lib/AccountsService/users/$LOGIN_USER; then ++ sed -i -e "s/\(Language=\).*/\1$SESSION_LANG/" \ ++ /var/lib/AccountsService/users/$LOGIN_USER ++ else ++ mkdir -p /var/lib/AccountsService/users ++ cat > /var/lib/AccountsService/users/$LOGIN_USER << _EOF_AS_CONF ++[User] ++Language=$SESSION_LANG ++XSession=gnome ++SystemAccount=$IS_SYSTEM_ACCOUNT ++_EOF_AS_CONF ++ fi ++ ++ # Prevent from launching a XDG dialog ++ XDG_LOCALE_FILE="$LOGIN_HOME/.config/user-dirs.locale" ++ if [ -f $XDG_LOCALE_FILE ] ; then ++ XDG_LANG_ORIG=`cat $XDG_LOCALE_FILE` ++ XDG_LANG_NEW=`echo $SESSION_LANG | sed -e 's/\(.*\)\..*/\1/'` ++ if [ "$XDG_LANG_ORIG" != "$XDG_LANG_NEW" ] ; then ++ echo "# Overriding XDG locale $XDG_LANG_ORIG with $XDG_LANG_NEW" ++ echo "$XDG_LANG_NEW" > $XDG_LOCALE_FILE ++ fi ++ fi ++ ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ return ++ 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 1 ++ 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 ++} ++ ++ ++run_dbus_daemon() ++{ ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ return ++ fi ++ # 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" ++} ++ ++ ++init_gnome() ++{ ++ if test $SESSION_IS_GNOME -ne 1 ; then ++ print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Should not be called" ++ exit 1 ++ fi ++ LOGIN_USER=$USER ++ if test $ENABLED_SYSTEMD -eq 1 ; then ++ LOGIN_USER=$TEST_USER ++ fi ++ # gsettings set command needs dconf-service with the same $DISPLAY ++ pkill dconf-service ++ # G_MESSAGES_DEBUG=all or G_MESSAGES_DEBUG=GLib-GIO-DEBUG would append ++ # debug messages to gsettings output and could not get the result correctly. ++ backup_G_MESSAGES_DEBUG="$G_MESSAGES_DEBUG" ++ unset G_MESSAGES_DEBUG ++ # Disable Tour dialog to get focus ++ GET_WELCOME_DIALOG="gsettings get org.gnome.shell welcome-dialog-last-shown-version" ++ if test $LOGIN_USER = $USER ; then ++ V=`dbus-run-session $GET_WELCOME_DIALOG` ++ else ++ V=`sudo -u $LOGIN_USER dbus-run-session $GET_WELCOME_DIALOG` ++ fi ++ if [ x"$V" = x"''" ] ; then ++ SET_WELCOME_DIALOG="gsettings set org.gnome.shell welcome-dialog-last-shown-version '100'" ++ if test $LOGIN_USER = $USER ; then ++ dbus-run-session $SET_WELCOME_DIALOG ++ else ++ sudo -u $LOGIN_USER dbus-run-session $SET_WELCOME_DIALOG ++ fi ++ fi ++ # gnome-shell now starts overview mode by login. ++ # https://extensions.gnome.org/extension/4099/no-overview/ ++ NO_SYS_DIR=/usr/share/gnome-shell/extensions/no-overview@fthx ++ if test $LOGIN_USER = $USER ; then ++ NO_USER_DIR=$HOME/.local/share/gnome-shell/extensions/no-overview@fthx ++ else ++ NO_USER_DIR=$TEST_USER_HOME/.local/share/gnome-shell/extensions/no-overview@fthx ++ fi ++ if [ ! -d $NO_SYS_DIR ] && [ ! -d $NO_USER_DIR ] ; then ++ mkdir -p "`dirname $NO_USER_DIR`" ++ cp -R "no-overview@fthx" "`dirname $NO_USER_DIR`" ++ if test $LOGIN_USER = $USER ; then ++ chown -R $LOGIN_USER $HOME/.local ++ else ++ chown -R $LOGIN_USER $TEST_USER_HOME/.local ++ fi ++ fi ++ if [ $LOGIN_USER != $USER ] ; then ++ SHELL_SERVICE_FILE="org.gnome.Shell@wayland.service" ++ SYSTEMD_USER_DIR="$TEST_USER_HOME/.config/systemd/user" ++ if test $HAVE_GRAPHICS -ne 1 ; then ++ if test ! -f "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" ; then ++ mkdir -p "$SYSTEMD_USER_DIR" ++ pushd "$SYSTEMD_USER_DIR" ++ sed -e "s|^ExecStart=.*|ExecStart=$GNOME_SHELL_WAYLAND_COMMAND|" \ ++ $SYSTEMD_SYSTEM_DIR/$SHELL_SERVICE_FILE \ ++ > $SHELL_SERVICE_FILE ++ diff $SYSTEMD_SYSTEM_DIR/$SHELL_SERVICE_FILE $SHELL_SERVICE_FILE ++ popd ++ chown -R $LOGIN_USER "$TEST_USER_HOME/.config" ++ fi ++ else ++ if test -f "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" ; then ++ rm "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" ++ fi ++ fi ++ fi ++ GET_DISABLE_USER_EX="gsettings get org.gnome.shell disable-user-extensions" ++ if test $LOGIN_USER = $USER ; then ++ V=`dbus-run-session $GET_DISABLE_USER_EX` ++ else ++ V=`sudo -u $LOGIN_USER dbus-run-session $GET_DISABLE_USER_EX` ++ fi ++ if [ x"$V" = x"true" ] ; then ++ SET_DISABLE_USER_EX="gsettings set org.gnome.shell disable-user-extensions false" ++ if test $LOGIN_USER = $USER ; then ++ dbus-run-session $SET_DISABLE_USER_EX ++ else ++ sudo -u $LOGIN_USER dbus-run-session $SET_DISABLE_USER_EX ++ fi ++ fi ++ GET_ENABLED_EXS="gsettings get org.gnome.shell enabled-extensions" ++ if test $LOGIN_USER = $USER ; then ++ V=`dbus-run-session $GET_ENABLED_EXS` ++ else ++ V=`sudo -u $LOGIN_USER dbus-run-session $GET_ENABLED_EXS` ++ fi ++ echo "$V" | grep "no-overview" > /dev/null ++ V2=$? ++ if [ $V2 -ne 0 ] ; then ++ V3=`echo "$V" | sed -e 's/@as //' -e 's/\[//' -e 's/\]//'` ++ if [ x"$V3" = x"''" ] || [ x"$V3" = x"" ]; then ++ V4="['no-overview@fthx']" ++ else ++ V4="[$V3,'no-overview@fthx']" ++ fi ++ SET_ENABLED_EXS="gsettings set org.gnome.shell enabled-extensions \"$V4\"" ++ if test $LOGIN_USER = $USER ; then ++ eval dbus-run-session $SET_ENABLED_EXS ++ else ++ eval sudo -u $LOGIN_USER dbus-run-session $SET_ENABLED_EXS ++ fi ++ fi ++ # Disable notify dialog when the disk usage is low. ++ SET_NOTIFY_DISK="gsettings set org.gnome.settings-daemon.plugins.housekeeping free-size-gb-no-notify 0" ++ if test $LOGIN_USER = $USER ; then ++ eval dbus-run-session $SET_NOTIFY_DISK ++ else ++ eval sudo -u $LOGIN_USER dbus-run-session $SET_NOTIFY_DISK ++ fi ++ if [ x"$backup_G_MESSAGES_DEBUG" != x ] ; then ++ export G_MESSAGES_DEBUG="$backup_G_MESSAGES_DEBUG" ++ fi ++} ++ ++ ++operate_desktop_with_systemd() ++{ ++ SESSION=gnome-headless-session ++ COMMAND="$1" ++ ++ #if test $HAVE_GRAPHICS -eq 1 ; then ++ case "$COMMAND" in ++ "start") systemctl isolate graphical.target ++ echo "" ++ ;; ++ "stop") init 3;; ++ "") print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Wrong command $COMMAND" ++ exit 1;; ++ esac ++ #else ++ # setenforce 0 ++ # systemctl $COMMAND ${SESSION}@${TEST_USER} ++ #fi ++ case "$COMMAND" in ++ "start") sleep 30;; ++ "") ;; ++ esac ++ #if test $HAVE_GRAPHICS -eq 1 ; then ++ systemctl status --no-pager graphical.target ++ #else ++ # systemctl status --no-pager ${SESSION}@${TEST_USER} ++ #fi ++ ps -ef | grep X ++ ps -ef | grep session ++ ps -ef | grep ibus ++} ++ ++ ++run_session() ++{ ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ init_gnome ++ operate_desktop_with_systemd "start" ++ return ++ fi ++ export DISPLAY=:99.0 ++ if test $HAVE_GRAPHICS -eq 1 ; then ++ /usr/libexec/Xorg.wrap -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . $DISPLAY & ++ else ++ /usr/bin/Xvfb $DISPLAY -noreset +extension GLX +extension RANDR +extension RENDER -screen 0 1280x1024x24 & ++ fi ++ PID_XORG=$! ++ sleep 1 ++ # init_gnome need to be called with $DISPLAY before gnome-session is called ++ if [ $SESSION_IS_GNOME -eq 1 ] ; then ++ init_gnome ++ fi ++ echo "Running $SESSION_COMMAND with $USER and LANG=$SESSION_LANG in `tty`" ++ if test x"$SESSION_LANG" = x ; then ++ $SESSION_COMMAND & ++ else ++ env LANG=$SESSION_LANG $SESSION_COMMAND & ++ fi ++ PID_GNOME_SESSION=$! ++ sleep 30 ++ ++ IBUS_ARGS="--verbose --panel disable" ++ # gnome-shell 42 checks if org.freedesktop.IBus.session.GNOME.service ++ # systemd file is available with org.freedesktop.systemd1.Manager.GetUnit ++ # D-Bus method, which is provided by IBus 1.5.26, and if the file ++ # 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. ++ if test $VERBOSE -eq 1 ; then ++ ibus-daemon $IBUS_ARGS & ++ else ++ ibus-daemon $IBUS_ARGS --daemonize ++ fi ++ sleep 3 ++ ps -ef | grep ibus ++} ++ ++ ++count_case_result() ++{ ++ retval=$1 ++ pass=$2 ++ fail=$3 ++ ++ if test $retval -eq 0 ; then ++ pass=`expr $pass + 1` ++ else ++ fail=`expr $fail + 1` ++ fi ++ echo $pass $fail ++} ++ ++ ++echo_case_result() ++{ ++ retval=$1 ++ tst=$2 ++ subtst=${3:-''} ++ ++ if test $retval -eq 0 ; then ++ echo "PASS: $tst $subtst" >>$TEST_LOG ++ else ++ echo "FAIL: $tst $subtst" >>$TEST_LOG ++ fi ++} ++ ++ ++wait_for_systemd_autostart() ++{ ++ PS_IBUS="ps -ef | grep ibus-desktop-testing | grep autostart | grep -v grep" ++ i=0 ++ while test 1 ; do ++ R=`eval "$PS_IBUS"` ++ if test x"$R" != x ; then ++ break; ++ fi ++ if test $i -ge 12 ; then ++ print_log -e "${RED}FAIL${NC}: Timeout to run ibus-desktop-testing-autostart" ++ return ++ fi ++ i=`expr $i + 1` ++ sleep 5 ++ done ++ print_log -e "Start ibus-desktop-testing-autostart" ++ i=0 ++ while test 1 ; do ++ R=`eval "$PS_IBUS"` ++ if test x"$R" = x ; then ++ break; ++ fi ++ if test $i -ge $TIMEOUT ; then ++ print_log -e "${RED}FAIL${NC}: Timeout to exit ibus-desktop-testing-autostart" ++ return ++ fi ++ i=`expr $i + 1` ++ sleep 5 ++ done ++ print_log -e "Exit ibus-desktop-testing-autostart" ++} ++ ++run_direct_test_cases() ++{ ++ pass=0 ++ fail=0 ++ for tst in $TESTS; do ++ ENVS= ++ if test -f $SRCDIR/${tst}.env ; then ++ ENVS="`cat $SRCDIR/${tst}.env`" ++ fi ++ if test x"$ENVS" = x ; then ++ $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG ++ retval=$? ++ read pass fail << EOF_COUNT ++ `count_case_result $retval $pass $fail` ++EOF_COUNT ++ echo_case_result $retval $tst ++ CACHE_FILES=`ls *.cache` ++ if [ x"$CACHE_FILES" != x ] ; then ++ echo "# Clean $CACHE_FILES" >>$TEST_LOG ++ rm $CACHE_FILES ++ fi ++ else ++ i=1 ++ # Deleted for var in "$ENVS" because IFS=$'\n' is not supported ++ # in POSIX sh ++ while read e ; do ++ first=`echo "$e" | grep '^#'` ++ if test x"$first" = x"#" ; then ++ continue ++ fi ++ echo "# Starting $e $BUILDDIR/$tst $SRCDIR" >>$TEST_LOG ++ env $e $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG ++ retval=$? ++ echo "# Finished $e $BUILDDIR/$tst $SRCDIR with $retval" >>$TEST_LOG ++ read pass fail << EOF_COUNT ++ `count_case_result $retval $pass $fail` ++EOF_COUNT ++ echo_case_result $retval $tst $e ++ CACHE_FILES=`ls *.cache` ++ if [ x"$CACHE_FILES" != x ] ; then ++ echo "# Clean $CACHE_FILES" >>$TEST_LOG ++ rm $CACHE_FILES ++ fi ++ i=`expr $i + 1` ++ done << EOF_ENVS ++ `echo "$ENVS"` ++EOF_ENVS ++ fi ++ done ++ echo $pass $fail ++} ++ ++ ++run_gnome_desktop_testing_runner() ++{ ++ pass=0 ++ fail=0 ++ if [ x"$TESTS" = x ] ; then ++ TESTS='ibus' ++ fi ++ if echo $PROGNAME | grep -q autostart ; then ++ export IBUS_DAEMON_WITH_SYSTEMD=1 ++ fi ++ for tst in $TESTS; do ++ tst_dir="$TEST_CASE_DIR/$tst" ++ if [ ! -d "$tst_dir" ] ; then ++ print_log -e "${RED}FAIL${NC}: Not found %tst_dir" ++ fail=1 ++ continue ++ fi ++ gnome-desktop-testing-runner --timeout=$TIMEOUT $tst \ ++ 2>>$TEST_LOG 1>>$TEST_LOG ++ retval=$? ++ read pass fail << EOF ++ `count_case_result $retval $pass $fail` ++EOF ++ done ++ child_pass=`grep '^PASS:' $TEST_LOG | wc -l` ++ child_fail=`grep '^FAIL:' $TEST_LOG | wc -l` ++ if [ $child_pass -ne 0 ] || [ $child_fail -ne 0 ] ; then ++ pass=$child_pass ++ if [ $child_fail -ne 0 ] ; then ++ fail=`expr $child_fail / 2` ++ else ++ fail=0 ++ fi ++ fi ++ echo $pass $fail ++} ++ ++ ++run_test_suite() ++{ ++ print_log -e "Start test suite `date '+%F %H:%M:%S:%N'`" ++ if echo $PROGNAME | grep -q runner ; then ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ wait_for_systemd_autostart ++ return ++ fi ++ if ps -ef | grep X | grep -q wayland ; then ++ # Expect GTK_IM_MODULE=wayland by default ++ : ++ else ++ export GTK_IM_MODULE=ibus ++ fi ++ else ++ if test x"$XDG_SESSION_TYPE" = xwayland ; then ++ : ++ else ++ export GTK_IM_MODULE=ibus ++ fi ++ fi ++ pass=0 ++ fail=0 ++ export IBUS_COMPOSE_CACHE_DIR=$PWD ++ if test x"$TESTING_RUNNER" = x ; then ++ return ++ fi ++ case $TESTING_RUNNER in ++ default) ++ # Get only the last value with do-while. ++ read pass fail << EOF_RUNNER ++ `run_direct_test_cases` ++EOF_RUNNER ++ ;; ++ gnome) ++ read pass fail << EOF_RUNNER ++ `run_gnome_desktop_testing_runner` ++EOF_RUNNER ++ ;; ++ esac ++ echo "" ++ print_log -e "End test suite `date '+%F %H:%M:%S:%N'`" ++ # Fedora CI assumes the test is failed even if $fail is 0. ++ if [ $pass -ne 0 ] ; then ++ print_log -e "${GREEN}PASS${NC}: $pass" ++ fi ++ if [ $fail -ne 0 ] ; then ++ print_log -e "${RED}FAIL${NC}: $fail" ++ fi ++} ++ ++ ++finit() ++{ ++ if test $PID_XORG -ne 0 ; then ++ echo "# Killing left gnome-session and Xorg" ++ kill $PID_GNOME_SESSION $PID_XORG ++ ibus exit ++ SUSER=`echo "$USER" | cut -c 1-7` ++ LEFT_CALENDAR=`ps -ef | grep gnome-shell-calendar-server | grep $SUSER | grep -v grep` ++ if test x"$LEFT_CALENDAR" != x ; then ++ echo "# Killing left gnome-shell-calendar-server" ++ echo "$LEFT_CALENDAR" ++ echo "$LEFT_CALENDAR" | awk '{print $2}' | xargs kill ++ fi ++ fi ++ if echo $PROGNAME | grep -q runner ; then ++ if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then ++ operate_desktop_with_systemd "stop" ++ fi ++ fi ++ ++ echo "" ++ if test -f $TEST_LOG ; then ++ if [ $TEST_LOG_STDOUT -eq 1 ] ; then ++ cat $TEST_LOG ++ else ++ echo "# See $TEST_LOG" ++ fi ++ fi ++ echo "# Finished $PROGNAME testing" ++} +diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in +index 1ac2dfc8..1d82bc76 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-2021 Takao Fujiwara ++# Copyright (c) 2018-2024 Takao Fujiwara + # Copyright (c) 2018 Red Hat, Inc. + # + # This program is free software; you can redistribute it and/or modify +@@ -22,58 +22,39 @@ + # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + + # This test runs /usr/bin/ibus-daemon after install ibus +-# +-# # init 3 +-# Login as root +-# # /root/ibus/tests/test-console.sh --tests ibus-compose \ +-# --builddir /root/ibus/src/tests --srcdir /root/ibus/src/tests +- +-# POSIX sh has no 'echo -e' +-: ${ECHO:='/usr/bin/echo'} +-# POSIX sh has $UID +-# DASH saves the graves in '``' as characters not to be extracted +-: ${UID:=`id -u`} + + + PROGNAME=`basename $0` +-VERSION=0.3 +-DISPLAY=:99.0 +-BUILDDIR="." +-SRCDIR="." ++TEST_CASE_DIR="@INSTALLEDDIR@" ++MODULE_SH='ibus-desktop-testing-module' ++MODULE_SH_PATH="@LIBEXECDIR@/$MODULE_SH" ++AUTOSTART_DESKTOP_DIR="@DATADIR@/ibus/tests" + TEST_LOG="test-suite.log" +-TEST_LOG_STDOUT=0 +-RESULT_LOG="" +-SCREEN_LOG="" +-HAVE_GRAPHICS=1 +-VERBOSE=0 +-DESKTOP_COMMAND="dbus-launch --exit-with-session gnome-session" +-PID_XORG=0 +-PID_GNOME_SESSION=0 + TESTING_RUNNER="default" +-TESTS="" +-TIMEOUT=300 +-GREEN='\033[0;32m' +-RED='\033[0;31m' +-NC='\033[0m' + + +-print_log() +-{ +- if [ x"$RESULT_LOG" != x ] ; then +- # avoid 'echo -e' before call 'sed'. +- if [ x"$1" = x'-e' ] ; then +- shift +- fi +- NO_ESCAPE=`echo "$@" | sed -e 's/\\\033\\[0;3.m//g' -e 's/\\\033\\[0m//g'` +- $ECHO $NO_ESCAPE >> $RESULT_LOG +- else +- $ECHO "$@" +- fi +-} ++if test -f $MODULE_SH_PATH ; then ++ . $MODULE_SH_PATH ++elif test -f $(dirname $0)/$MODULE_SH ; then ++ . $(dirname $0)/$MODULE_SH ++else ++ echo "Not found $MODULE_SH" ++ exit 1 ++fi + + + usage() + { ++ command="" ++ for element in $SESSION_COMMAND; do ++ if test x"$element" = x; then ++ continue ++ fi ++ if echo "$element" | grep -q -E "^-" ; then ++ continue ++ fi ++ command="$element" ++ done + $ECHO -e \ + "This test runs /usr/bin/ibus-daemon after install ibus\n" \ + "$PROGNAME [OPTIONS…]\n" \ +@@ -83,429 +64,37 @@ usage() + "-v, --version Show version\n" \ + "-b, --builddir=BUILDDIR Set the BUILDDIR\n" \ + "-s, --srcdir=SOURCEDIR Set the SOURCEDIR\n" \ +-"-c, --no-graphics Use Xvfb instead of Xorg\n" \ ++"-c, --no-graphics Use Xvfb instead of Xorg or Wayland\n" \ + "-V, --verbose Verbose log for ibus-daemon\n" \ +-"-d, --desktop=DESKTOP Run DESTKTOP. The default is gnome-session.\n" \ +-" Suffix '-with-dbus' can run DESKTOP with dbus session." \ +-" E.g. --desktop=mutter-with-dbus" \ ++"-d, --session=SESSION Run SESSION. The default is ${command}.\n" \ ++" Suffix '-with-dbus' can run SESSION with dbus session.\n" \ ++" E.g. --session=${command}-with-dbus\n" \ ++"-l, --lang=LANG Run SESSION with LANG\n" \ + "-t, --tests=\"TESTS...\" Run TESTS programs which is separated by space\n" \ + "-r, --runner=RUNNER Run TESTS programs with a test RUNNER.\n" \ +-" RUNNDER = gnome or default.\n" \ +-" default is an embedded runner.\n" \ ++" RUNNDER = 'gnome' or 'default'.\n" \ ++" 'default' is an embedded runner.\n" \ ++"-i, --no-systemd Run gnome-seesion directly withoout systemd\n" \ ++" and login manager for legacy GNOME and this\n" \ ++" mode does not support Wayland.\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" \ +-"-S, --screendump=DUMP_FILE OUtput the screen to DUMP_FILE ('STDOUT' can be stdout)\n" \ ++"-o, --output=OUTPUT_FILE Output the log to OUTPUT_FILE\n" \ ++" default is $TEST_LOG\n" \ ++"-O, --result=RESULT_FILE Output the result to RESULT_FILE\n" \ ++" default is stdout\n" \ ++"-S, --screendump=DUMP_FILE Output the screen to DUMP_FILE ('STDOUT' can be stdout)\n" \ ++"-D, --delete-tests Delete test enviroments and user $TEST_USER\n" \ + "" + } + + +-parse_args() +-{ +- # This is GNU getopt. "sudo port getopt" in BSD? +- ARGS=`getopt -o hvb:s:cVd:t:r:T:o:O:S: --long \ +- help,version,builddir:,srcdir:,no-graphics,verbose,desktop:,tests:,runner:,timeout:,output:,result:,screendump:\ +- -- "$@"`; +- eval set -- "$ARGS" +- while [ 1 ] ; do +- case "$1" in +- -h | --help ) usage; exit 0;; +- -v | --version ) $ECHO -e "$VERSION"; exit 0;; +- -b | --builddir ) BUILDDIR="$2"; shift 2;; +- -s | --srcdir ) SRCDIR="$2"; shift 2;; +- -c | --no-graphics ) HAVE_GRAPHICS=0; shift;; +- -V | --verbose ) VERBOSE=1; shift;; +- -d | --desktop ) DESKTOP_COMMAND="$2"; shift 2;; +- -t | --tests ) TESTS="$2"; shift 2;; +- -r | --runner ) TESTING_RUNNER="$2"; shift 2;; +- -T | --timeout ) TIMEOUT="$2"; shift 2;; +- -o | --output ) TEST_LOG="$2"; shift 2;; +- -O | --result ) RESULT_LOG="$2"; shift 2;; +- -S | --screendump ) SCREEN_LOG="$2"; shift 2;; +- -- ) shift; break;; +- * ) usage; exit 1;; +- esac +- done +- DL='$' +- echo "$DESKTOP_COMMAND" | grep "\-with\-dbus$DL" > /dev/null +- HAS_DBUS_SUFFIX=$? +- if [ $HAS_DBUS_SUFFIX -eq 0 ] ; then +- DESKTOP_COMMAND=`echo "$DESKTOP_COMMAND" | sed -e 's/-with-dbus$//'` +- DESKTOP_COMMAND="dbus-launch --exit-with-session $DESKTOP_COMMAND" +- fi +-} +- +- +-init_desktop() +-{ +- if [ "$RESULT_LOG" != "" ] ; then +- if [ -f $RESULT_LOG ] ; then +- rm $RESULT_LOG +- fi +- fi +- echo "$TEST_LOG" | grep ':stdout' > /dev/null +- HAS_STDOUT=$? +- if [ $HAS_STDOUT -eq 0 ] ; then +- TEST_LOG=`echo "$TEST_LOG" | sed -e 's|:stdout||'` +- TEST_LOG_STDOUT=1 +- fi +- if [ "$TEST_LOG" = "" ] ; then +- print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: a log file is required to get return value with 'read' command" +- exit 255 +- elif [ -f $TEST_LOG ] ; then +- rm $TEST_LOG +- fi +- if [ x$FORCE_TEST != x ] ; then +- RUN_ARGS="$RUN_ARGS --force" +- fi +- +- if [ ! -f $HOME/.config/gnome-initial-setup-done ] ; then +- IS_SYSTEM_ACCOUNT=false +- if [ "$USER" = "root" ] ; then +- IS_SYSTEM_ACCOUNT=true +- fi +- if test ! -f /var/lib/AccountsService/users/$USER ; then +- mkdir -p /var/lib/AccountsService/users +- cat >> /var/lib/AccountsService/users/$USER << _EOF +-[User] +-Language=ja_JP.UTF-8 +-XSession=gnome +-SystemAccount=$IS_SYSTEM_ACCOUNT +-_EOF +- fi +- mkdir -p $HOME/.config +- touch $HOME/.config/gnome-initial-setup-done +- fi +- +- # Prevent from launching a XDG dialog +- XDG_LOCALE_FILE="$HOME/.config/user-dirs.locale" +- if [ -f $XDG_LOCALE_FILE ] ; then +- XDG_LANG_ORIG=`cat $XDG_LOCALE_FILE` +- XDG_LANG_NEW=`echo $LANG | sed -e 's/\(.*\)\..*/\1/'` +- if [ "$XDG_LANG_ORIG" != "$XDG_LANG_NEW" ] ; then +- echo "# Overriding XDG locale $XDG_LANG_ORIG with $XDG_LANG_NEW" +- echo "$XDG_LANG_NEW" > $XDG_LOCALE_FILE +- fi +- 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 +-} +- +- +-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" +-} +- +- +-init_gnome() +-{ +- # gsettings set command needs dconf-service with the same $DISPLAY +- pkill dconf-service +- # G_MESSAGES_DEBUG=all or G_MESSAGES_DEBUG=GLib-GIO-DEBUG would append +- # debug messages to gsettings output and could not get the result correctly. +- backup_G_MESSAGES_DEBUG="$G_MESSAGES_DEBUG" +- unset G_MESSAGES_DEBUG +- # Disable Tour dialog to get focus +- V=`gsettings get org.gnome.shell welcome-dialog-last-shown-version` +- if [ x"$V" = x"''" ] ; then +- gsettings set org.gnome.shell welcome-dialog-last-shown-version '100' +- fi +- # gnome-shell now starts overview mode by login. +- # https://extensions.gnome.org/extension/4099/no-overview/ +- NO_SYS_DIR=/usr/share/gnome-shell/extensions/no-overview@fthx +- NO_USER_DIR=$HOME/.local/share/gnome-shell/extensions/no-overview@fthx +- if [ ! -d $NO_SYS_DIR ] && [ ! -d $NO_USER_DIR ] ; then +- mkdir -p "`dirname $NO_USER_DIR`" +- cp -R "no-overview@fthx" "`dirname $NO_USER_DIR`" +- fi +- V=`gsettings get org.gnome.shell disable-user-extensions` +- if [ x"$V" = x"true" ] ; then +- gsettings set org.gnome.shell disable-user-extensions false +- fi +- V=`gsettings get org.gnome.shell enabled-extensions` +- echo "$V" | grep "no-overview" > /dev/null +- V2=$? +- if [ $V2 -ne 0 ] ; then +- V3=`echo "$V" | sed -e 's/@as //' -e 's/\[//' -e 's/\]//'` +- if [ x"$V3" = x"''" ] || [ x"$V3" = x"" ]; then +- V4="['no-overview@fthx']" +- else +- V4="[$V3, 'no-overview@fthx']" +- fi +- gsettings set org.gnome.shell enabled-extensions "$V4" +- fi +- if [ x"$backup_G_MESSAGES_DEBUG" != x ] ; then +- export G_MESSAGES_DEBUG="$backup_G_MESSAGES_DEBUG" +- fi +-} +- +- +-run_desktop() +-{ +- echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null +- HAS_GNOME=$? +- export DISPLAY=$DISPLAY +- if test $HAVE_GRAPHICS -eq 1 ; then +- /usr/libexec/Xorg.wrap -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./xorg.log -config ./xorg.conf -configdir . $DISPLAY & +- else +- /usr/bin/Xvfb $DISPLAY -noreset +extension GLX +extension RANDR +extension RENDER -screen 0 1280x1024x24 & +- fi +- PID_XORG=$! +- sleep 1 +- # init_gnome need to be called with $DISPLAY before gnome-session is called +- if [ $HAS_GNOME -eq 0 ] ; then +- init_gnome +- fi +- echo "Running $DESKTOP_COMMAND with $USER in `tty`" +- $DESKTOP_COMMAND & +- PID_GNOME_SESSION=$! +- sleep 30 +- +- IBUS_ARGS="--verbose --panel disable" +- # gnome-shell 42 checks if org.freedesktop.IBus.session.GNOME.service +- # systemd file is available with org.freedesktop.systemd1.Manager.GetUnit +- # D-Bus method, which is provided by IBus 1.5.26, and if the file +- # 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. +- if test $VERBOSE -eq 1 ; then +- ibus-daemon $IBUS_ARGS & +- else +- ibus-daemon $IBUS_ARGS --daemonize +- fi +- sleep 3 +- if test $VERBOSE -eq 1 ; then +- ps -ef | grep ibus +- fi +-} +- +- +-count_case_result() +-{ +- retval=$1 +- pass=$2 +- fail=$3 +- +- if test $retval -eq 0 ; then +- pass=`expr $pass + 1` +- else +- fail=`expr $fail + 1` +- fi +- echo $pass $fail +-} +- +- +-echo_case_result() +-{ +- retval=$1 +- tst=$2 +- subtst=${3:-''} +- +- if test $retval -eq 0 ; then +- echo "PASS: $tst $subtst" >>$TEST_LOG +- else +- echo "FAIL: $tst $subtst" >>$TEST_LOG +- fi +-} +- +- +-run_direct_test_cases() +-{ +- pass=0 +- fail=0 +- for tst in $TESTS; do +- ENVS= +- if test -f $SRCDIR/${tst}.env ; then +- ENVS="`cat $SRCDIR/${tst}.env`" +- fi +- if test x"$ENVS" = x ; then +- $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG +- retval=$? +- read pass fail << EOF_COUNT +- `count_case_result $retval $pass $fail` +-EOF_COUNT +- echo_case_result $retval $tst +- CACHE_FILES=`ls *.cache` +- if [ x"$CACHE_FILES" != x ] ; then +- echo "# Clean $CACHE_FILES" >>$TEST_LOG +- rm $CACHE_FILES +- fi +- else +- i=1 +- # Deleted for var in "$ENVS" because IFS=$'\n' is not supported +- # in POSIX sh +- while read e ; do +- first=`echo "$e" | grep '^#'` +- if test x"$first" = x"#" ; then +- continue +- fi +- echo "# Starting $e $BUILDDIR/$tst $SRCDIR" >>$TEST_LOG +- env $e $BUILDDIR/$tst $SRCDIR 2>>$TEST_LOG 1>>$TEST_LOG +- retval=$? +- echo "# Finished $e $BUILDDIR/$tst $SRCDIR with $retval" >>$TEST_LOG +- read pass fail << EOF_COUNT +- `count_case_result $retval $pass $fail` +-EOF_COUNT +- echo_case_result $retval $tst $e +- CACHE_FILES=`ls *.cache` +- if [ x"$CACHE_FILES" != x ] ; then +- echo "# Clean $CACHE_FILES" >>$TEST_LOG +- rm $CACHE_FILES +- fi +- i=`expr $i + 1` +- done << EOF_ENVS +- `echo "$ENVS"` +-EOF_ENVS +- fi +- done +- echo $pass $fail +-} +- +- +-run_gnome_desktop_testing_runner() +-{ +- pass=0 +- fail=0 +- if [ x"$TESTS" = x ] ; then +- TESTS='ibus' +- fi +- for tst in $TESTS; do +- tst_dir="@INSTALLEDDIR@/$tst" +- if [ ! -d "$tst_dir" ] ; then +- print_log -e "${RED}FAIL${NC}: Not found %tst_dir" +- fail=1 +- continue +- fi +- gnome-desktop-testing-runner --timeout=$TIMEOUT $tst \ +- 2>>$TEST_LOG 1>>$TEST_LOG +- retval=$? +- read pass fail << EOF +- `count_case_result $retval $pass $fail` +-EOF +- done +- child_pass=`grep '^PASS:' $TEST_LOG | wc -l` +- child_fail=`grep '^FAIL:' $TEST_LOG | wc -l` +- if [ $child_pass -ne 0 ] || [ $child_fail -ne 0 ] ; then +- pass=$child_pass +- if [ $child_fail -ne 0 ] ; then +- fail=`expr $child_fail / 2` +- else +- fail=0 +- fi +- fi +- echo $pass $fail +-} +- +- +-run_test_suite() +-{ +- pass=0 +- fail=0 +- export GTK_IM_MODULE=ibus +- export IBUS_COMPOSE_CACHE_DIR=$PWD +- if [ x"$TESTING_RUNNER" = x ] ; then +- TESTING_RUNNER="default" +- fi +- case $TESTING_RUNNER in +- default) +- # Get only the last value with do-while. +- read pass fail << EOF_RUNNER +- `run_direct_test_cases` +-EOF_RUNNER +- ;; +- gnome) +- read pass fail << EOF_RUNNER +- `run_gnome_desktop_testing_runner` +-EOF_RUNNER +- ;; +- esac +- echo "" +- # Fedora CI assumes the test is failed even if $fail is 0. +- if [ $pass -ne 0 ] ; then +- print_log -e "${GREEN}PASS${NC}: $pass" +- fi +- if [ $fail -ne 0 ] ; then +- print_log -e "${RED}FAIL${NC}: $fail" +- fi +- echo "" +- if [ $TEST_LOG_STDOUT -eq 1 ] ; then +- cat $TEST_LOG +- else +- echo "# See $TEST_LOG" +- fi +-} +- +- +-finit() +-{ +- echo "# Killing left gnome-session and Xorg" +- kill $PID_GNOME_SESSION $PID_XORG +- ibus exit +- SUSER=`echo "$USER" | cut -c 1-7` +- LEFT_CALENDAR=`ps -ef | grep gnome-shell-calendar-server | grep $SUSER | grep -v grep` +- if [ x"$LEFT_CALENDAR" != x ] ; then +- echo "# Killing left gnome-shell-calendar-server" +- echo "$LEFT_CALENDAR" +- echo "$LEFT_CALENDAR" | awk '{print $2}' | xargs kill +- fi +- +- echo "# Finished $PROGNAME testing" +-} +- +- + main() + { + parse_args "$@" +- init_desktop ++ init_session + run_dbus_daemon 2>>$TEST_LOG 1>>$TEST_LOG +- run_desktop 2>>$TEST_LOG 1>>$TEST_LOG +- if [ x"$SCREEN_LOG" != x ] ; then +- SCREEN_PNG="`date '+%Y%m%d%H%M%S'`.png" +- gnome-screenshot --file=$SCREEN_PNG +- if [ x"$SCREEN_LOG" = xSTDOUT ] ; then +- base64 $SCREEN_PNG +- else +- base64 $SCREEN_PNG > $SCREEN_LOG +- fi +- fi ++ run_session 2>>$TEST_LOG 1>>$TEST_LOG ++ save_screen + run_test_suite + finit + } +diff --git a/src/tests/ibus-desktop-testing.desktop.in b/src/tests/ibus-desktop-testing.desktop.in +index 1b815345..e91900ed 100644 +--- a/src/tests/ibus-desktop-testing.desktop.in ++++ b/src/tests/ibus-desktop-testing.desktop.in +@@ -2,7 +2,7 @@ + Name=IBus Desktop Testing Runner + GenericName=Input Method Desktop Testing Runner + Comment=Test plugin for IBus Desktop Testing +-Exec=@libexecdir@/ibus-desktop-testing-autostart /var/tmp/ibus-ci-autostart.log ++Exec=sh -c 'exec @libexecdir@/ibus-desktop-testing-autostart --envcheck --output $HOME/test-autostart.log --result $HOME/test.log --runner gnome --screendump $HOME/screen.log --tests ibus' + Terminal=false + Type=Application + Encoding=UTF-8 +-- +2.45.0 + +From 039fcb16f18d341a244362c3e797eeaa5c51010e Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Sat, 27 Jul 2024 19:02:09 +0900 +Subject: [PATCH 2/6] Fix tests cases to be run in Wayland + +- Fix ibus-bus since ibus_bus_exit_async() does not work ibus-daemon + with systemd and run `ibus restart` instead. +- Fix ibus-compose-locales to wait for 1 sec between key event test cases + to reset gnome-shell/mutter. +- Fix ibus-compose to wait for commit-text event since the gnome-shell/mutter + process is a bit slow and can reset the previous commit-text events + before the previous events are not committed. +- Fix counts in ibus-engine-switch. +- Unref IBusEngineDesc in ibus-engine-switch. +- Fix ibusimpl not to change the engine of the context when global-engine + is enabled. +- Check DISPLAY and setxkbmap in xkb-latin-layouts for Wayland + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + bus/ibusimpl.c | 8 ++ + bus/ibusimpl.h | 3 +- + bus/inputcontext.c | 9 +++ + src/ibusshare.c | 2 +- + src/tests/ibus-bus.c | 92 +++++++++++++++++++--- + src/tests/ibus-compose.c | 139 ++++++++++++++++++++++++--------- + src/tests/ibus-engine-switch.c | 45 ++++++++++- + src/tests/xkb-latin-layouts | 9 +++ + 8 files changed, 254 insertions(+), 53 deletions(-) + +diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c +index 445c062b..4bed9bc0 100644 +--- a/bus/ibusimpl.c ++++ b/bus/ibusimpl.c +@@ -2463,6 +2463,14 @@ bus_ibus_impl_is_embed_preedit_text (BusIBusImpl *ibus) + return ibus->embed_preedit_text; + } + ++gboolean ++bus_ibus_impl_is_use_global_engine (BusIBusImpl *ibus) ++{ ++ g_assert (BUS_IS_IBUS_IMPL (ibus)); ++ ++ return ibus->use_global_engine; ++} ++ + BusInputContext * + bus_ibus_impl_get_focused_input_context (BusIBusImpl *ibus) + { +diff --git a/bus/ibusimpl.h b/bus/ibusimpl.h +index e3b43f87..428b773b 100644 +--- a/bus/ibusimpl.h ++++ b/bus/ibusimpl.h +@@ -2,7 +2,7 @@ + /* vim:set et sts=4: */ + /* bus - The Input Bus + * Copyright (C) 2008-2013 Peng Huang +- * Copyright (C) 2022-2023 Takao Fujiwara ++ * Copyright (C) 2022-2024 Takao Fujiwara + * Copyright (C) 2008-2022 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or +@@ -94,6 +94,7 @@ BusComponent *bus_ibus_impl_lookup_component_by_name + gboolean bus_ibus_impl_is_use_sys_layout (BusIBusImpl *ibus); + gboolean bus_ibus_impl_is_embed_preedit_text + (BusIBusImpl *ibus); ++gboolean bus_ibus_impl_is_use_global_engine (BusIBusImpl *ibus); + BusInputContext *bus_ibus_impl_get_focused_input_context + (BusIBusImpl *ibus); + GHashTable *bus_ibus_impl_get_engine_focus_id_table +diff --git a/bus/inputcontext.c b/bus/inputcontext.c +index 1e795733..85358241 100644 +--- a/bus/inputcontext.c ++++ b/bus/inputcontext.c +@@ -1289,6 +1289,15 @@ _ic_set_engine (BusInputContext *context, + GDBusMethodInvocation *invocation) + { + gchar *engine_name = NULL; ++ BusIBusImpl *ibus = bus_ibus_impl_get_default (); ++ ++ if (bus_ibus_impl_is_use_global_engine (ibus)) { ++ g_dbus_method_invocation_return_error (invocation, ++ G_DBUS_ERROR, G_DBUS_ERROR_FAILED, ++ "Cannot set engines when use-global-engine is enabled."); ++ return; ++ } ++ + g_variant_get (parameters, "(&s)", &engine_name); + + if (!bus_input_context_has_focus (context)) { +diff --git a/src/ibusshare.c b/src/ibusshare.c +index 5ab6e889..57e3ef14 100644 +--- a/src/ibusshare.c ++++ b/src/ibusshare.c +@@ -2,7 +2,7 @@ + /* vim:set et sts=4: */ + /* ibus - The Input Bus + * Copyright (C) 2008-2010 Peng Huang +- * Copyright (C) 2015-2023 Takao Fujiwara ++ * Copyright (C) 2015-2024 Takao Fujiwara + * Copyright (C) 2008-2018 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or +diff --git a/src/tests/ibus-bus.c b/src/tests/ibus-bus.c +index d6b105cf..76120354 100644 +--- a/src/tests/ibus-bus.c ++++ b/src/tests/ibus-bus.c +@@ -802,20 +802,29 @@ start_set_preload_engines_async (void) + NULL); /* user_data */ + } + ++typedef struct _ExitAsyncData { ++ gboolean has_socket_path; ++ gboolean exited; ++ guint timeout_id; ++} ExitAsyncData; ++ + static void + _socket_changed_cb (GFileMonitor *monitor, + GFile *file, + GFile *other_file, + GFileMonitorEvent event_type, +- IBusBus *bus) ++ ExitAsyncData *data) + { + switch (event_type) { + case G_FILE_MONITOR_EVENT_CHANGED: + g_debug ("IBus socket file is changed"); + call_next_async_function (); ++ data->exited = TRUE; + g_signal_handlers_disconnect_by_func (monitor, + G_CALLBACK (_socket_changed_cb), +- NULL); ++ data); ++ if (data->timeout_id) ++ g_source_remove (data->timeout_id); + g_object_unref (monitor); + break; + case G_FILE_MONITOR_EVENT_CREATED: +@@ -829,6 +838,33 @@ _socket_changed_cb (GFileMonitor *monitor, + } + } + ++static gboolean ++_exit_timeout (gpointer user_data) ++{ ++ g_error ("start_exit_async() is timeout. You might run ibus-daemon " \ ++ "with systemd under GNOME and the exit API does not work. " \ ++ "You need to export IBUS_DAEMON_WITH_SYSTEMD=1 .\n"); ++ return G_SOURCE_REMOVE; ++} ++ ++static void ++finish_ibus_restart_async (GPid pid, ++ gint status, ++ gpointer *user_data) ++{ ++ ExitAsyncData *data = (ExitAsyncData *)user_data; ++ g_spawn_close_pid (pid); ++ if (data->has_socket_path == FALSE) { ++ g_debug ("ibus_bus_exit_finish: OK socket file: none"); ++ g_usleep (G_USEC_PER_SEC); ++ call_next_async_function (); ++ } else { ++ g_debug ("ibus_bus_exit_finish: OK socket file: monitored"); ++ if (!data->exited) ++ data->timeout_id = g_timeout_add_seconds (10, _exit_timeout, NULL); ++ } ++} ++ + static void + finish_exit_async (GObject *source_object, + GAsyncResult *res, +@@ -838,25 +874,32 @@ finish_exit_async (GObject *source_object, + gboolean result = ibus_bus_exit_async_finish (bus, + res, + &error); +- gboolean has_socket_path = GPOINTER_TO_INT (user_data); ++ ExitAsyncData *data = (ExitAsyncData *)user_data; + if (error) { + g_warning ("Failed to ibus_bus_exit(): %s", error->message); + g_error_free (error); + } + g_assert (result); +- if (has_socket_path == FALSE) { ++ g_assert (data); ++ if (data->has_socket_path == FALSE) { + g_debug ("ibus_bus_exit_finish: OK socket file: none"); + g_usleep (G_USEC_PER_SEC); + call_next_async_function (); + } else { + g_debug ("ibus_bus_exit_finish: OK socket file: monitored"); ++ if (!data->exited) ++ data->timeout_id = g_timeout_add_seconds (10, _exit_timeout, NULL); + } + } + + static void + start_exit_async (void) + { +- gboolean has_socket_path = FALSE; ++ static ExitAsyncData data = { ++ .has_socket_path = FALSE, ++ .exited = FALSE, ++ .timeout_id = 0 ++ }; + /* When `./runtest ibus-bus` runs, ibus-daemon sometimes failed to + * restart because closing a file descriptor was failed in + * bus/server.c:_restart_server() with a following error: +@@ -879,7 +922,7 @@ start_exit_async (void) + g_assert (address_path); + file = g_file_new_for_path (address_path); + g_assert (file); +- has_socket_path = TRUE; ++ data.has_socket_path = TRUE; + monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, &error); + if (error) { + g_warning ("Failed to monitor socket file: %s", error->message); +@@ -887,15 +930,38 @@ start_exit_async (void) + } + g_assert (monitor); + g_signal_connect (monitor, "changed", +- G_CALLBACK (_socket_changed_cb), NULL); ++ G_CALLBACK (_socket_changed_cb), ++ &data); + g_object_unref (file); + } +- ibus_bus_exit_async (bus, +- TRUE, /* restart */ +- -1, /* timeout */ +- NULL, /* cancellable */ +- finish_exit_async, +- GINT_TO_POINTER (has_socket_path)); /* user_data */ ++ /* When ibus-daemon runs with systemd, restarting the daemon with ++ * ibus_bus_exit_async() does not work so runs `ibus restart` command ++ * with IBUS_DAEMON_WITH_SYSTEMD variable instead. ++ */ ++ if (g_getenv ("IBUS_DAEMON_WITH_SYSTEMD")) { ++ gchar *argv[] = { "ibus", "restart", NULL }; ++ GSpawnFlags flags = G_SPAWN_DO_NOT_REAP_CHILD \ ++ | G_SPAWN_SEARCH_PATH \ ++ | G_SPAWN_STDOUT_TO_DEV_NULL \ ++ | G_SPAWN_STDERR_TO_DEV_NULL; ++ GPid pid = 0; ++ GError *error = NULL; ++ g_spawn_async (NULL, argv, NULL, flags, NULL, NULL, &pid, &error); ++ if (error) { ++ g_warning ("Failed to call ibus restart: %s", error->message); ++ g_error_free (error); ++ } ++ g_child_watch_add (pid, ++ (GChildWatchFunc)finish_ibus_restart_async, ++ &data); ++ } else { ++ ibus_bus_exit_async (bus, ++ TRUE, /* restart */ ++ -1, /* timeout */ ++ NULL, /* cancellable */ ++ finish_exit_async, ++ &data); /* user_data */ ++ } + } + + static gboolean +diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c +index 21de7a22..660aee7f 100644 +--- a/src/tests/ibus-compose.c ++++ b/src/tests/ibus-compose.c +@@ -7,19 +7,28 @@ + #define RED "\033[0;31m" + #define NC "\033[0m" + +-IBusBus *m_bus; +-gchar *m_compose_file; +-IBusComposeTableEx *m_compose_table; +-IBusEngine *m_engine; +-gchar *m_srcdir; +- +-guint ibus_compose_key_flag (guint key); +- ++static IBusBus *m_bus; ++static gchar *m_compose_file; ++static IBusComposeTableEx *m_compose_table; ++static IBusEngine *m_engine; ++static gchar *m_srcdir; ++static GMainLoop *m_loop; ++ ++typedef enum { ++ TEST_CREATE_ENGINE, ++ TEST_COMMIT_TEXT ++} TestIDleCategory; ++ ++typedef struct _TestIdleData { ++ TestIDleCategory category; ++ guint idle_id; ++} TestIdleData; ++ ++extern guint ibus_compose_key_flag (guint key); + static gboolean window_focus_in_event_cb (GtkWidget *entry, + GdkEventFocus *event, + gpointer data); + +- + static gchar * + get_compose_path () + { +@@ -51,17 +60,50 @@ get_compose_path () + } + + ++gboolean ++idle_cb (gpointer user_data) ++{ ++ TestIdleData *data = (TestIdleData *)user_data; ++ g_assert (data); ++ switch (data->category) { ++ case TEST_CREATE_ENGINE: ++ g_test_fail_printf ("\"create-engine\" signal is timeout."); ++ break; ++ case TEST_COMMIT_TEXT: ++ if (data->idle_id) ++ g_test_fail_printf ("Commiting composed chars is timeout."); ++ if (m_loop) { ++ if (g_main_loop_is_running (m_loop)) ++ g_main_loop_quit (m_loop); ++ g_clear_pointer (&m_loop, g_main_loop_unref); ++ gtk_main_quit (); ++ } ++ data->idle_id = 0; ++ break; ++ default: ++ g_test_fail_printf ("Idle func is called by wrong category:%d.", ++ data->category); ++ break; ++ } ++ return G_SOURCE_REMOVE; ++} ++ ++ + static IBusEngine * + create_engine_cb (IBusFactory *factory, + const gchar *name, +- gpointer data) ++ gpointer user_data) + { + static int i = 1; + gchar *engine_path = + g_strdup_printf ("/org/freedesktop/IBus/engine/simpletest/%d", + i++); + gchar *compose_path; ++ TestIdleData *data = (TestIdleData *)user_data; + ++ g_assert (data); ++ /* Don't reset idle_id to avoid duplicated register_ibus_engine(). */ ++ g_source_remove (data->idle_id); + m_engine = ibus_engine_new_with_type (IBUS_TYPE_ENGINE_SIMPLE, + name, + engine_path, +@@ -75,28 +117,33 @@ create_engine_cb (IBusFactory *factory, + ibus_engine_simple_add_compose_file (IBUS_ENGINE_SIMPLE (m_engine), + compose_path); + m_compose_table = ibus_compose_table_load_cache (compose_path); +- if (m_compose_table == NULL) +- g_warning ("Your locale uses en_US compose table."); + } + g_free (compose_path); + return m_engine; + } + ++ + static gboolean + register_ibus_engine () + { ++ static TestIdleData data = { .category = TEST_CREATE_ENGINE, .idle_id = 0 }; + IBusFactory *factory; + IBusComponent *component; + IBusEngineDesc *desc; + ++ if (data.idle_id) { ++ g_test_incomplete ("Test is called twice due to a timeout."); ++ return TRUE; ++ } + m_bus = ibus_bus_new (); + if (!ibus_bus_is_connected (m_bus)) { +- g_critical ("ibus-daemon is not running."); ++ g_test_fail_printf ("ibus-daemon is not running."); + return FALSE; + } + factory = ibus_factory_new (ibus_bus_get_connection (m_bus)); ++ data.idle_id = g_timeout_add_seconds (20, idle_cb, &data); + g_signal_connect (factory, "create-engine", +- G_CALLBACK (create_engine_cb), NULL); ++ G_CALLBACK (create_engine_cb), &data); + + component = ibus_component_new ( + "org.freedesktop.IBus.SimpleTest", +@@ -122,34 +169,29 @@ register_ibus_engine () + return TRUE; + } + +-static gboolean +-finit (gpointer data) +-{ +- g_test_incomplete ("time out"); +- gtk_main_quit (); +- return FALSE; +-} + + static void +-set_engine_cb (GObject *object, GAsyncResult *res, gpointer data) ++set_engine_cb (GObject *object, ++ GAsyncResult *res, ++ gpointer user_data) + { + IBusBus *bus = IBUS_BUS (object); +- GtkWidget *entry = GTK_WIDGET (data); ++ GtkWidget *entry = GTK_WIDGET (user_data); + GError *error = NULL; ++ static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 }; + int i, j; + int index_stride; + IBusComposeTablePrivate *priv; + + if (!ibus_bus_set_global_engine_async_finish (bus, res, &error)) { +- gchar *msg = g_strdup_printf ("set engine failed: %s", error->message); +- g_test_incomplete (msg); +- g_free (msg); ++ g_test_fail_printf ("set engine failed: %s", error->message); + g_error_free (error); + return; + } + + if (m_compose_table == NULL) { +- gtk_main_quit (); ++ g_test_skip ("Your locale uses en_US compose table."); ++ idle_cb (&data); + return; + } + +@@ -157,6 +199,7 @@ set_engine_cb (GObject *object, GAsyncResult *res, gpointer data) + for (i = 0; + i < (m_compose_table->n_seqs * index_stride); + i += index_stride) { ++ data.idle_id = g_timeout_add_seconds (20, idle_cb, &data); + for (j = i; j < i + (index_stride - 2); j++) { + guint keyval = m_compose_table->data[j]; + guint keycode = 0; +@@ -172,12 +215,22 @@ set_engine_cb (GObject *object, GAsyncResult *res, gpointer data) + g_signal_emit_by_name (m_engine, "process-key-event", + keyval, keycode, modifiers, &retval); + } ++ /* Need to wait for calling window_inserted_text_cb() with ++ * g_main_loop_run() because the commit-text event could be cancelled ++ * by the next commit-text event with gnome-shell in Wayland. ++ */ ++ g_main_loop_run (m_loop); ++ if (data.idle_id) { ++ g_source_remove (data.idle_id); ++ data.idle_id = 0; ++ } + } + priv = m_compose_table->priv; + if (priv) { + for (i = 0; + i < (priv->first_n_seqs * index_stride); + i += index_stride) { ++ data.idle_id = g_timeout_add_seconds (20, idle_cb, &data); + for (j = i; j < i + (index_stride - 2); j++) { + guint keyval = priv->data_first[j]; + guint keycode = 0; +@@ -193,13 +246,18 @@ set_engine_cb (GObject *object, GAsyncResult *res, gpointer data) + g_signal_emit_by_name (m_engine, "process-key-event", + keyval, keycode, modifiers, &retval); + } ++ g_main_loop_run (m_loop); ++ if (data.idle_id) { ++ g_source_remove (data.idle_id); ++ data.idle_id = 0; ++ } + } + } + + g_signal_handlers_disconnect_by_func (entry, + G_CALLBACK (window_focus_in_event_cb), + NULL); +- g_timeout_add_seconds (10, finit, NULL); ++ data.idle_id = g_timeout_add_seconds (10, idle_cb, &data); + } + + static gboolean +@@ -215,12 +273,13 @@ window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data) + return FALSE; + } + ++ + static void + window_inserted_text_cb (GtkEntryBuffer *buffer, + guint position, + const gchar *chars, + guint nchars, +- gpointer data) ++ gpointer user_data) + { + /* https://gitlab.gnome.org/GNOME/gtk/commit/9981f46e0b + * The latest GTK does not emit "inserted-text" when the text is "". +@@ -234,8 +293,9 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + int seq; + gunichar code = g_utf8_get_char (chars); + const gchar *test; +- GtkEntry *entry = GTK_ENTRY (data); ++ GtkEntry *entry = GTK_ENTRY (user_data); + IBusComposeTablePrivate *priv; ++ static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 }; + + g_assert (m_compose_table != NULL); + +@@ -302,21 +362,26 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + stride = 0; + seq = 0; + } else { +- gtk_main_quit (); ++ /* Finish tests */ ++ idle_cb (&data); + return; + } + } + if (enable_32bit && seq == priv->first_n_seqs) { +- gtk_main_quit (); ++ /* Finish tests */ ++ idle_cb (&data); + return; + } + + #if !GTK_CHECK_VERSION (3, 22, 16) + n_loop++; + #endif ++ + gtk_entry_set_text (entry, ""); ++ g_main_loop_quit (m_loop); + } + ++ + static void + create_window () + { +@@ -335,14 +400,13 @@ create_window () + gtk_widget_show_all (window); + } + ++ + static void + test_compose (void) + { + GLogLevelFlags flags; +- if (!register_ibus_engine ()) { +- g_test_fail (); ++ if (!register_ibus_engine ()) + return; +- } + + create_window (); + /* FIXME: +@@ -357,6 +421,7 @@ test_compose (void) + g_log_set_always_fatal (flags); + } + ++ + int + main (int argc, char *argv[]) + { +@@ -380,10 +445,12 @@ main (int argc, char *argv[]) + #else + test_name = g_strdup (g_getenv ("LANG")); + #endif +- if (!test_name || !g_ascii_strncasecmp (test_name, "en_US", 5)) { ++ if (m_compose_file && ++ (!test_name || !g_ascii_strncasecmp (test_name, "en_US", 5))) { + g_free (test_name); + test_name = g_path_get_basename (m_compose_file); + } ++ m_loop = g_main_loop_new (NULL, TRUE); + test_path = g_build_filename ("/ibus-compose", test_name, NULL); + g_test_add_func (test_path, test_compose); + g_free (test_path); +diff --git a/src/tests/ibus-engine-switch.c b/src/tests/ibus-engine-switch.c +index a1eeba2a..b50bac59 100644 +--- a/src/tests/ibus-engine-switch.c ++++ b/src/tests/ibus-engine-switch.c +@@ -1,6 +1,7 @@ + /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ + + #include ++#include + #include "ibus.h" + + static IBusBus *bus; +@@ -47,6 +48,7 @@ change_context_engine (IBusInputContext *context) + g_assert_cmpstr (ibus_engine_desc_get_name (engine_desc), + ==, + engine_names[i]); ++ g_object_unref (engine_desc); + } + } + +@@ -61,7 +63,7 @@ static void + global_engine_changed_cb (IBusBus *bus, gchar *name, gpointer user_data) + { + GlobalEngineChangedData *data = (GlobalEngineChangedData *) user_data; +- if (data->count++ == 0) ++ if (data->count++ == 1) + ibus_quit (); + } + +@@ -84,6 +86,35 @@ change_global_engine_cb (gpointer user_data) + return FALSE; + } + ++gboolean ++_wait_for_key_release_cb (gpointer user_data) ++{ ++ GMainLoop *loop = (GMainLoop *)user_data; ++ /* If this program is invoked by manual with Enter key in GNOME ++ * Wayland session, ibus_input_context_focus_in() can be called in ++ * test_context_engine_set_by_global() before the key release of ++ * the Enter key so ibus/bus/inputcontext.c:_ic_process_key_event() ++ * could call another bus_input_context_focus_in() in that test case ++ * and fail. ++ */ ++ g_test_message ("Wait for 3 seconds for key release event"); ++ g_main_loop_quit (loop); ++ return G_SOURCE_REMOVE; ++} ++ ++static void ++test_init (void) ++{ ++ char *tty_name = ttyname (STDIN_FILENO); ++ GMainLoop *loop = g_main_loop_new (NULL, TRUE); ++ g_test_message ("Test on %s", tty_name ? tty_name : "(null)"); ++ if (tty_name && g_strstr_len (tty_name, -1, "pts")) { ++ g_timeout_add_seconds (3, _wait_for_key_release_cb, loop); ++ g_main_loop_run (loop); ++ } ++ g_main_loop_unref (loop); ++} ++ + static void + test_global_engine (void) + { +@@ -105,6 +136,10 @@ test_global_engine (void) + } else { + data.reverse = FALSE; + } ++ g_test_message ("Initial engine name: %s", ++ desc ? ibus_engine_desc_get_name (desc) : "(null)"); ++ if (desc) ++ g_object_unref (desc); + + data.count = 0; + +@@ -112,7 +147,7 @@ test_global_engine (void) + "global-engine-changed", + G_CALLBACK (global_engine_changed_cb), + &data); +- data.timeout_id = g_timeout_add_seconds (1, timeout_cb, &data); ++ data.timeout_id = g_timeout_add_seconds (3, timeout_cb, &data); + data.idle_id = g_idle_add ((GSourceFunc) change_global_engine_cb, &data); + + ibus_main (); +@@ -144,6 +179,7 @@ test_context_engine (void) + change_context_engine (context); + engine_desc = ibus_input_context_get_engine (context); + g_assert_cmpstr (ibus_engine_desc_get_name (engine_desc), ==, AFTER_ENGINE); ++ g_object_unref (engine_desc); + + g_object_unref (context); + } +@@ -171,6 +207,7 @@ test_context_engine_set_by_global (void) + + engine_desc = ibus_input_context_get_engine (context); + g_assert_cmpstr (ibus_engine_desc_get_name (engine_desc), ==, AFTER_ENGINE); ++ g_object_unref (engine_desc); + + g_object_unref (context); + } +@@ -199,9 +236,11 @@ test_context_engine_set_by_focus (void) + + engine_desc = ibus_input_context_get_engine (context); + g_assert_cmpstr (ibus_engine_desc_get_name (engine_desc), ==, "dummy"); ++ g_object_unref (engine_desc); + + engine_desc = ibus_input_context_get_engine (another_context); + g_assert_cmpstr (ibus_engine_desc_get_name (engine_desc), ==, AFTER_ENGINE); ++ g_object_unref (engine_desc); + + g_object_unref (context); + g_object_unref (another_context); +@@ -220,6 +259,8 @@ main (gint argc, + + ibus_bus_set_watch_ibus_signal (bus, TRUE); + ++ g_test_add_func ("/ibus/engine-switch/test-init", ++ test_init); + g_test_add_func ("/ibus/engine-switch/global-engine", + test_global_engine); + g_test_add_func ("/ibus/engine-switch/context-engine", +diff --git a/src/tests/xkb-latin-layouts b/src/tests/xkb-latin-layouts +index 92464234..45c99358 100755 +--- a/src/tests/xkb-latin-layouts ++++ b/src/tests/xkb-latin-layouts +@@ -120,6 +120,15 @@ EOF_READ_XKB + + main() + { ++ if [ x"$DISPLAY" = x ] ; then ++ echo "skip: No display. Maybe headless mode." ++ exit 77 ++ fi ++ if ! which setxkbmap > /dev/null ; then ++ echo "skip: No setxkbmap" ++ exit 77 ++ fi ++ + parse_args "$@" + + if [ x"$INSTALLED_SCHEMAS_DIR" != x ] ; then +-- +2.45.0 + +From 44f9a5957e4c53b4a6e6b3f42b56f2d20d58a21c Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Sat, 27 Jul 2024 19:04:39 +0900 +Subject: [PATCH 3/6] src/tests: Enable GTK4 + +Seems GTK3 does not work in GNOME Wayland headless session to get +GdkMonitor in gtk_init() and trying to migrate the test cases to +GTK4. +Calling ibus_init() twice with g_static_resource_init() causes a +memory error and fix it. + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + src/tests/Makefile.am | 8 +-- + src/tests/ibus-compose.c | 147 ++++++++++++++++++++++++++++++++------ + src/tests/ibus-keypress.c | 146 ++++++++++++++++++++++++++++++------- + 3 files changed, 251 insertions(+), 50 deletions(-) + +diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am +index 6c4c86cf..10acd0a7 100644 +--- a/src/tests/Makefile.am ++++ b/src/tests/Makefile.am +@@ -182,8 +182,8 @@ ibus_bus_SOURCES = ibus-bus.c + ibus_bus_LDADD = $(prog_ldadd) + + ibus_compose_SOURCES = ibus-compose.c +-ibus_compose_CFLAGS = @GTK3_CFLAGS@ +-ibus_compose_LDADD = $(prog_ldadd) @GTK3_LIBS@ ++ibus_compose_CFLAGS = @GTK4_CFLAGS@ ++ibus_compose_LDADD = $(prog_ldadd) @GTK4_LIBS@ + + ibus_config_SOURCES = ibus-config.c + ibus_config_LDADD = $(prog_ldadd) +@@ -207,8 +207,8 @@ ibus_keynames_SOURCES = ibus-keynames.c + ibus_keynames_LDADD = $(prog_ldadd) + + ibus_keypress_SOURCES = ibus-keypress.c +-ibus_keypress_CFLAGS = @GTK3_CFLAGS@ @XTEST_CFLAGS@ +-ibus_keypress_LDADD = $(prog_ldadd) @GTK3_LIBS@ @XTEST_LIBS@ ++ibus_keypress_CFLAGS = @GTK4_CFLAGS@ @XTEST_CFLAGS@ ++ibus_keypress_LDADD = $(prog_ldadd) @GTK4_LIBS@ @XTEST_LIBS@ + + ibus_registry_SOURCES = ibus-registry.c + ibus_registry_LDADD = $(prog_ldadd) +diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c +index 660aee7f..57851b0a 100644 +--- a/src/tests/ibus-compose.c ++++ b/src/tests/ibus-compose.c +@@ -13,6 +13,9 @@ static IBusComposeTableEx *m_compose_table; + static IBusEngine *m_engine; + static gchar *m_srcdir; + static GMainLoop *m_loop; ++#if GTK_CHECK_VERSION (4, 0, 0) ++static gboolean m_list_toplevel; ++#endif + + typedef enum { + TEST_CREATE_ENGINE, +@@ -25,9 +28,16 @@ typedef struct _TestIdleData { + } TestIdleData; + + extern guint ibus_compose_key_flag (guint key); ++ ++#if GTK_CHECK_VERSION (4, 0, 0) ++static void event_controller_enter_cb (GtkEventController *controller, ++ gpointer user_data); ++#else + static gboolean window_focus_in_event_cb (GtkWidget *entry, + GdkEventFocus *event, + gpointer data); ++#endif ++ + + static gchar * + get_compose_path () +@@ -76,7 +86,11 @@ idle_cb (gpointer user_data) + if (g_main_loop_is_running (m_loop)) + g_main_loop_quit (m_loop); + g_clear_pointer (&m_loop, g_main_loop_unref); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else + gtk_main_quit (); ++#endif + } + data->idle_id = 0; + break; +@@ -170,13 +184,28 @@ register_ibus_engine () + } + + ++static void ++window_destroy_cb (void) ++{ ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else ++ gtk_main_quit (); ++#endif ++} ++ ++ + static void + set_engine_cb (GObject *object, + GAsyncResult *res, + gpointer user_data) + { + IBusBus *bus = IBUS_BUS (object); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ GtkEventController *controller = GTK_EVENT_CONTROLLER (user_data); ++#else + GtkWidget *entry = GTK_WIDGET (user_data); ++#endif + GError *error = NULL; + static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 }; + int i, j; +@@ -254,24 +283,55 @@ set_engine_cb (GObject *object, + } + } + ++#if GTK_CHECK_VERSION (4, 0, 0) ++ g_signal_handlers_disconnect_by_func ( ++ controller, ++ G_CALLBACK (event_controller_enter_cb), ++ NULL); ++#else + g_signal_handlers_disconnect_by_func (entry, + G_CALLBACK (window_focus_in_event_cb), + NULL); ++#endif + data.idle_id = g_timeout_add_seconds (10, idle_cb, &data); + } + +-static gboolean +-window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data) ++ ++static void ++set_engine (gpointer user_data) + { ++ g_test_message ("set_engine() is calling"); + g_assert (m_bus != NULL); + ibus_bus_set_global_engine_async (m_bus, + "xkbtest:us::eng", + -1, + NULL, + set_engine_cb, +- entry); ++ user_data); ++} ++ ++ ++#if GTK_CHECK_VERSION (4, 0, 0) ++static void ++event_controller_enter_cb (GtkEventController *controller, ++ gpointer user_data) ++{ ++ g_test_message ("EventController emits \"enter\" signal"); ++ set_engine (controller); ++} ++ ++#else ++ ++static gboolean ++window_focus_in_event_cb (GtkWidget *entry, ++ GdkEventFocus *event, ++ gpointer data) ++{ ++ g_test_message ("Entry emits \"focus-in-event\" signal"); ++ set_engine (entry); + return FALSE; + } ++#endif + + + static void +@@ -293,7 +353,9 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + int seq; + gunichar code = g_utf8_get_char (chars); + const gchar *test; ++#if ! GTK_CHECK_VERSION (4, 0, 0) + GtkEntry *entry = GTK_ENTRY (user_data); ++#endif + IBusComposeTablePrivate *priv; + static TestIdleData data = { .category = TEST_COMMIT_TEXT, .idle_id = 0 }; + +@@ -306,6 +368,10 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + n_loop = 0; + return; + } ++#endif ++#if GTK_CHECK_VERSION (4, 0, 0) ++ if (code == 0) ++ return; + #endif + i = stride + (m_compose_table->max_seq_len + 2) - 2; + seq = (i + 2) / (m_compose_table->max_seq_len + 2); +@@ -318,12 +384,12 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + test = RED "FAIL" NC; + g_test_fail (); + } +- g_print ("%05d/%05d %s expected: %04X typed: %04X\n", +- seq, +- m_compose_table->n_seqs, +- test, +- m_compose_table->data[i], +- code); ++ g_test_message ("%05d/%05d %s expected: %04X typed: %04X", ++ seq, ++ m_compose_table->n_seqs, ++ test, ++ m_compose_table->data[i], ++ code); + } else { + const gchar *p = chars; + guint num = priv->data_first[i]; +@@ -344,14 +410,14 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + test = RED "FAIL" NC; + g_test_fail (); + } +- g_print ("%05d/%05ld %s expected: %04X[%d] typed: %04X\n", +- seq, +- priv->first_n_seqs, +- test, +- valid_output ? priv->data_second[index] +- : priv->data_second[index + j], +- valid_output ? index + num : index + j, +- valid_output ? g_utf8_get_char (chars) : code); ++ g_test_message ("%05d/%05ld %s expected: %04X[%d] typed: %04X", ++ seq, ++ priv->first_n_seqs, ++ test, ++ valid_output ? priv->data_second[index] ++ : priv->data_second[index + j], ++ valid_output ? index + num : index + j, ++ valid_output ? g_utf8_get_char (chars) : code); + } + + stride += m_compose_table->max_seq_len + 2; +@@ -377,7 +443,11 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + n_loop++; + #endif + ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_entry_buffer_set_text (buffer, "", 0); ++#else + gtk_entry_set_text (entry, ""); ++#endif + g_main_loop_quit (m_loop); + } + +@@ -385,19 +455,43 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + static void + create_window () + { +- GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); +- GtkWidget *entry = gtk_entry_new (); ++ GtkWidget *window; ++ GtkWidget *entry; + GtkEntryBuffer *buffer; ++#if GTK_CHECK_VERSION (4, 0, 0) ++ GtkEventController *controller; ++ GtkEditable *text; ++ ++ window = gtk_window_new (); ++#else ++ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++#endif ++ entry = gtk_entry_new (); + + g_signal_connect (window, "destroy", +- G_CALLBACK (gtk_main_quit), NULL); ++ G_CALLBACK (window_destroy_cb), NULL); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ controller = gtk_event_controller_focus_new (); ++ text = gtk_editable_get_delegate (GTK_EDITABLE (entry)); ++ g_signal_connect (controller, "enter", ++ G_CALLBACK (event_controller_enter_cb), NULL); ++ gtk_widget_add_controller (GTK_WIDGET (text), controller); ++#else + g_signal_connect (entry, "focus-in-event", + G_CALLBACK (window_focus_in_event_cb), NULL); ++#endif + buffer = gtk_entry_get_buffer (GTK_ENTRY (entry)); + g_signal_connect (buffer, "inserted-text", + G_CALLBACK (window_inserted_text_cb), entry); ++ ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_window_set_child (GTK_WINDOW (window), entry); ++ gtk_window_set_focus (GTK_WINDOW (window), entry); ++ gtk_window_present (GTK_WINDOW (window)); ++#else + gtk_container_add (GTK_CONTAINER (window), entry); + gtk_widget_show_all (window); ++#endif + } + + +@@ -408,6 +502,9 @@ test_compose (void) + if (!register_ibus_engine ()) + return; + ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = TRUE; ++#endif + create_window (); + /* FIXME: + * IBusIMContext opens GtkIMContextSimple as the slave and +@@ -417,7 +514,13 @@ test_compose (void) + " "GTK+ supports to output one char only: " + */ + flags = g_log_set_always_fatal (G_LOG_LEVEL_CRITICAL); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_window_list_toplevels (); ++ while (m_list_toplevel) ++ g_main_context_iteration (NULL, TRUE); ++#else + gtk_main (); ++#endif + g_log_set_always_fatal (flags); + } + +@@ -435,7 +538,11 @@ main (int argc, char *argv[]) + if (!g_setenv ("NO_AT_BRIDGE", "1", TRUE)) + g_message ("Failed setenv NO_AT_BRIDGE\n"); + g_test_init (&argc, &argv, NULL); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_init (); ++#else + gtk_init (&argc, &argv); ++#endif + + m_srcdir = (argc > 1 && strlen (argv[1]) < FILENAME_MAX) + ? g_strdup (argv[1]) : g_strdup ("."); +diff --git a/src/tests/ibus-keypress.c b/src/tests/ibus-keypress.c +index d44f39b2..a9288260 100644 +--- a/src/tests/ibus-keypress.c ++++ b/src/tests/ibus-keypress.c +@@ -1,12 +1,16 @@ + #include ++#if GTK_CHECK_VERSION (4, 0, 0) ++#include ++#else + #include ++#endif + #include "ibus.h" + #include + #include + #include + + #ifdef GDK_WINDOWING_WAYLAND +-#if GTK_CHECK_VERSION (3, 98, 4) ++#if GTK_CHECK_VERSION (4, 0, 0) + #include + #else + #include +@@ -51,12 +55,18 @@ static const gunichar test_results[][60] = { + }; + + +-IBusBus *m_bus; +-IBusEngine *m_engine; ++static IBusBus *m_bus; ++static IBusEngine *m_engine; ++#if GTK_CHECK_VERSION (4, 0, 0) ++static gboolean m_list_toplevel; + ++static gboolean event_controller_enter_cb (GtkEventController *controller, ++ gpointer user_data); ++#else + static gboolean window_focus_in_event_cb (GtkWidget *entry, + GdkEventFocus *event, + gpointer data); ++#endif + + static IBusEngine * + create_engine_cb (IBusFactory *factory, const gchar *name, gpointer data) +@@ -118,7 +128,11 @@ static gboolean + finit (gpointer data) + { + g_critical ("time out"); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else + gtk_main_quit (); ++#endif + return FALSE; + } + +@@ -173,27 +187,41 @@ send_key_event (Display *xdisplay, + } + } + ++static void ++window_destroy_cb (void) ++{ ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else ++ gtk_main_quit (); ++#endif ++} ++ + static void + set_engine_cb (GObject *object, + GAsyncResult *res, +- gpointer data) ++ gpointer user_data) + { + IBusBus *bus = IBUS_BUS (object); +- GtkWidget *entry = GTK_WIDGET (data); ++#if ! GTK_CHECK_VERSION (4, 0, 0) ++ GtkWidget *entry = GTK_WIDGET (user_data); ++#endif + GdkDisplay *display; + Display *xdisplay = NULL; + GError *error = NULL; + int i, j; + +- g_assert (GTK_IS_ENTRY (entry)); +- + if (!ibus_bus_set_global_engine_async_finish (bus, res, &error)) { + g_critical ("set engine failed: %s", error->message); + g_error_free (error); + return; + } + ++#if GTK_CHECK_VERSION (4, 0, 0) ++ display = gdk_display_get_default (); ++#else + display = gtk_widget_get_display (entry); ++#endif + g_assert (GDK_IS_X11_DISPLAY (display)); + xdisplay = gdk_x11_display_get_xdisplay (display); + g_return_if_fail (xdisplay); +@@ -210,8 +238,8 @@ set_engine_cb (GObject *object, + g_timeout_add_seconds (10, finit, NULL); + } + +-static gboolean +-window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data) ++static void ++set_engine (gpointer user_data) + { + g_assert (m_bus != NULL); + ibus_bus_set_global_engine_async (m_bus, +@@ -219,18 +247,40 @@ window_focus_in_event_cb (GtkWidget *entry, GdkEventFocus *event, gpointer data) + -1, + NULL, + set_engine_cb, +- entry); ++ user_data); ++} ++ ++#if GTK_CHECK_VERSION (4, 0, 0) ++static gboolean ++event_controller_enter_cb (GtkEventController *controller, ++ gpointer user_data) ++{ ++ set_engine (controller); ++ return FALSE; ++} ++ ++#else ++ ++static gboolean ++window_focus_in_event_cb (GtkWidget *entry, ++ GdkEventFocus *event, ++ gpointer user_data) ++{ ++ set_engine (entry); + return FALSE; + } ++#endif + + static void + window_inserted_text_cb (GtkEntryBuffer *buffer, + guint position, + const gchar *chars, + guint nchars, +- gpointer data) ++ gpointer user_data) + { +- GtkWidget *entry = data; ++#if ! GTK_CHECK_VERSION (4, 0, 0) ++ GtkWidget *entry = user_data; ++#endif + static int i = 0; + static int j = 0; + +@@ -242,10 +292,19 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + g_print ("\n"); + i++; + j = 0; +- if (test_results[i][0] == 0) ++ if (test_results[i][0] == 0) { ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else + gtk_main_quit (); +- else ++#endif ++ } else { ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_entry_buffer_set_text (buffer, "", 1); ++#else + gtk_entry_set_text (GTK_ENTRY (entry), ""); ++#endif ++ } + return; + } + g_assert (g_utf8_get_char (chars) == test_results[i][j]); +@@ -255,19 +314,39 @@ window_inserted_text_cb (GtkEntryBuffer *buffer, + static void + create_window () + { +- GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++ GtkWidget *window; + GtkWidget *entry = gtk_entry_new (); + GtkEntryBuffer *buffer; ++#if GTK_CHECK_VERSION (4, 0, 0) ++ GtkEventController *controller; ++ ++ window = gtk_window_new (); ++#else ++ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++#endif + + g_signal_connect (window, "destroy", +- G_CALLBACK (gtk_main_quit), NULL); ++ G_CALLBACK (window_destroy_cb), NULL); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ controller = gtk_event_controller_focus_new (); ++ g_signal_connect (controller, "enter", ++ G_CALLBACK (event_controller_enter_cb), NULL); ++ gtk_widget_add_controller (window, controller); ++#else + g_signal_connect (entry, "focus-in-event", + G_CALLBACK (window_focus_in_event_cb), NULL); ++#endif + buffer = gtk_entry_get_buffer (GTK_ENTRY (entry)); + g_signal_connect (buffer, "inserted-text", + G_CALLBACK (window_inserted_text_cb), entry); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_window_set_child (GTK_WINDOW (window), entry); ++ gtk_window_set_focus (GTK_WINDOW (window), entry); ++ gtk_window_present (GTK_WINDOW (window)); ++#else + gtk_container_add (GTK_CONTAINER (window), entry); + gtk_widget_show_all (window); ++#endif + } + + static void +@@ -277,6 +356,16 @@ test_keypress (void) + int status = 0; + GError *error = NULL; + ++#ifdef GDK_WINDOWING_WAYLAND ++ { ++ GdkDisplay *display = gdk_display_get_default (); ++ if (GDK_IS_WAYLAND_DISPLAY (display)) { ++ g_test_skip_printf ("setxkbmap and XTEST do not work in Wayland."); ++ return; ++ } ++ } ++#endif ++ + /* localectl does not change the session keymap. */ + path = g_find_program_in_path ("setxkbmap"); + if (path) { +@@ -287,33 +376,38 @@ test_keypress (void) + g_free (path); + g_assert (register_ibus_engine ()); + ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = TRUE; ++#endif + create_window (); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ while (m_list_toplevel) ++ g_main_context_iteration (NULL, TRUE); ++#else + gtk_main (); ++#endif + } + + int + main (int argc, char *argv[]) + { +- ibus_init (); ++ /* ibus_init() should not be called here because ++ * ibus_init() is called from IBus Gtk4 IM module even if ++ * GTK_IM_MODULE=wayland is exported. ++ */ + /* Avoid a warning of "AT-SPI: Could not obtain desktop path or name" + * with gtk_main(). + */ + if (!g_setenv ("NO_AT_BRIDGE", "1", TRUE)) + g_message ("Failed setenv NO_AT_BRIDGE\n"); + g_test_init (&argc, &argv, NULL); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ gtk_init (); ++#else + gtk_init (&argc, &argv); +-#ifdef GDK_WINDOWING_WAYLAND +- { +- GdkDisplay *display = gdk_display_get_default (); +- if (GDK_IS_WAYLAND_DISPLAY (display)) { +- g_print ("setxkbmap and XTEST do not work in Wayland.\n"); +- return 0; +- } +- } + #endif + + g_test_add_func ("/ibus/keyrepss", test_keypress); + +- + return g_test_run (); + } +-- +2.45.0 + +From a2689c4d66d1f5ae73d2ddbbb94374c98914a029 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Sat, 27 Jul 2024 19:07:58 +0900 +Subject: [PATCH 4/6] src/tests: Fix test cases in GNOME Xorg in ibus-compose + +"focus-in" signal is sent to IBus GtkIMModule with a delay in GNOME +desktop session and the signal order is not fixed with GTK_PHASE_TARGET +also "focus-in" signal is also sent with GtkText "realize"' signal. +Now the test cases wait for GtkText 'realize' signal. +This fixes the test cases in GNOME Xorg but there are still sone issues +in GNOME Wayland. + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + src/tests/ibus-compose.c | 71 ++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 68 insertions(+), 3 deletions(-) + +diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c +index 57851b0a..e9f102a1 100644 +--- a/src/tests/ibus-compose.c ++++ b/src/tests/ibus-compose.c +@@ -39,6 +39,23 @@ static gboolean window_focus_in_event_cb (GtkWidget *entry, + #endif + + ++gboolean ++_wait_for_key_release_cb (gpointer user_data) ++{ ++ GMainLoop *loop = (GMainLoop *)user_data; ++ /* If this program is invoked by manual with Enter key in GNOME ++ * Wayland session, ibus_input_context_focus_in() can be called in ++ * test_context_engine_set_by_global() before the key release of ++ * the Enter key so ibus/bus/inputcontext.c:_ic_process_key_event() ++ * could call another bus_input_context_focus_in() in that test case ++ * and fail. ++ */ ++ g_test_message ("Wait for 3 seconds for key release event"); ++ g_main_loop_quit (loop); ++ return G_SOURCE_REMOVE; ++} ++ ++ + static gchar * + get_compose_path () + { +@@ -312,12 +329,45 @@ set_engine (gpointer user_data) + + + #if GTK_CHECK_VERSION (4, 0, 0) ++static gboolean ++event_controller_enter_delay (gpointer user_data) ++{ ++ GtkEventController *controller = (GtkEventController *)user_data; ++ GtkWidget *text = gtk_event_controller_get_widget (controller); ++ static int i = 0; ++ ++ /* Wait for gtk_text_realize() which calls gtk_text_im_set_focus_in() ++ * while gtk_text_focus_changed() also calls gtk_text_im_set_focus_in() ++ * in GNOME Xorg. ++ */ ++ if (gtk_widget_get_realized (text)) { ++ set_engine (user_data); ++ return G_SOURCE_REMOVE; ++ } ++ if (i++ == 10) { ++ g_test_fail_printf ("Window is not realized with %d times", i); ++ return G_SOURCE_REMOVE; ++ } ++ g_test_message ("event_controller_enter_delay %d", i); ++ return G_SOURCE_CONTINUE; ++} ++ ++ + static void + event_controller_enter_cb (GtkEventController *controller, + gpointer user_data) + { ++ static guint id = 0; ++ + g_test_message ("EventController emits \"enter\" signal"); +- set_engine (controller); ++ /* Call an idle function because gtk_widget_add_controller() ++ * calls g_list_prepend() for event_controllers and this controller is ++ * always called before "gtk-text-focus-controller" ++ * is caleld and the IM context does not receive the focus-in yet. ++ */ ++ if (id) ++ return; ++ id = g_idle_add (event_controller_enter_delay, controller); + } + + #else +@@ -473,8 +523,9 @@ create_window () + #if GTK_CHECK_VERSION (4, 0, 0) + controller = gtk_event_controller_focus_new (); + text = gtk_editable_get_delegate (GTK_EDITABLE (entry)); +- g_signal_connect (controller, "enter", +- G_CALLBACK (event_controller_enter_cb), NULL); ++ gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_BUBBLE); ++ g_signal_connect_after (controller, "enter", ++ G_CALLBACK (event_controller_enter_cb), NULL); + gtk_widget_add_controller (GTK_WIDGET (text), controller); + #else + g_signal_connect (entry, "focus-in-event", +@@ -495,6 +546,19 @@ create_window () + } + + ++static void ++test_init (void) ++{ ++ char *tty_name = ttyname (STDIN_FILENO); ++ GMainLoop *loop = g_main_loop_new (NULL, TRUE); ++ g_test_message ("Test on %s", tty_name ? tty_name : "(null)"); ++ if (tty_name && g_strstr_len (tty_name, -1, "pts")) { ++ g_timeout_add_seconds (3, _wait_for_key_release_cb, loop); ++ g_main_loop_run (loop); ++ } ++ g_main_loop_unref (loop); ++} ++ + static void + test_compose (void) + { +@@ -557,6 +621,7 @@ main (int argc, char *argv[]) + g_free (test_name); + test_name = g_path_get_basename (m_compose_file); + } ++ g_test_add_func ("/ibus-compose/test-init", test_init); + m_loop = g_main_loop_new (NULL, TRUE); + test_path = g_build_filename ("/ibus-compose", test_name, NULL); + g_test_add_func (test_path, test_compose); +-- +2.45.0 + +From e65110a9bed03c981884e28ff44e2ac1f639df45 Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Sat, 27 Jul 2024 19:09:10 +0900 +Subject: [PATCH 5/6] src/tests: Fix ibus-compose for GNOME Wayland + +mutter calls meta_wayland_text_input_set_focus() after meta_window_show() +and the delayed focus-in/out events are sent to IBusEngine. +Now sleep() is added in ibus-compose because MetaWaylandInputMethod +cannot know the application status while GTK application is already +realized. + +Also GTK4 compose table supports 16bit compose keys only and it +causes a warning with pt-BR and fi-FI compose tables but the warning +is treated as a failure with g_test_init(). +Set LANG=en_US.UTF-8 for thw workaround to test pt-BR and fi-FI IBus +compose tables. + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + src/tests/ibus-compose.c | 223 ++++++++++++++++++++++++++++++++++----- + 1 file changed, 195 insertions(+), 28 deletions(-) + +diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c +index e9f102a1..0679c259 100644 +--- a/src/tests/ibus-compose.c ++++ b/src/tests/ibus-compose.c +@@ -7,19 +7,24 @@ + #define RED "\033[0;31m" + #define NC "\033[0m" + ++static gchar *m_test_name; ++static gchar *m_session_name; + static IBusBus *m_bus; + static gchar *m_compose_file; + static IBusComposeTableEx *m_compose_table; + static IBusEngine *m_engine; + static gchar *m_srcdir; ++static gboolean m_is_gtk_32bit_compose_error; + static GMainLoop *m_loop; ++static char *m_engine_is_focused; + #if GTK_CHECK_VERSION (4, 0, 0) + static gboolean m_list_toplevel; + #endif + + typedef enum { ++ TEST_COMMIT_TEXT, + TEST_CREATE_ENGINE, +- TEST_COMMIT_TEXT ++ TEST_DELAYED_FOCUS_IN + } TestIDleCategory; + + typedef struct _TestIdleData { +@@ -39,6 +44,19 @@ static gboolean window_focus_in_event_cb (GtkWidget *entry, + #endif + + ++gboolean ++is_integrated_desktop () ++{ ++ if (!m_session_name) ++ m_session_name = g_strdup (g_getenv ("XDG_SESSION_DESKTOP")); ++ if (!m_session_name) ++ return FALSE; ++ if (!g_ascii_strncasecmp (m_session_name, "gnome", strlen ("gnome"))) ++ return TRUE; ++ return FALSE; ++} ++ ++ + gboolean + _wait_for_key_release_cb (gpointer user_data) + { +@@ -63,11 +81,15 @@ get_compose_path () + const gchar * const *l; + gchar *compose_path = NULL; + ++ if (m_is_gtk_32bit_compose_error) ++ g_assert (g_setenv ("LANG", m_test_name, TRUE)); + #if GLIB_CHECK_VERSION (2, 58, 0) + langs = g_get_language_names_with_category ("LC_CTYPE"); + #else + langs = g_get_language_names (); + #endif ++ if (m_is_gtk_32bit_compose_error) ++ g_assert (g_setenv ("LANG", "en_US.UTF-8", TRUE)); + for (l = langs; *l; l++) { + if (g_str_has_prefix (*l, "en_US")) + break; +@@ -91,6 +113,9 @@ gboolean + idle_cb (gpointer user_data) + { + TestIdleData *data = (TestIdleData *)user_data; ++ static int n = 0; ++ gboolean terminate_program = FALSE; ++ + g_assert (data); + switch (data->category) { + case TEST_CREATE_ENGINE: +@@ -103,23 +128,75 @@ idle_cb (gpointer user_data) + if (g_main_loop_is_running (m_loop)) + g_main_loop_quit (m_loop); + g_clear_pointer (&m_loop, g_main_loop_unref); +-#if GTK_CHECK_VERSION (4, 0, 0) +- m_list_toplevel = FALSE; +-#else +- gtk_main_quit (); +-#endif ++ terminate_program = TRUE; + } + data->idle_id = 0; + break; ++ case TEST_DELAYED_FOCUS_IN: ++ if (m_engine_is_focused) { ++ data->idle_id = 0; ++ n = 0; ++ g_main_loop_quit (m_loop); ++ return G_SOURCE_REMOVE; ++ } ++ if (n++ < 10) { ++ g_test_message ("Waiting for \"focus-in\" signal %dth times", n); ++ return G_SOURCE_CONTINUE; ++ } ++ g_test_fail_printf ("\"focus-in\" signal is timeout."); ++ g_main_loop_quit (m_loop); ++ terminate_program = TRUE; ++ n = 0; ++ break; + default: + g_test_fail_printf ("Idle func is called by wrong category:%d.", + data->category); + break; + } ++ if (terminate_program) { ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else ++ gtk_main_quit (); ++#endif ++ } + return G_SOURCE_REMOVE; + } + + ++static void ++engine_focus_in_cb (IBusEngine *engine, ++#ifdef IBUS_FOCUS_IN_ID ++ gchar *object_path, ++ gchar *client, ++#endif ++ gpointer user_data) ++{ ++#ifdef IBUS_FOCUS_IN_ID ++ g_test_message ("engine_focus_in_cb %s %s", object_path, client); ++ m_engine_is_focused = g_strdup (client); ++#else ++ g_test_message ("engine_focus_in_cb"); ++ m_engine_is_focused = g_strdup ("No named"); ++#endif ++} ++ ++static void ++engine_focus_out_cb (IBusEngine *engine, ++#ifdef IBUS_FOCUS_IN_ID ++ gchar *object_path, ++#endif ++ gpointer user_data) ++{ ++#ifdef IBUS_FOCUS_IN_ID ++ g_test_message ("engine_focus_out_cb %s", object_path); ++#else ++ g_test_message ("engine_focus_out_cb"); ++#endif ++ g_clear_pointer (&m_engine_is_focused, g_free); ++} ++ ++ + static IBusEngine * + create_engine_cb (IBusFactory *factory, + const gchar *name, +@@ -135,11 +212,30 @@ create_engine_cb (IBusFactory *factory, + g_assert (data); + /* Don't reset idle_id to avoid duplicated register_ibus_engine(). */ + g_source_remove (data->idle_id); +- m_engine = ibus_engine_new_with_type (IBUS_TYPE_ENGINE_SIMPLE, +- name, +- engine_path, +- ibus_bus_get_connection (m_bus)); ++ m_engine = (IBusEngine *)g_object_new ( ++ IBUS_TYPE_ENGINE_SIMPLE, ++ "engine-name", name, ++ "object-path", engine_path, ++ "connection", ibus_bus_get_connection (m_bus), ++#ifdef IBUS_FOCUS_IN_ID ++ "has-focus-id", TRUE, ++#endif ++ NULL); + g_free (engine_path); ++ ++ m_engine_is_focused = NULL; ++#ifdef IBUS_FOCUS_IN_ID ++ g_signal_connect (m_engine, "focus-in-id", ++#else ++ g_signal_connect (m_engine, "focus-in", ++#endif ++ G_CALLBACK (engine_focus_in_cb), NULL); ++#ifdef IBUS_FOCUS_IN_ID ++ g_signal_connect (m_engine, "focus-out-id", ++#else ++ g_signal_connect (m_engine, "focus-out", ++#endif ++ G_CALLBACK (engine_focus_out_cb), NULL); + if (m_compose_file) + compose_path = g_build_filename (m_srcdir, m_compose_file, NULL); + else +@@ -235,6 +331,13 @@ set_engine_cb (GObject *object, + return; + } + ++ /* ibus_im_context_focus_in() is called after GlboalEngine is set. */ ++ if (is_integrated_desktop () && !m_engine_is_focused) { ++ data.category = TEST_DELAYED_FOCUS_IN; ++ data.idle_id = g_timeout_add_seconds (1, idle_cb, &data); ++ g_main_loop_run (m_loop); ++ if (data.idle_id != 0) ++ return; + if (m_compose_table == NULL) { + g_test_skip ("Your locale uses en_US compose table."); + idle_cb (&data); +@@ -319,6 +422,7 @@ set_engine (gpointer user_data) + { + g_test_message ("set_engine() is calling"); + g_assert (m_bus != NULL); ++ + ibus_bus_set_global_engine_async (m_bus, + "xkbtest:us::eng", + -1, +@@ -346,6 +450,11 @@ event_controller_enter_delay (gpointer user_data) + } + if (i++ == 10) { + g_test_fail_printf ("Window is not realized with %d times", i); ++#if GTK_CHECK_VERSION (4, 0, 0) ++ m_list_toplevel = FALSE; ++#else ++ gtk_main_quit (); ++#endif + return G_SOURCE_REMOVE; + } + g_test_message ("event_controller_enter_delay %d", i); +@@ -360,16 +469,43 @@ event_controller_enter_cb (GtkEventController *controller, + static guint id = 0; + + g_test_message ("EventController emits \"enter\" signal"); +- /* Call an idle function because gtk_widget_add_controller() +- * calls g_list_prepend() for event_controllers and this controller is +- * always called before "gtk-text-focus-controller" +- * is caleld and the IM context does not receive the focus-in yet. +- */ + if (id) + return; +- id = g_idle_add (event_controller_enter_delay, controller); ++ if (is_integrated_desktop ()) { ++ /* Wait for 3 seconds in GNOME Wayland because there is a long time lag ++ * between the "enter" signal on the event controller in GtkText ++ * and the "FocusIn" D-Bus signal in BusInputContext of ibus-daemon ++ * because mutter/core/window.c:meta_window_show() calls ++ * mutter/core/window.c:meta_window_focus() -> ++ * mutter/wayland/meta-wayland-text-input.c: ++ * meta_wayland_text_input_set_focus() -> ++ * mutter/clutter/clutter/clutter-input-method.c: ++ * clutter_input_method_focus_out() ++ * I.e. "FocusOut" and "FocusIn" D-Bus methods are always delayed ++ * against the window present in GNOME Wayland. ++ * If "FocusOut" and "FocusIn" D-Bus signals would be called after ++ * "SetGlobalEngine" D-BUs signal was called in ibus-daemon, ++ * the following functions could be called: ++ * engine_focus_out_cb() for the "gnome-shell" context ++ * engine_focus_in_cb() for the "fake" context ++ * engine_focus_out_cb() for the "fake" context ++ * engine_focus_in_cb() for the "gnome-shell" context ++ * and ibus_engine_commit_text() would not work. ++ * This assume the focus-in/out signals are called within the timeout ++ * seconds. ++ */ ++ id = g_timeout_add_seconds (3, ++ event_controller_enter_delay, ++ controller); ++ } else { ++ /* Call an idle function in Xorg because gtk_widget_add_controller() ++ * calls g_list_prepend() for event_controllers and this controller is ++ * always called before "gtk-text-focus-controller" ++ * is caleld and the IM context does not receive the focus-in yet. ++ */ ++ id = g_idle_add (event_controller_enter_delay, controller); ++ } + } +- + #else + + static gboolean +@@ -550,10 +686,18 @@ static void + test_init (void) + { + char *tty_name = ttyname (STDIN_FILENO); +- GMainLoop *loop = g_main_loop_new (NULL, TRUE); ++ GMainLoop *loop; ++ static guint idle_id = 0; ++ ++ if (idle_id) { ++ g_test_incomplete ("Test is called twice due to a timeout."); ++ return; ++ } ++ ++ loop = g_main_loop_new (NULL, TRUE); + g_test_message ("Test on %s", tty_name ? tty_name : "(null)"); + if (tty_name && g_strstr_len (tty_name, -1, "pts")) { +- g_timeout_add_seconds (3, _wait_for_key_release_cb, loop); ++ idle_id = g_timeout_add_seconds (3, _wait_for_key_release_cb, loop); + g_main_loop_run (loop); + } + g_main_loop_unref (loop); +@@ -586,14 +730,16 @@ test_compose (void) + gtk_main (); + #endif + g_log_set_always_fatal (flags); ++ g_clear_pointer (&m_engine_is_focused, g_free); ++ g_clear_pointer (&m_session_name, g_free); + } + + + int + main (int argc, char *argv[]) + { +- gchar *test_name; + gchar *test_path; ++ int retval; + + ibus_init (); + /* Avoid a warning of "AT-SPI: Could not obtain desktop path or name" +@@ -612,21 +758,42 @@ main (int argc, char *argv[]) + ? g_strdup (argv[1]) : g_strdup ("."); + m_compose_file = g_strdup (g_getenv ("COMPOSE_FILE")); + #if GLIB_CHECK_VERSION (2, 58, 0) +- test_name = g_strdup (g_get_language_names_with_category ("LC_CTYPE")[0]); ++ m_test_name = g_strdup (g_get_language_names_with_category ("LC_CTYPE")[0]); + #else +- test_name = g_strdup (g_getenv ("LANG")); ++ m_test_name = g_strdup (g_getenv ("LANG")); + #endif + if (m_compose_file && +- (!test_name || !g_ascii_strncasecmp (test_name, "en_US", 5))) { +- g_free (test_name); +- test_name = g_path_get_basename (m_compose_file); ++ (!m_test_name || !g_ascii_strncasecmp (m_test_name, "en_US", 5))) { ++ g_free (m_test_name); ++ m_test_name = g_path_get_basename (m_compose_file); ++ } ++ /* The parent of GtkIMContextWayland is GtkIMContextSimple and ++ * it outputs a warning of "Can't handle >16bit keyvals" in ++ * gtk/gtkcomposetable.c:parse_compose_sequence() in pt-BR locales ++ * and any warnings are treated as errors with g_test_run() ++ * So export LANG=en_US.UTF-8 for GNOME Wayland as a workaround. ++ */ ++ if (m_test_name && (!g_ascii_strncasecmp (m_test_name, "pt_BR", 5) || ++ !g_ascii_strncasecmp (m_test_name, "fi_FI", 5) ++ )) { ++ m_is_gtk_32bit_compose_error = TRUE; ++ } ++ if (m_is_gtk_32bit_compose_error) { ++#if 1 ++ g_assert (g_setenv ("LANG", "en_US.UTF-8", TRUE)); ++#else ++ /* FIXME: Use expected_messages in g_log_structured() */ ++ g_test_expect_message ("Gtk", G_LOG_LEVEL_WARNING, ++ "Can't handle >16bit keyvals"); ++#endif + } + g_test_add_func ("/ibus-compose/test-init", test_init); + m_loop = g_main_loop_new (NULL, TRUE); +- test_path = g_build_filename ("/ibus-compose", test_name, NULL); ++ test_path = g_build_filename ("/ibus-compose", m_test_name, NULL); + g_test_add_func (test_path, test_compose); + g_free (test_path); +- g_free (test_name); + +- return g_test_run (); ++ retval = g_test_run (); ++ g_free (m_test_name); ++ return retval; + } +-- +2.45.0 + +From 23785e6c8150aceda7f9665a3335f1e4baecd1cc Mon Sep 17 00:00:00 2001 +From: fujiwarat +Date: Thu, 1 Aug 2024 08:23:09 +0900 +Subject: [PATCH 6/6] src/tests: Fix some CI issues with busy TMT virtual session + +- Increase waiting time in ibus-compose-locales. +- Wait for 3 secs after set-engine in ibus-compose to wait for the delayed + focus-in/out events. +- delete screendump option in ibus-desktop-testing.desktop not to + support no display. +- setlocale in ibus-engine-switch to get UTF-8 warnings. +- Quote file names as shell syntax as much as possible. +- Check file existent and do not use "rm -f" as much as possible. +- Do not set GTK_IM_MODULE=ibus for Wayland. +- Exclude sshd-session to check existent sessions. + +BUG=https://github.com/ibus/ibus/pull/2657 +--- + src/tests/ibus-compose-locales.in | 4 +- + src/tests/ibus-compose.c | 23 ++++-- + src/tests/ibus-desktop-testing-autostart.in | 1 + + src/tests/ibus-desktop-testing-module | 79 ++++++++++++++++----- + src/tests/ibus-desktop-testing.desktop.in | 2 +- + src/tests/ibus-engine-switch.c | 3 + + 6 files changed, 85 insertions(+), 27 deletions(-) + +diff --git a/src/tests/ibus-compose-locales.in b/src/tests/ibus-compose-locales.in +index 7a133ce0..485204c0 100755 +--- a/src/tests/ibus-compose-locales.in ++++ b/src/tests/ibus-compose-locales.in +@@ -15,8 +15,8 @@ do + if [ "x$IS_COMMENT" != x ] ; then + continue + fi +- while [ x"$IBUS_DAEMON_WITH_SYSTEMD" != x ] && [ $INITED -lt 6 ] ; do +- echo "Waiting for ${INITED}0 secs till 60 secs" ++ while [ x"$IBUS_DAEMON_WITH_SYSTEMD" != x ] && [ $INITED -lt 12 ] ; do ++ echo "Waiting for ${INITED}0 secs till 120 secs" + sleep 10 + INITED=`expr $INITED + 1` + done +diff --git a/src/tests/ibus-compose.c b/src/tests/ibus-compose.c +index 0679c259..326d3b90 100644 +--- a/src/tests/ibus-compose.c ++++ b/src/tests/ibus-compose.c +@@ -331,13 +331,22 @@ set_engine_cb (GObject *object, + return; + } + +- /* ibus_im_context_focus_in() is called after GlboalEngine is set. */ +- if (is_integrated_desktop () && !m_engine_is_focused) { +- data.category = TEST_DELAYED_FOCUS_IN; +- data.idle_id = g_timeout_add_seconds (1, idle_cb, &data); +- g_main_loop_run (m_loop); +- if (data.idle_id != 0) +- return; ++ /* ibus_im_context_focus_in() is called after GlboalEngine is set. ++ * The focus-in/out events happen more slowly in a busy system ++ * likes with a TMT tool. ++ */ ++ if (is_integrated_desktop () && g_getenv ("IBUS_DAEMON_WITH_SYSTEMD")) { ++ g_test_message ("Start tiny \"focus-in\" signal test"); ++ for (i = 0; i < 3; i++) { ++ data.category = TEST_DELAYED_FOCUS_IN; ++ data.idle_id = g_timeout_add_seconds (1, idle_cb, &data); ++ g_main_loop_run (m_loop); ++ if (data.idle_id != 0) ++ return; ++ } ++ g_test_message ("End tiny \"focus-in\" signal test"); ++ data.category = TEST_COMMIT_TEXT; ++ } + if (m_compose_table == NULL) { + g_test_skip ("Your locale uses en_US compose table."); + idle_cb (&data); +diff --git a/src/tests/ibus-desktop-testing-autostart.in b/src/tests/ibus-desktop-testing-autostart.in +index d50354df..9ecc8c27 100755 +--- a/src/tests/ibus-desktop-testing-autostart.in ++++ b/src/tests/ibus-desktop-testing-autostart.in +@@ -73,6 +73,7 @@ main() + parse_args "$@" + init_session + check_env ++ #run_monitor + save_screen + run_test_suite + finit +diff --git a/src/tests/ibus-desktop-testing-module b/src/tests/ibus-desktop-testing-module +index 2d686813..55eb248e 100755 +--- a/src/tests/ibus-desktop-testing-module ++++ b/src/tests/ibus-desktop-testing-module +@@ -63,8 +63,9 @@ pwd + pstree -asp $$ + gsettings list-recursively org.gnome.shell + rpm -q gnome-shell-extension-no-overview gnome-shell gnome-session +-ps -ef | grep ibus | grep -v grep ++ps -ef | grep ibus | grep -v TMT | grep -v grep + ibus address ++locale + env + #dbus-send --session --print-reply --dest=org.gnome.Shell.Introspect /org/gnome/Shell/Introspect org.gnome.Shell.Introspect.GetWindows + ' +@@ -133,7 +134,8 @@ check_tty() + TTY=`tty` + if echo $PROGNAME | grep -q runner ; then + if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then +- if echo "$TTY" | grep -E 'tty|console' ; then ++ # "not a tty" is correct with TMT tool ++ if echo "$TTY" | grep -E 'tty|console' | grep -v "not a tty" ; then + print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Changing runlevel does not support console. Please log into the host with ssh." + exit 1 + fi +@@ -143,7 +145,7 @@ check_tty() + print_log -e "Running session with ssh. It might be good to use console instead." + fi + fi +- SESSION=`ps -ef | grep session | grep -v grep` ++ SESSION=`ps -ef | grep session | grep -v TMT | grep -v sshd-session | grep -v grep` + if [ x"$SESSION" != x ] ; then + print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Session is running: $SESSION" + exit 1 +@@ -254,7 +256,8 @@ create_xdg_autostart() + exit 1 + fi + mkdir -p "$TEST_USER_HOME/.config/autostart" +- cp "$desktop_file" "$TEST_USER_HOME/.config/autostart" ++ sed -e "s/\(^Exec=.*\)tests ibus\(.*\)/\1tests $TESTS\2/" "$desktop_file" \ ++ > "$TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" + LINE="AutostartCondition=if-exists $TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" + echo "$LINE" >> "$TEST_USER_HOME/.config/autostart/$AUTOSTART_DESKTOP_FILE" + chown -R "$TEST_USER" "$TEST_USER_HOME/.config" +@@ -327,6 +330,9 @@ init_session() + + LOGIN_USER=$USER + LOGIN_HOME=$HOME ++ if [ x"$TESTS" = x ] ; then ++ TESTS='ibus' ++ fi + check_tty + if [ $ENABLED_SYSTEMD -eq 1 ] && [ $SESSION_IS_GNOME -eq 1 ] ; then + SESSION_FILE1="/usr/lib/systemd/system/gnome-headless-session@.service" +@@ -482,9 +488,25 @@ init_gnome() + chown -R $LOGIN_USER $TEST_USER_HOME/.local + fi + fi ++ ++ ## Use gnome-headless-session for the no-graphics option because currently ++ ## GDM itself cannot run the login screen(greeter) without a display so ++ ## the no-graphics option does not work with GDM and the TMT tool ++ ## while GDM can invoke the headless GNOME Wayland sessions. ++ ## ++ ## Use GNOME_SHELL_WAYLAND_COMMAND for the no-graphics option to add a ++ ## virtual monitor since gnome-headless-session provides a headless mode ++ ## but no monitor and IBus focus-in/out events does not work without ++ ## any monitors. ++ ## ++ ## Use the systemd locale configuration for the no-graphcis mode since ++ ## gnome-headless-session does not pull LANG from AccountsService. ++ ## + if [ $LOGIN_USER != $USER ] ; then + SHELL_SERVICE_FILE="org.gnome.Shell@wayland.service" + SYSTEMD_USER_DIR="$TEST_USER_HOME/.config/systemd/user" ++ ENV_USER_DIR="$TEST_USER_HOME/.config/environment.d" ++ LOCALE_CONF="$ENV_USER_DIR/ibus.conf" + if test $HAVE_GRAPHICS -ne 1 ; then + if test ! -f "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" ; then + mkdir -p "$SYSTEMD_USER_DIR" +@@ -494,12 +516,19 @@ init_gnome() + > $SHELL_SERVICE_FILE + diff $SYSTEMD_SYSTEM_DIR/$SHELL_SERVICE_FILE $SHELL_SERVICE_FILE + popd +- chown -R $LOGIN_USER "$TEST_USER_HOME/.config" + fi ++ mkdir -p "$ENV_USER_DIR" ++ cat > "$LOCALE_CONF" << _EOF_LOCALE_CONF ++LANG=$SESSION_LANG ++_EOF_LOCALE_CONF ++ chown -R $LOGIN_USER "$TEST_USER_HOME/.config" + else + if test -f "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" ; then + rm "$SYSTEMD_USER_DIR/$SHELL_SERVICE_FILE" + fi ++ if test -f "$LOCALE_CONF" ; then ++ rm "$LOCALE_CONF" ++ fi + fi + fi + GET_DISABLE_USER_EX="gsettings get org.gnome.shell disable-user-extensions" +@@ -556,7 +585,7 @@ operate_desktop_with_systemd() + SESSION=gnome-headless-session + COMMAND="$1" + +- #if test $HAVE_GRAPHICS -eq 1 ; then ++ if test $HAVE_GRAPHICS -eq 1 ; then + case "$COMMAND" in + "start") systemctl isolate graphical.target + echo "" +@@ -565,22 +594,24 @@ operate_desktop_with_systemd() + "") print_log -e "${RED}FAIL${NC}: ${RED}ERROR${NC}: Wrong command $COMMAND" + exit 1;; + esac +- #else +- # setenforce 0 +- # systemctl $COMMAND ${SESSION}@${TEST_USER} +- #fi ++ else ++ setenforce 0 ++ systemctl $COMMAND ${SESSION}@${TEST_USER} ++ fi + case "$COMMAND" in + "start") sleep 30;; + "") ;; + esac +- #if test $HAVE_GRAPHICS -eq 1 ; then ++ if test $HAVE_GRAPHICS -eq 1 ; then + systemctl status --no-pager graphical.target +- #else +- # systemctl status --no-pager ${SESSION}@${TEST_USER} +- #fi ++ else ++ systemctl status --no-pager ${SESSION}@${TEST_USER} ++ fi + ps -ef | grep X + ps -ef | grep session + ps -ef | grep ibus ++ SUSER=`echo "$LOGIN_USER" | cut -c 1-7` ++ ps -ef | grep $SUSER + } + + +@@ -639,6 +670,23 @@ run_session() + } + + ++run_monitor() ++{ ++ if ! which gnome-monitor-config > /dev/null ; then ++ print_log -e "${RED}FAIL${NC}: No gnome-monitor-config" ++ return ++ fi ++ if [ $ENABLED_SYSTEMD -ne 1 ] || [ $SESSION_IS_GNOME -ne 1 ] \ ++ || [ $HAVE_GRAPHICS -ne 1 ] ; then ++ return ++ fi ++ /usr/libexec/gnome-screen-cast.py -v 1024 768 & ++ sleep 3 ++ gnome-monitor-config list ++ #gnome-monitor-config set -LpM Virtual-1 -t normal -m 1024x768@60.004 ++} ++ ++ + count_case_result() + { + retval=$1 +@@ -758,9 +806,6 @@ run_gnome_desktop_testing_runner() + { + pass=0 + fail=0 +- if [ x"$TESTS" = x ] ; then +- TESTS='ibus' +- fi + if echo $PROGNAME | grep -q autostart ; then + export IBUS_DAEMON_WITH_SYSTEMD=1 + fi +diff --git a/src/tests/ibus-desktop-testing.desktop.in b/src/tests/ibus-desktop-testing.desktop.in +index e91900ed..fe9356ad 100644 +--- a/src/tests/ibus-desktop-testing.desktop.in ++++ b/src/tests/ibus-desktop-testing.desktop.in +@@ -2,7 +2,7 @@ + Name=IBus Desktop Testing Runner + GenericName=Input Method Desktop Testing Runner + Comment=Test plugin for IBus Desktop Testing +-Exec=sh -c 'exec @libexecdir@/ibus-desktop-testing-autostart --envcheck --output $HOME/test-autostart.log --result $HOME/test.log --runner gnome --screendump $HOME/screen.log --tests ibus' ++Exec=sh -c 'exec @libexecdir@/ibus-desktop-testing-autostart --envcheck --output $HOME/test-autostart.log --result $HOME/test.log --runner gnome --tests ibus' + Terminal=false + Type=Application + Encoding=UTF-8 +diff --git a/src/tests/ibus-engine-switch.c b/src/tests/ibus-engine-switch.c +index b50bac59..7359e125 100644 +--- a/src/tests/ibus-engine-switch.c ++++ b/src/tests/ibus-engine-switch.c +@@ -1,5 +1,6 @@ + /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil; -*- */ + ++#include + #include + #include + #include "ibus.h" +@@ -251,6 +252,8 @@ main (gint argc, + gchar **argv) + { + gint result; ++ /* To get UTF-8 error messages with glib2 */ ++ setlocale (LC_ALL, ""); + ibus_init (); + g_test_init (&argc, &argv, NULL); + bus = ibus_bus_new (); +-- +2.45.0 + diff --git a/SOURCES/ibus-xinput b/SOURCES/ibus-xinput new file mode 100644 index 0000000..3bf9974 --- /dev/null +++ b/SOURCES/ibus-xinput @@ -0,0 +1,22 @@ +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 +# IMSETTINGS_IGNORE_SESSION concatenate the current session name and type x11 or +# wayland. The current session name is calculated by get_destop() +# in /usr/libexec/imsettings-functions and the value is case-sensitive. +IMSETTINGS_IGNORE_SESSION=KDE-wayland + +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/SOURCES/ibus.conf.5 b/SOURCES/ibus.conf.5 new file mode 100644 index 0000000..c5795b3 --- /dev/null +++ b/SOURCES/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/SPECS/ibus.spec b/SPECS/ibus.spec new file mode 100644 index 0000000..80d5694 --- /dev/null +++ b/SPECS/ibus.spec @@ -0,0 +1,2326 @@ +%global source_version %%(echo "%version" | tr '~' '-') + +# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3 +%if (0%{?fedora} > 29 || 0%{?rhel} > 7) +%global with_python2 0 +%else +%global with_python2 1 +%endif + +%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} + +# No gtk2 in RHEL 10 +%if 0%{?rhel} > 9 +%bcond_with gtk2 +%bcond_with xinit +%else +%bcond_without gtk2 +%bcond_without xinit +%endif + +%if (0%{?fedora} > 33 || 0%{?rhel} > 8) +%bcond_without gtk4 +%else +%bcond_with gtk4 +%endif + +%global ibus_xinit_condition %ibus_panel_condition +# FIXME: How to write a condition with multiple lines +%global ibus_panel_condition (%pcd1 or %pcd2 or %pcd3) +%global pcd1 budgie-desktop or cinnamon or deepin-desktop or i3 +%global pcd2 lxqt-session or lxsession or mate-panel or phosh +%global pcd3 plasma-workspace or sugar or xfce4-session + +%if %with_pkg_config +%if %{with gtk2} +%{!?gtk2_binary_version: %global gtk2_binary_version %(pkg-config --variable=gtk_binary_version gtk+-2.0)} +%else +%{!?gtk2_binary_version: %global gtk2_binary_version ?.?.?} +%endif +%{!?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.31~beta1 +# https://github.com/fedora-infra/rpmautospec/issues/101 +Release: 12%{?dist} +Summary: Intelligent Input Bus for Linux OS +License: LGPL-2.1-or-later +URL: https://github.com/ibus/%name/wiki +Source0: https://github.com/ibus/%name/releases/download/%{source_version}/%{name}-%{source_version}.tar.gz +Source1: https://github.com/ibus/%name/releases/download/%{source_version}/%{name}-%{source_version}.tar.gz.sum +Source2: %{name}-xinput +Source3: %{name}.conf.5 +# Patch0: %%{name}-HEAD.patch +Patch0: %{name}-HEAD.patch +# Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577 +Patch1: %{name}-1385349-segv-bus-proxy.patch + +# autoreconf requires autopoint but not po.m4 +BuildRequires: gettext-devel +BuildRequires: libtool +# for gtkdoc-fixxref +BuildRequires: glib2-doc +%if %{with gtk2} +BuildRequires: gtk2-devel +%endif +BuildRequires: gtk3-devel +%if %{with gtk4} +BuildRequires: gtk4-devel +%endif +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 +%if %with_python2 +# https://bugzilla.gnome.org/show_bug.cgi?id=759334 +# Need python2 for gsettings-schema-convert +BuildRequires: python2-devel +# for AM_GCONF_SOURCE_2 in configure.ac +BuildRequires: GConf2-devel +BuildRequires: intltool +%endif +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 + +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if %{with gtk2} +Requires: (%{name}-gtk2%{?_isa} = %{version}-%{release} if gtk2) +%endif +Requires: %{name}-gtk3%{?_isa} = %{version}-%{release} +Requires: %{name}-setup = %{version}-%{release} +%if 0%{?fedora} +Requires: (%{name}-panel%{?_isa} = %{version}-%{release} if %ibus_panel_condition) +%endif +%if %{with xinit} +Requires: (%{name}-xinit = %{version}-%{release} if %ibus_xinit_condition) +%endif + +Requires: iso-codes +Requires: dconf +# rpmlint asks to delete librsvg2 +#Requires: librsvg2 +# Owner of %%python3_sitearch/gi/overrides +Requires: python3-gobject +# https://bugzilla.redhat.com/show_bug.cgi?id=1161871 +%{?__python3:Requires: %{__python3}} + +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} +# Owner of %%{_libdir}/girepository-1.0 +Requires: gobject-introspection +%if (0%{?fedora} > 28 || 0%{?rhel} > 7) +%else +Conflicts: %{name}%{?_isa} < %{version} +%endif + +%description libs +This package contains the libraries for IBus + +%if %{with gtk2} +%package gtk2 +Summary: IBus IM module for GTK2 +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: glib2 >= %{glib_ver} +Requires(post): glib2 >= %{glib_ver} +# Added for upgrade el6 to el7 +Provides: ibus-gtk = %{version}-%{release} +Obsoletes: ibus-gtk < %{version}-%{release} + +%description gtk2 +This package contains IBus IM module for GTK2 +%endif + +%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: python3-gobject-devel +BuildRequires: make +BuildArch: noarch + +%description setup +This is a setup utility for IBus. + +%if %with_python2 +%package pygtk2 +Summary: IBus PyGTK2 library +%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7) +Requires: dbus-python >= %{dbus_python_version} +%else +Requires: python2-dbus >= %{dbus_python_version} +%endif +Requires: python2 +Requires: pygtk2 +BuildArch: noarch + +%description pygtk2 +This is a PyGTK2 library for IBus. Now major IBus engines use PyGObject3 +and this package will be deprecated. +%endif + +%package py2override +Summary: IBus Python2 override library +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +# Owner of %%python2_sitearch/gi/overrides +%if (0%{?fedora} && 0%{?fedora} <= 27) || (0%{?rhel} && 0%{?rhel} <= 7) +Requires: pygobject3-base +%else +Requires: python2-gobject-base +%endif +Requires: python2 + +%description py2override +This is a Python2 override library for IBus. The Python files override +some functions in GObject-Introspection. + +%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 panel +Summary: IBus Panel icon +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if %{with xinit} +# setxkbmap can change XKB options for Xorg desktop sessions +Requires: setxkbmap +%endif +BuildRequires: libdbusmenu-gtk3-devel + +%description panel +This package contains IBus Panel icon using GtkStatusIcon or AppIndicator +in non-GNOME desktop sessions likes XFCE or Plasma because gnome-shell +shows the IBus Icon. This package depends on libdbusmenu-gtk3 for Wayland +desktop sessions. + +%package xinit +Summary: IBus Xinit +Requires: %{name} = %{version}-%{release} +%if %{with xinit} +# Owner of %%{_sysconfdir}/X11/xinit +Requires: xorg-x11-xinit +%endif +BuildArch: noarch + +%description xinit +This package includes xinit scripts to set environment variables of IBus +for Xorg desktop sessions and this is not needed by Wayland desktop sessions. + +%package devel +Summary: Development tools for ibus +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Requires: dbus-devel +Requires: glib2-devel +# for %%{_datadir}/gettext/its +Requires: gettext-runtime + +%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} +%if 0%{?fedora:1}%{?rhel:0} +# Use no-overview mode in CI to get input focus +BuildRequires: gnome-shell-extension-no-overview +Requires: gnome-shell-extension-no-overview +%endif +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} +Requires: %{name}-libs%{?_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 +SAVED_SUM=$(grep sha512sum %SOURCE1 | awk '{print $2}') +MY_SUM=$(sha512sum %SOURCE0 | awk '{print $1}') +if test x"$SAVED_SUM" != x"$MY_SUM" ; then + abort +fi +%autosetup -S git -n %{name}-%{source_version} +# cp client/gtk2/ibusimcontext.c client/gtk3/ibusimcontext.c || : +# cp client/gtk2/ibusim.c client/gtk3/ibusim.c || : +# cp client/gtk2/ibusimcontext.c client/gtk4/ibusimcontext.c || : +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 +#make -C ui/gtk3 maintainer-clean-generic +#make -C tools maintainer-clean-generic +#make -C src/compose maintainer-clean-generic +autoreconf -f -i -v +%configure \ + --disable-static \ +%if %{with gtk2} + --enable-gtk2 \ +%else + --disable-gtk2 \ +%endif + --enable-gtk3 \ +%if %{with gtk4} + --enable-gtk4 \ +%endif + --enable-xim \ + --enable-gtk-doc \ + --enable-surrounding-text \ + --with-python=python3 \ +%if ! %with_python2 + --disable-python2 \ +%else + --enable-python-library \ +%endif + --enable-wayland \ + --enable-introspection \ + --enable-install-tests \ + %{nil} +make -C ui/gtk3 maintainer-clean-generic + +%make_build + +%install +make install DESTDIR=$RPM_BUILD_ROOT INSTALL='install -p' +rm -f $RPM_BUILD_ROOT%{_libdir}/libibus-*%{ibus_api_version}.la +%if %{with gtk2} +rm -f $RPM_BUILD_ROOT%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.la +%endif +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 +%if %{without xinit} +# setxkbmap is not available in RHEL10 +rm -f $RPM_BUILD_ROOT%{_datadir}/installed-tests/ibus/xkb-latin-layouts.test +%endif + +# install man page +for S in %{SOURCE3} +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 %{SOURCE2} $RPM_BUILD_ROOT%{_xinputconf} + +install -m 755 -d $RPM_BUILD_ROOT%pkgcache/bus +# `rpm -Vaq ibus` compare st_mode of struct stat with lstat(2) and +# st_mode of the RPM cache and if the file does not exist, st_mode of +# RPM cache is o0100000 while the actual st_mode is o0100644. +touch $RPM_BUILD_ROOT%pkgcache/bus/registry + +# install .desktop files +%if %with_python2 +echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/ibus-setup.desktop +%else +echo "NoDisplay=true" >> $RPM_BUILD_ROOT%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop +%endif +#echo "X-GNOME-Autostart-enabled=false" >> $RPM_BUILD_ROOT%%{_sysconfdir}/xdg/autostart/ibus.desktop + +mkdir -p $RPM_BUILD_ROOT%{_libdir}/ibus +cp src/compose/sequences-* $RPM_BUILD_ROOT%{_libdir}/ibus + +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 xkb-latin-layouts" \ + 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 +# FIXME: no version number +%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 +%dir %{_datadir}/GConf +%dir %{_datadir}/GConf/gsettings +%{_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 +%{_libexecdir}/ibus-engine-simple +%{_libexecdir}/ibus-dconf +%{_libexecdir}/ibus-portal +%{_libexecdir}/ibus-extension-gtk3 +%{_libexecdir}/ibus-ui-emojier +%{_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 +%dir %{_prefix}/lib/systemd/user/gnome-session.target.wants +%{_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 +%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 + +%if %{with gtk2} +%files gtk2 +%{_libdir}/gtk-2.0/%{gtk2_binary_version}/immodules/im-ibus.so +%endif + +%files gtk3 +%{_libdir}/gtk-3.0/%{gtk3_binary_version}/immodules/im-ibus.so + +%if %{with gtk4} +%files gtk4 +%dir %{_libdir}/gtk-4.0/%{gtk4_binary_version}/immodules +%{_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 +%if %with_python2 +%{_datadir}/applications/ibus-setup.desktop +%else +%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop +%endif +%{_datadir}/ibus/setup +%{_datadir}/man/man1/ibus-setup.1.gz + +%if %with_python2 +%files pygtk2 +%dir %{python2_sitelib}/ibus +%{python2_sitelib}/ibus/* +%endif + +%if %with_python2 +%files py2override +%python2_sitearch/gi/overrides/IBus.py* +%endif + +%files wayland +%{_libexecdir}/ibus-wayland + +%files panel +%{_datadir}/applications/org.freedesktop.IBus.Panel.Wayland.Gtk3.desktop +%{_libexecdir}/ibus-ui-gtk3 + +%files xinit +%{_datadir}/man/man5/ibus.conf.5.gz +%if %{without xinit} +# ibus owns xinit directory without xorg-x11-xinit package +%dir %{_sysconfdir}/X11/xinit +%dir %{_sysconfdir}/X11/xinit/xinput.d +%endif +# Do not use %%config(noreplace) to always get the new keywords in _xinputconf +# For user customization, $HOME/.xinputrc can be used instead. +%config %{_xinputconf} + +%files devel +%{_libdir}/ibus +%{_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 +%{_libexecdir}/ibus-desktop-testing-module + +%files tests +%dir %{_libexecdir}/installed-tests +%{_libexecdir}/installed-tests/ibus +%dir %{_datadir}/installed-tests +%{_datadir}/installed-tests/ibus + +%changelog +* Tue Nov 26 2024 MSVSphere Packaging Team - 1.5.31~beta1-12 +- Rebuilt for MSVSphere 10 + +* Thu Aug 01 2024 Takao Fujiwara - 1.5.31~beta1-12 +- Delete tmt installation for RHEL10 CI + +* Mon Jul 29 2024 Takao Fujiwara - 1.5.31~beta1-11 +- Disable ibus-panel rich condition in RHEL +- Delete ibus-xx-desktop-testing-mutter.patch +- Delete libXtst-devel dependency +- Replace gnome-terminal with ptyxis +- Install gnome-desktop-testing for RHEL +- Delete xorg-x11-server-Xvfb gnome-session-xsession +- Delete build packages for gnome-desktop-testing for RHEL +- Move evince gnome-logs gvfs-fuse gvfs-gphoto2 gvfs-smb to Fedora specific +- Fix CI test case conditions +- Add no-overview@fthx until gnome-shell-extension-no-overview is available +- Add gnome-headless-session@.service until GDM will provide it + +* Sat Jul 27 2024 Takao Fujiwara - 1.5.31~beta1-10 +- Replace GNOME Xorg with GNOME Wayland in CI +- Replace STI with TMT in CI + +* Sat Jul 27 2024 Takao Fujiwara - 1.5.31~beta1-9 +- Update CI for RHEL packages + +* Thu Jul 18 2024 Fedora Release Engineering - 1.5.31~beta1-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jul 18 2024 Takao Fujiwara - 1.5.31~beta1-7 +- Resolves #2297147 Add directory datadir/GConf/gsettings +- Resolves #2297735 Move ibus.conf to ibus-xinit sub package +- Fix memory leaks in error handlings + +* Fri Jul 12 2024 Takao Fujiwara - 1.5.31~beta1-6 +- Bump to 1.5.31-beta1 + +* Mon Jun 10 2024 Python Maint - 1.5.30-6 +- Rebuilt for Python 3.13 + +* Sat Jun 08 2024 Takao Fujiwara - 1.5.30-5 +- Resolves #2290842 Fix Super-space in Wayland +- Fix compose sequences beyond U10000 + +* Fri Jun 07 2024 Python Maint - 1.5.30-4 +- Rebuilt for Python 3.13 + +* Sat Jun 01 2024 Takao Fujiwara - 1.5.30-3 +- Resolve #2284094 Fix preedit in Flatpak with new DBus unique name +- Add directory %%{_prefix}/lib/systemd/user/gnome-session.target.wants +- Add directory %%{_libdir}/gtk-4.0/%{gtk4_binary_version}/immodules + +* Fri May 24 2024 Takao Fujiwara - 1.5.30-2 +- Resolve #2252227 Fix display buffer overflow +- Change IBus unique name to :1.0 from IBUS_SERVICE_IBUS + +* Thu May 02 2024 Takao Fujiwara - 1.5.30-1 +- Bump to 1.5.30 + +* Fri Apr 12 2024 Takao Fujiwara - 1.5.30~rc3-2 +- New sub package ibus-xinit for RHEL not to depend on xorg-x11-xinit + +* Tue Apr 02 2024 Takao Fujiwara - 1.5.30~rc3-1 +- Delete upstreamed patches + +* Mon Mar 25 2024 Takao Fujiwara - 1.5.30~rc2-2 +- Fix Super modifier in IBusEngine +- Replace deprecated pygobject3-devel with python3-gobject-devel + +* Fri Mar 22 2024 Takao Fujiwara - 1.5.30~rc2-1 +- Add some bug fixes & translation updates + +* Wed Feb 28 2024 Takao Fujiwara - 1.5.30~rc1-1 +- Add some bug fixes & translation updates + +* Tue Feb 13 2024 Takao Fujiwara - 1.5.30~beta1-1 +- Implement ibus start/restart for Plasma Wayland +- Show preferences menu item in activate menu in Plasma Wayland +- Fix typing freeze with barcode reader + +* Wed Jan 24 2024 Fedora Release Engineering - 1.5.29~rc2-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sat Jan 20 2024 Fedora Release Engineering - 1.5.29~rc2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Dec 21 2023 Takao Fujiwara - 1.5.29~rc2-6 +- Fix game control keys with language layout + +* Fri Dec 15 2023 Takao Fujiwara - 1.5.29~rc2-5 +- Refactor object initialization +- Fix some warnings + +* Tue Dec 05 2023 Takao Fujiwara - 1.5.29~rc2-4 +- Complete preedit signals for PostProcessKeyEvent + +* Sat Nov 25 2023 Takao Fujiwara - 1.5.29~rc2-3 +- Resolve #2188800 Error handling with display == null +- Enhance #2237486 Implement preedit color in Plasma Wayland + +* Wed Nov 15 2023 Takao Fujiwara - 1.5.29~rc2-2 +- Call strdup() after g_return_if_fail() in im-ibus.so + +* Thu Nov 09 2023 Takao Fujiwara - 1.5.29~rc2-1 +- Bump to 1.5.29-rc2 + +* Wed Oct 25 2023 Takao Fujiwara - 1.5.29~rc1-6 +- Add preedit D-Bus signals to PostProcessKeyEvent + +* Mon Oct 23 2023 Takao Fujiwara - 1.5.29~rc1-5 +- Add DeleteSurroundingText to PostProcessKeyEvent + +* Sat Sep 30 2023 Takao Fujiwara - 1.5.29~rc1-4 +- Enhance #2237486 Implement preedit color in Plasma Wayland +- Part-of #2240490 Eacute with CapsLock in Plasma Wayland only +- Revert dnf5 to dnf in autogen +- Test fix #2239633 g_list_remove() in ibus-portal SIGSEGV + +* Thu Sep 07 2023 Takao Fujiwara - 1.5.29~rc1-3 +- Resolves #2237486 Implement preedit color in Plasma Wayland + +* Tue Aug 22 2023 Takao Fujiwara - 1.5.29~rc1-2 +- Resolves #2233527 Add IMSETTINGS_IGNORE_SESSION=KDE-wayland in ibus.conf + +* Tue Aug 22 2023 Takao Fujiwara - 1.5.29~rc1-1 +- Bump to 1.5.29-rc1 + +* Mon Aug 21 2023 Takao Fujiwara - 1.5.29~beta2-3 +- Add ibus_panel_condition + +* Fri Aug 18 2023 Takao Fujiwara - 1.5.29~beta2-2 +- Separate ibus-ui-gtk3 as ibus-panel sub package depended on libdbusmenu +- Update autogen.sh for Fedora 39 +- Fix cursor position with GTK4 in Xorg + +* Tue Aug 08 2023 Takao Fujiwara - 1.5.29~beta2-1 +- Distinguish Arabic XKB and Keypad XKB options + +* Thu Aug 03 2023 Takao Fujiwara - 1.5.29~beta1-2 +- Fix some source tests +- Fix configure --disable-appindicator +- Fix typo in src/ibusservice.h + +* Fri Jul 28 2023 Takao Fujiwara - 1.5.29~beta1-1 +- Implement Plasma Wayland + +* Thu Jul 20 2023 Fedora Release Engineering - 1.5.28-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Wed Jul 12 2023 Takao Fujiwara - 1.5.28-13 +- Fix sync ibus_input_context_process_key_event() #3 + +* Sun Jul 09 2023 Takao Fujiwara - 1.5.28-12 +- Fix sync ibus_input_context_process_key_event() #2 + +* Fri Jul 07 2023 Takao Fujiwara - 1.5.28-11 +- Fix sync ibus_input_context_process_key_event() + +* Wed Jul 05 2023 Python Maint - 1.5.28-10 +- Rebuilt for Python 3.12 + +* Wed Jul 05 2023 Takao Fujiwara - 1.5.28-9 +- Delete upstreamed ibus-xx-cross-compile.patch +- Fix alive ibus-x11 with `Xephyr -query` +- Fix missing ibusenumtypes.h with parallel build +- Fix to build libibus-1.0.la twice + +* Thu Jun 15 2023 Python Maint - 1.5.28-8 +- Rebuilt for Python 3.12 + +* Sun Jun 11 2023 Takao Fujiwara - 1.5.28-7 +- Delete GZipped man files +- Resolves #2213145 Unselect Add button in Select Input Method dialog in setup +- Fix unaligned accesses in ibuscomposetable + +* Fri May 26 2023 Takao Fujiwara - 1.5.28-6 +- Resolves: #2195895 ibus_input_context_set_cursor_location(): ibus-x11 SIGSEGV + +* Fri May 12 2023 Takao Fujiwara - 1.5.28-5 +- Fix cross compiling with gen-internal-compose-table + +* Wed May 10 2023 Tomas Popela - 1.5.28-5 +- Drop BR on dbus-glib as the project is using already GDBus + +* Tue May 02 2023 Takao Fujiwara - 1.5.28-4 +- Migrate some upstream patches + +* Fri Mar 17 2023 Takao Fujiwara - 1.5.28-3 +- Resolves: #2178178 Fix emoji lookup table only but emojier GUI left + +* Wed Mar 15 2023 Takao Fujiwara - 1.5.28-2 +- Fix Key typing order in ibus-x11 +- Disable while loop before call ForwardEventMessageProc() in ibus-x11 + +* Tue Feb 21 2023 Takao Fujiwara - 1.5.28-1 +- Bump to 1.5.28 + +* Fri Feb 17 2023 Takao Fujiwara - 1.5.27-15 +- Resolves: #2169205 Return error if D-Bus set/get property method is failed + +* Wed Jan 25 2023 Takao Fujiwara - 1.5.27-14 +- Add active-surrounding-text property to IBusEngine +- Refactor surrounding text warning & free focus-id tables + +* Thu Jan 19 2023 Fedora Release Engineering - 1.5.27-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Tue Jan 17 2023 Takao Fujiwara - 1.5.27-12 +- Resolves: #2160957 Fix st_mode in struct stat of registry file with rpm -Va + +* Thu Jan 12 2023 Takao Fujiwara - 1.5.27-11 +- Refactor surrounding text warning + +* Fri Jan 06 2023 Tomas Popela - 1.5.27-10 +- Don't build GTK 2 content for RHEL 10 as GTK 2 won't be there + +* Thu Jan 05 2023 Takao Fujiwara - 1.5.27-9 +- Convert gtk_compose_seqs_compact to GResource + +* Wed Dec 07 2022 Takao Fujiwara - 1.5.27-8 +- Resolved: #2151344 SEGV with portal_context->owner in name_owner_changed() + +* Fri Dec 02 2022 Takao Fujiwara - 1.5.27-7 +- Add GitHub action patches + +* Thu Nov 24 2022 Takao Fujiwara - 1.5.27-6 +- Implement new process_key_event for ibus-x11 + +* Wed Nov 16 2022 Takao Fujiwara - 1.5.27-5 +- Migrate license tag to SPDX + +* Thu Nov 03 2022 Takao Fujiwara - 1.5.27-4 +- Resolves: #2081055 Avoid to unref m_engines with double run + +* Mon Sep 19 2022 Takao Fujiwara - 1.5.27-3 +- Update ibus_input_context_set_surrounding_text for a global IC +- Fix CI + +* Fri Sep 16 2022 Takao Fujiwara - 1.5.27-2 +- Resolves: #2093313 Stop many warnings of surrounding text +- Fix other surrounding text issues + +* Tue Aug 23 2022 Takao Fujiwara - 1.5.27-1 +- Bump to 1.5.27 + +* Thu Aug 18 2022 Takao Fujiwara - 1.5.26-17 +- Resolves: #2119020 Require gettext-runtime instead of gettext for ibus-devel + +* Fri Aug 12 2022 Takao Fujiwara - 1.5.26-16 +- Revert Emoji shortcut key to Super-period + +* Fri Jul 29 2022 Takao Fujiwara - 1.5.26-15 +- Enhance Xutf8TextListToTextProperty in ibus-x11 + +* Thu Jul 21 2022 Fedora Release Engineering - 1.5.26-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jul 07 2022 Takao Fujiwara - 1.5.26-13 +- Add IBUS_CAP_OSK to IBusCapabilite +- Update ibus restart for --service-file option +- Update manpage for ibus im-module command +- Implement new process_key_event for GTK4 +- Add focus_in_id()/focus_out_id() class methods in IBusEngine + +* Wed Jun 29 2022 Takao Fujiwara - 1.5.26-12 +- Add ibus im-module command + +* Sat Jun 25 2022 Takao Fujiwara - 1.5.26-11 +- Enable custome theme +- Fix ibus restart for GNOME desktop + +* Mon Jun 13 2022 Python Maint - 1.5.26-10 +- Rebuilt for Python 3.11 + +* Sat Jun 11 2022 Takao Fujiwara - 1.5.26-9 +- Resolves: #2088656 Revise XKB engine panel menu in Plasma Wayland + +* Thu Jun 02 2022 Takao Fujiwara - 1.5.26-8 +- Resolves: #2088656 Hide XKB engine but enable it in Plasma Wayland + +* Wed May 25 2022 Takao Fujiwara - 1.5.26-7 +- Update xkb-latin-layouts gsettings + +* Mon May 23 2022 Takao Fujiwara - 1.5.26-6 +- Resolves: #1936777 abrt ibus_bus_connect_async(): ibus-x11 + +* Wed Apr 20 2022 Takao Fujiwara - 1.5.26-4 +- Resolves: #2076596 Disable XKB engines in Plasma Wayland + +* Thu Mar 31 2022 Takao Fujiwara - 1.5.26-3 +- Fix refcounting issues in IBusText & IBusProperty + +* Mon Mar 28 2022 Takao Fujiwara - 1.5.26-2 +- Update ibus-desktop-testing-runner to always run ibus-daemon directly + +* Mon Mar 14 2022 Takao Fujiwara - 1.5.26-1 +- Bump to 1.5.26 +- Revert CCedilla change for pt-BR + +* Fri Mar 04 2022 Takao Fujiwara - 1.5.25-13 +- Check XDG_SESSION_DESKTOP for Plasma desktop + +* Tue Mar 01 2022 Takao Fujiwara - 1.5.25-12 +- Fix algorithm dead keys + +* Mon Feb 21 2022 Takao Fujiwara - 1.5.25-11 +- Fix forwarding keycode in GTK4 + +* Fri Feb 11 2022 Takao Fujiwara - 1.5.25-10 +- Do not mkdir abstract unix socket +- Fix IBus.key_event_from_string +- Add systemd unit file + +* Thu Feb 03 2022 Takao Fujiwara - 1.5.25-9 +- Change XKB layout string color in panel +- Add Ctrl-semicolon to Emoji shortcut key +- Fix unref problems with floating references +- Update man page for Emoji shortcut key +- Add IBUS_INPUT_HINT_PRIVATE for browser private mode +- mkdir socket dirs instead of socket paths + +* Thu Jan 20 2022 Fedora Release Engineering - 1.5.25-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Tue Jan 18 2022 Takao Fujiwara - 1.5.25-7 +- Update and fix typo in autostart scripts + +* Fri Dec 03 2021 Takao Fujiwara - 1.5.25-6 +- Check mtime of entity compose file instead of one of symlink file +- Disable emoji shortcut key with no-emoji hint +- Resolves: #2026540 Own %%pkgcache directory + +* Fri Oct 29 2021 Takao Fujiwara - 1.5.25-5 +- Resolves: #1942970 Clear Emoijer preedit/lookup popup between applications + +* Mon Sep 06 2021 Takao Fujiwara - 1.5.25-4 +- Clear preedit with mouse click and GTK4 applications + +* Wed Sep 01 2021 Takao Fujiwara - 1.5.25-3 +- Fix wrong cursor location in gtk3 + +* Fri Aug 27 2021 Takao Fujiwara - 1.5.25-2 +- Add --screendump option in ibus-desktop-testing-runner + +* Fri Aug 20 2021 Takao Fujiwara - 1.5.25-1 +- Bump to 1.5.25 + +* Mon Aug 09 2021 Takao Fujiwara - 1.5.24-13 +- Enable sync process in GTK4 + +* Mon Jul 26 2021 Takao Fujiwara - 1.5.24-12 +- Search language name in engine list in ibus-setup +- Set Multi_key to 0xB7 in compose preedit +- Make Compose preedit less intrusive + +* Thu Jul 22 2021 Fedora Release Engineering - 1.5.24-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jul 15 2021 Takao Fujiwara - 1.5.24-10 +- Support include directive in user compose file +- Set Ctrl-period to default Emoji shortcut key + +* Tue Jun 29 2021 Takao Fujiwara - 1.5.24-9 +- Delete G_MESSAGES_DEBUG for gsettings output + +* Mon Jun 28 2021 Takao Fujiwara - 1.5.24-8 +- Depend on gnome-shell-extension-no-overview for CI + +* Thu Jun 17 2021 Takao Fujiwara - 1.5.24-7 +- Use transfiletriggerin and transfiletriggerpostun +- Change mutter to no-overview gnome-shell in CI + +* Fri Jun 04 2021 Python Maint - 1.5.24-6 +- Rebuilt for Python 3.10 + +* Wed May 26 2021 Takao Fujiwara - 1.5.24-5 +- Fix minor covscan reviews + +* Fri May 21 2021 Takao Fujiwara - 1.5.24-4 +- Fix covscan reviews +- Implement ibus_im_context_set_surrounding_with_selection() + +* Sat Mar 20 2021 Takao Fujiwara - 1.5.24-3 +- Don't output FAIL if the actual failure is 0 for Fedora CI + +* Sat Mar 20 2021 Takao Fujiwara - 1.5.24-2 +- Change default session to mutter from gnome in desktop-testing + +* Mon Feb 22 2021 Takao Fujiwara - 1.5.24-1 +- Bump to 1.5.24 + +* Tue Jan 26 2021 Fedora Release Engineering - 1.5.23-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 20 2021 Takao Fujiwara - 1.5.23-3 +- Enable IM gtk4 module +- Fix to rename xkb:de::ger to sync xkeyboard-config +- Enhance ibus-setup search engine + +* Fri Nov 20 2020 Takao Fujiwara - 1.5.23-2 +- Bug 1898065 - Fix build failure of emoji-*.dict with CLDR 38 +- Fix build failure with Vala 0.50 +- Add IBUS_INPUT_PURPOSE_TERMINAL + +* Tue Sep 29 2020 Takao Fujiwara - 1.5.23-1 +- Bump to 1.5.23 + +* Tue Sep 15 2020 Takao Fujiwara - 1.5.22-17 +- Update po files + +* Wed Sep 09 2020 Takao Fujiwara - 1.5.22-16 +- Bug 1876877 - Fix to pull the correct language with no iso639 variants +- Accept xdigits only for Unicode typing + +* Thu Aug 27 2020 Takao Fujiwara - 1.5.22-15 +- Rename simple.xml to simple.xml.in + +* Thu Aug 27 2020 Takao Fujiwara - 1.5.22-14 +- Update ibusunicodegen.h with latest unicode-ucd +- Update simple.xml with latest xkeyboard-config +- Fix gvfsd-fuse to unbind directory +- Update translations + +* Fri Aug 21 2020 Takao Fujiwara - 1.5.22-13 +- Update simple.xml with layout_variant + +* Fri Aug 21 2020 Takao Fujiwara - 1.5.22-12 +- Generate simple.xml with denylist +- Tell Pango about the engine language in the candidate panel +- Add file list in registry file for Silverblue + +* Tue Jul 28 2020 Adam Jackson - 1.5.22-11 +- Require setxkbmap not xorg-x11-xkb-utils + +* Tue Jul 28 2020 Takao Fujiwara - 1.5.22-10 +- Delete _python_bytecompile_extra +- Update CI from ibus-typing-booster + +* Tue Jul 28 2020 Fedora Release Engineering - 1.5.22-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue May 26 2020 Miro Hrončok - 1.5.22-8 +- Rebuilt for Python 3.9 + +* Fri May 15 2020 Takao Fujiwara - 1.5.22-7 +- Resolves #1797726 bus_engine_proxy_new_internal() SIGTRAP + +* Fri May 15 2020 Takao Fujiwara - 1.5.22-6 +- Update HEAD.patch to make parallel dict build +- Update 1385349-segv-bus-proxy.patch +- Resolves #1767976 #1601577 #1771238 #1797120 + +* Wed Apr 22 2020 Takao Fujiwara - 1.5.22-5 +- Update ibus-desktop-testing-runner for su command + +* Wed Mar 11 2020 Adam Williamson - 1.5.22-4 +- Update #2195 patch backport (it was revised upstream) + +* Wed Mar 11 2020 Adam Williamson - 1.5.22-3 +- Backport PR #2195 to fix ibus with GNOME 3.36.0 + +* Tue Feb 25 2020 Takao Fujiwara - 1.5.22-2 +- Bug 1805634 - Add a conditional requires ibus-gtk2 with gtk2 + +* Thu Feb 13 2020 Takao Fujiwara - 1.5.22-1 +- Bump to 1.5.22 +- Delete package depending ibus-gtk2 + +* Thu Feb 13 2020 Takao Fujiwara - 1.5.21-9 +- Bug 1785276 - Fix abrt without XDG_CACHE_HOME/ibus +- Bug 1788754 - Fix abrt with NULL output of compose keys +- Bug 1787732 - Fix abrt in exit handlers in ibus-x11 +- Bug 1795499 - Fix abrt in bus monitor handlers when ibus-daemon restarts +- Fix greek cases +- Increase sleep 3 to wait for running ibus-config in CI. + +* Wed Jan 29 2020 Fedora Release Engineering - 1.5.21-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Dec 26 2019 Takao Fujiwara - 1.5.21-7 +- Revise the previous Hangul patch + +* Tue Dec 24 2019 Takao Fujiwara - 1.5.21-6 +- Fix to connect button-press-event for Hangul +- Delete a previous workaround targeted to firefox only for Hangul + +* Wed Dec 11 2019 Takao Fujiwara - 1.5.21-5 +- Add RHEL code reviews +- Fix Hangul preedit with mouse click + +* Mon Nov 18 2019 Takao Fujiwara - 1.5.21-4 +- Replace push with cd for Posix SH +- Use XDG_CONFIG_HOME for Unix socket directory +- Fix deprecated APIs +- Fix restart crash with inotify read() +- Fix Bug 1658187 exit `ibus emoji` with Escape key +- Add fr(bepo_afnor) keymap +- Add file list in registry file for Silverblue + +* Fri Oct 04 2019 Takao Fujiwara - 1.5.21-3 +- Fix to allocate compose output buffer with more than two chars + +* Fri Sep 13 2019 Takao Fujiwara - 1.5.21-2 +- Fix #1751940 - CVE-2019-14822 GDBusServer peer authorization + +* Fri Aug 23 2019 Takao Fujiwara - 1.5.21-1 +- Bump to 1.5.21 + +* Mon Aug 19 2019 Miro Hrončok - 1.5.20-11 +- Rebuilt for Python 3.8 + +* Tue Aug 13 2019 Takao Fujiwara - 1.5.20-10 +- Update ibus-desktop-testing-runner not to fail CI. + +* Tue Aug 06 2019 Takao Fujiwara - 1.5.20-9 +- ibus-daemon always will exits with parent's death. + +* Wed Jul 31 2019 Takao Fujiwara - 1.5.20-8 +- Fix a wrong result in direct testing instead of GNOME desktop testing + +* Mon Jul 29 2019 Takao Fujiwara - 1.5.20-7 +- Add CI + +* Fri Jul 26 2019 Takao Fujiwara - 1.5.20-6 +- Update ibus-HEAD.patch from upstream + Integrate a new compose feature + Generate ibus-tests and ibus-desktop-testing sub packages + +* Thu Jul 25 2019 Fedora Release Engineering - 1.5.20-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Mon May 13 2019 Takao Fujiwara - 1.5.20-4 +- Keep preedit cursor_pos and visible in clearing preedit text for Hangul + +* Tue Apr 23 2019 Takao Fujiwara - 1.5.20-3 +- Fix i18n ibus-setup +- Provide ibus.its + +* Tue Apr 16 2019 Takao Fujiwara - 1.5.20-2 +- Rebuilt for unicode-ucd- 12.0.0 + +* Thu Feb 28 2019 Takao Fujiwara - 1.5.20-1 +- Bumped to 1.5.20 + +* Thu Feb 28 2019 Pete Walter - 1.5.19-18 +- Update wayland deps + +* Fri Feb 22 2019 Takao Fujiwara - 1.5.19-17 +- Delete dconf dependencies and gettext migration for gschema.xml file +- Delete Super-space notification in initial login in non-GNOME desktops + +* Tue Feb 05 2019 Takao Fujiwara - 1.5.19-16 +- Resolves: #1671286 wrong mutex + +* Mon Feb 04 2019 Kalev Lember - 1.5.19-15 +- Update BRs for vala packaging changes +- Co-own vala and gir directories + +* Fri Feb 01 2019 Fedora Release Engineering - 1.5.19-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Jan 29 2019 Takao Fujiwara - 1.5.19-13 +- Resolves: #1470673 Replace assert with warning for .XCompose +- Update APIs for Hangul preedit in Flatpak +- Fix Atom and Slack for Flatpak +- Resolves: #1663528 Check if the mutex is not unlocked before the clear + +* Thu Dec 20 2018 Takao Fujiwara - 1.5.19-12 +- Use ISO 639-3 names instead of 639 +- Connect to button-press-event only with IBUS_ENGINE_PREEDIT_COMMIT + +* Wed Dec 12 2018 Takao Fujiwara - 1.5.19-11 +- Fix SEGV on mouse clicks when ibus-daemon not running + +* Mon Dec 10 2018 Takao Fujiwara - 1.5.19-10 +- Always reset and clear preedit on mouse click +- Show compose preedit with custom compose file +- Clear preedit in IBusEngineSimple with focus changes +- Obsolete ibus-xkbc since Fedora 30 + +* Thu Nov 15 2018 Takao Fujiwara - 1.5.19-9 +- Detect mouse click to commit Hangul preedit +- Do not delete IBUS_CAP_SURROUNDING_TEXT + +* Tue Nov 06 2018 Takao Fujiwara - 1.5.19-8 +- Reverted noarch for devel-docs by mistake + +* Wed Oct 31 2018 Takao Fujiwara - 1.5.19-7 +- RHEL code reviews + +* Fri Oct 26 2018 Takao Fujiwara - 1.5.19-6 +- dbus-x11 is not required in Fedora 30 +- Add Conflicts for Fedora 28 + +* Tue Oct 23 2018 Takao Fujiwara - 1.5.19-5 +- Use __python3 instead of python3 +- Delete Requires ibus in ibus-gtk* for Flatpak + +* Fri Sep 14 2018 Takao Fujiwara - 1.5.19-4 +- Fix Bug SEGV Choose an emoji by mouse from the emoji category list + +* Thu Aug 30 2018 Takao Fujiwara - 1.5.19-3 +- Fix Bug 1618682 - SEGV with ASCII on emojier in Wayland +- Support Shift-Space on emojier preedit +- Do not move Emojier popup with the active candidate in Xorg + +* Wed Aug 22 2018 Takao Fujiwara - 1.5.19-2 +- Do not clear Unicode data when emoji annotation lang is changed + +* Wed Aug 08 2018 Takao Fujiwara - 1.5.19-1 +- Bumped to 1.5.19 + +* Mon Aug 06 2018 Takao Fujiwara - 1.5.18-14 +- Fixed Man page scan results for ibus +- Added IBUS_DISCARD_PASSWORD env variable for password dialog in firefox +- Added history annotation for previous emojis + +* Tue Jul 24 2018 Takao Fujiwara - 1.5.18-13 +- Deleted deprecated g_mem_* APIs + +* Mon Jul 23 2018 Takao Fujiwara - 1.5.18-12 +- Rebuilt with RHEL code reviews + +* Fri Jul 13 2018 Fedora Release Engineering - 1.5.18-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jul 02 2018 Miro Hrončok - 1.5.18-10 +- Rebuilt for Python 3.7 + +* Fri Jun 29 2018 Takao Fujiwara - 1.5.18-9 +- Do not use combined characters on preedit for compose keys +- Fixed an infinite loop of extension preedit with xterm + +* Wed Jun 27 2018 Takao Fujiwara - 1.5.18-8 +- Enable preedit for compose keys +- Fix SEGV in panel_binding_parse_accelerator + +* Wed Jun 20 2018 Takao Fujiwara - 1.5.18-7 +- Moved input focus on Emojier to engines' preedit +- Removed ibus-xx-emoji-harfbuzz.patch not to change session emoji font + +* Tue Jun 19 2018 Miro Hrončok - 1.5.18-6 +- Rebuilt for Python 3.7 + +* Mon May 07 2018 Takao Fujiwara - 1.5.18-5 +- Disabled python2 since RHEL8 +- Run make check in %%check except for GUI testings +- Fixed Bug 1574855 - [abrt] ibus: ibus_engine_filter_key_event() + +* Fri Mar 30 2018 Takao Fujiwara - 1.5.18-4 +- Fixed Bug 1554714 - improve order of unicode matches + +* Thu Mar 15 2018 Takao Fujiwara - 1.5.18-3 +- Fixed Bug 1554813 - Enter key on numpad in Emojier + +* Fri Mar 09 2018 Takao Fujiwara - 1.5.18-2 +- Rebuilt for cldr-emoji-annotation-32.90.0_1 and unicode-emoji-10.90.20180207 + +* Fri Mar 02 2018 Takao Fujiwara - 1.5.18-1 +- Bumped to 1.5.18 + +* Wed Feb 28 2018 Iryna Shcherbina - 1.5.17-11 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Tue Feb 27 2018 Takao Fujiwara - 1.5.17-10 +- Disabled panel extension for gdm user +- Enabled panel extension in Wayland + +* Wed Feb 21 2018 Takao Fujiwara - 1.5.17-9 +- Added panel extension for emoji keybinding not to depen on desktops +- Showed Unicode code points on Unicode name list + +* Tue Feb 13 2018 Igor Gnatenko - 1.5.17-8 +- Remove useless requires + +* Tue Feb 06 2018 Takao Fujiwara - 1.5.17-7 +- Added Unicode typing on Emojier + +* Sat Feb 03 2018 Igor Gnatenko - 1.5.17-6 +- Switch to %%ldconfig_scriptlets + +* Fri Jan 19 2018 Takao Fujiwara - 1.5.17-5 +- Rebuilt for scriptlets + +* Wed Jan 17 2018 Takao Fujiwara - 1.5.17-4 +- Added DBus filtering + +* Sat Jan 06 2018 Igor Gnatenko - 1.5.17-3 +- Remove obsolete scriptlets + +* Fri Jan 05 2018 Igor Gnatenko - 1.5.17-2 +- Remove obsolete scriptlets + +* Sun Oct 22 2017 Takao Fujiwara - 1.5.17-1 +- Bumped to 1.5.17 + +* Thu Sep 21 2017 Takao Fujiwara - 1.5.16-11 +- Copy ibusimcontext.c +- Fix Super-space in Plasma after ibus exit + +* Wed Sep 20 2017 Takao Fujiwara - 1.5.16-10 +- Fix Bug 1490733 Emojier takes wrong fonts + +* Thu Sep 14 2017 Takao Fujiwara - 1.5.16-9 +- Fix scaling factor, mouse events on switcher, c-s-u on im-ibus, + propertypanel position and menu +- Add ibus-portal +- Move ibus-emoji-dialog.vapi in the build +- Fixed some SEGVs #1406699 #1432252 + +* Wed Aug 02 2017 Fedora Release Engineering - 1.5.16-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Mon Jul 31 2017 Florian Weimer - 1.5.16-7 +- Rebuild with binutils fix for ppc64le (#1475636) + +* Thu Jul 27 2017 Takao Fujiwara - 1.5.16-6 +- Fixed some SEGVs #1349148 #1385349 #1350291 #1368593 + Added 1385349-segv-bus-proxy.patch + +* Wed Jul 26 2017 Fedora Release Engineering - 1.5.16-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Jul 21 2017 Takao Fujiwara - 1.5.16-4 +- Fixed Bug 1471079 - SEGV of Emojier on de locale + +* Thu Jul 13 2017 Takao Fujiwara - 1.5.16-3 +- Enabled HarfBuzz rendering without Pango glyph calc for emoji + +* Mon May 29 2017 Takao Fujiwara - 1.5.16-2 +- Added ctrl-c,v,x for annotations and ctrl-shift-c for emoji +- Added Malay and Mongolian keymaps +- Made all emoji dicts to fully qualified + +* Mon May 15 2017 Takao Fujiwara - 1.5.16-1 +- Bumped to 1.5.16 + +* Tue May 09 2017 Takao Fujiwara - 1.5.15-8 +- Dropped nodejs-emojione-json and import unicode-emoji instead +- Created emoji tab in ibus-setup +- Set default emoji font size from gsettings in ibus emoji command +- Added an option of emoji partial match in ibus-setup +- Hid emoji variants by default +- Added ibus-emoji man page +- emoji favorites category is updated by selecting emoji + +* Thu Apr 13 2017 Takao Fujiwara - 1.5.15-7 +- Supported ibus emoji command on Wayland +- Changed modal dialog to modeless dialog + +* Wed Apr 05 2017 Takao Fujiwara - 1.5.15-6 +- Enabled unicode_alt in EmojiOne json file +- Enabled to type multiple code points on Emojier +- Fixed IBusEmojiDialog_1_0_gir_LIBS for --as-needed LDFLAGS + +* Mon Mar 27 2017 Takao Fujiwara - 1.5.15-5 +- Moved language setting on IBusEmojier to ibus-setup. +- Enabled strcasecmp to match emoji annotations. +- Added a build error message if emoji xml files are not found. + +* Wed Mar 15 2017 Takao Fujiwara - 1.5.15-4 +- Implemented Ctrl-[f|b|n|p|h|e|a|u] for cursor operations on emoji dialog +- Added XSetIOErrorHandler() for GNOME3 desktop + +* Mon Mar 13 2017 Takao Fujiwara - 1.5.15-3 +- Emoji dialog enhancements and bug fixes + Fixed ibus_emoji_dict_load() API. + Focus on emoji text entry by default + Removed internal text buffer and use Gtk.Entry buffer instead. + Implemented cursor left, right, home, end on emoji annotation preedit. + Show localized emoji description from tts in emoji xml. + +* Thu Mar 09 2017 Takao Fujiwara - 1.5.15-2 +- Added ibus-HEAD.patch to get upstream patches + Fixed ibus_emojier_run() SIGABRT with `ibus emoji` + Enhanced theme color on emoji candidates + +* Mon Mar 06 2017 Takao Fujiwara - 1.5.15-1 +- Bumped to 1.5.15 + +* Fri Feb 10 2017 Fedora Release Engineering - 1.5.14-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Jan 11 2017 Takao Fujiwara - 1.5.14-5 +- support scroll event in candidates panel +- Fixed Bug 1403985 - Emoji typing is enabled during Unicode typing +- Fixed Bug 1402494 - Font settings of ibus are ignored on non-Gnome + +* Mon Dec 19 2016 Miro Hrončok - 1.5.14-4 +- Rebuild for Python 3.6 + +* Thu Oct 06 2016 Takao Fujiwara - 1.5.14-3 +- Fixed Bug 1380675 - Emoji leaves the candidates of @laugh when @laughing +- Fixed Bug 1380690 - User is not able to select emojis from digit keys +- Fixed Bug 1380691 - PageUp PageDown buttons on emoji lookup not working + +* Fri Sep 09 2016 Takao Fujiwara - 1.5.14-2 +- Fixed radio button on PropertyPanel. +- Updated translations. + +* Fri Aug 05 2016 Takao Fujiwara - 1.5.14-1 +- Bump to 1.5.14 + +* Wed Jul 27 2016 Dan Horák - 1.5.13-6 +- enable Emoji only on arches providing nodejs functionality + +* Tue Jul 26 2016 Takao Fujiwara - 1.5.13-5 +- Bug 1359753 - Implement Emoji typing + +* Tue Jul 19 2016 Fedora Release Engineering - 1.5.13-4 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Mon Jun 27 2016 Takao Fujiwara - 1.5.13-3 +- Bug 1349732 - ibus not working at all in Gnome Wayland +- Add ibus service file +- Fix CSS color format and font size + +* Mon Mar 28 2016 Takao Fujiwara - 1.5.13-2 +- Bug 1319215 - Add Requires besides Requires(post) + +* Mon Feb 22 2016 Takao Fujiwara - 1.5.13-1 +- Bumped to 1.5.13 + +* Thu Feb 04 2016 Fedora Release Engineering - 1.5.12-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jan 20 2016 Takao Fujiwara - 1.5.12-1 +- Bumped to 1.5.12 + +* Tue Nov 10 2015 Fedora Release Engineering - 1.5.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 + +* Thu Jul 16 2015 Takao Fujiwara - 1.5.11-1 +- Bumped to 1.5.11 +- Deleted with_python2_override_pkg macro +- Added glib2-doc BR + +* Wed Jun 17 2015 Fedora Release Engineering - 1.5.10-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri May 22 2015 Takao Fujiwara - 1.5.10-5 +- Updated ibus-HEAD.patch + Fixed Bug 1224025 - IBus radio menu items does not work + +* Fri Apr 24 2015 Takao Fujiwara - 1.5.10-4 +- Bug 1217410 Updated ibus-xinput for KDE5. + +* Fri Apr 24 2015 Takao Fujiwara - 1.5.10-3 +- Updated ibus-HEAD.patch from upstream + Fixed to show shortcuts on ibus-setup. + Bug 1214271 Fixed to enable IME with GTK3 applications in wayland. + +* Thu Apr 02 2015 Takao Fujiwara - 1.5.10-2 +- Updated ibus-HEAD.patch from upstream + Added Swedish svdvorak + I18N engine longnames and descriptions on ibus-setup + Moved PropertyPanel at bottom right in KDE5 + Drew gray color on Handle PropertyPanel + Enabled ibus engine full path icon in KDE5 + Updated translations + +* Wed Feb 25 2015 Takao Fujiwara - 1.5.10-1 +- Bumped to 1.5.10 + +* Sat Feb 21 2015 Till Maas - 1.5.9-11 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Mon Feb 02 2015 Petr Viktorin - 1.5.9-10 +- Remove dependency on Python 2 from main package + +* Mon Feb 02 2015 Takao Fujiwara - 1.5.9-9 +- Updated ibus-HEAD.patch to fix #1187956 IBusRegistry segv. + +* Thu Dec 18 2014 Takao Fujiwara - 1.5.9-8 +- Updated ibus-HEAD.patch to fix #1175595 ibus-x11 freeze + +* Mon Dec 08 2014 Takao Fujiwara - 1.5.9-7 +- Added ibus-1136623-lost-by-another-focus.patch to fix #1136623 + +* Mon Dec 08 2014 Takao Fujiwara - 1.5.9-6 +- Updated ibus-xx-increase-timeout.patch to fix #1163722 +- Updated ibus-HEAD.patch for upstream #1747, #1748, #1753 + and gnome #703020, gnome #730628 + +* Wed Nov 12 2014 Takao Fujiwara - 1.5.9-5 +- rhbz#1161871 Added BR of python and python3 + +* Tue Oct 28 2014 Takao Fujiwara - 1.5.9-4 +- Updated ibus-HEAD.patch for upstream #1744. + +* Fri Oct 24 2014 Takao Fujiwara - 1.5.9-3 +- Added ibus-xx-increase-timeout.patch + +* Wed Oct 01 2014 Takao Fujiwara - 1.5.9-2 +- Updated ibus-HEAD.patch for rhbz#1136623. +- Added ibus-po-1.5.9-20141001.tar.gz + +* Tue Sep 16 2014 Takao Fujiwara - 1.5.9-1 +- Bumped to 1.5.9 + +* Sat Aug 16 2014 Fedora Release Engineering - 1.5.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Jul 24 2014 Takao Fujiwara - 1.5.8-1 +- Bumped to 1.5.8 +- Deleted ibus-810211-no-switch-by-no-trigger.patch +- Deleted ibus-541492-xkb.patch +- Deleted ibus-530711-preload-sys.patch +- Deleted ibus-xx-setup-frequent-lang.patch +- Deleted ibus-xx-f19-password.patch + +* Tue Jul 22 2014 Kalev Lember - 1.5.7-7 +- Rebuilt for gobject-introspection 1.41.4 + +* Mon Jul 14 2014 Takao Fujiwara - 1.5.7-6 +- Updated ibus-HEAD.patch from upstream. + Fixed ibus-setup SEGV when an engine is selected. + Fixed ibus-setup deprecated warnings with the latest python3-gobject. + Integrated the 'IBUS_SETUP_XID' environment variable for each engine setup. + Set prgname 'ibus-setup' for ibus-setup. + +* Mon Jul 07 2014 Takao Fujiwara - 1.5.7-5 +- Updated ibus-HEAD.patch from upstream. + Added pl(qwertz). + Fixed escape key with Ctrl-Shift-U. + Updated pt-br compose table from the latest xorg. + Do not sort ibus engines when they are saved by ibus-setup. + Updated jp IBusKeymap. + Added ibus reset-config and read-config sub-commands. + Update ibus(1) for read-config and reset-config. + +* Sat Jun 07 2014 Fedora Release Engineering - 1.5.7-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue May 27 2014 Kalev Lember - 1.5.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Tue May 20 2014 Takao Fujiwara - 1.5.7-2 +- Updated ibus-HEAD.patch for width of ibus-setup. + +* Wed Apr 30 2014 Takao Fujiwara - 1.5.7-1 +- Bumped to 1.5.7 + +* Mon Apr 21 2014 Takao Fujiwara - 1.5.6-3 +- Do not require gtk-doc in ibus-devel-docs + +* Fri Mar 28 2014 Takao Fujiwara - 1.5.6-2 +- Updated ibus-HEAD.patch for Czech (qwerty) keymap. + +* Thu Mar 06 2014 Takao Fujiwara - 1.5.6-1 +- Bumped to 1.5.6 +- Deleted ibus-xx-ctrl-space.patch + +* Fri Jan 31 2014 Takao Fujiwara - 1.5.5-2 +- Enabled python3 ibus-setup + +* Tue Jan 14 2014 Takao Fujiwara - 1.5.5-1 +- Bumped to 1.5.5 +- Deleted notify-python in Requires + +* Fri Oct 04 2013 Takao Fujiwara - 1.5.4-2 +- Added ibus-HEAD.patch to sync upstream. + +* Fri Sep 20 2013 Takao Fujiwara - 1.5.4-1 +- Bumped to 1.5.4 +- Added ibus.conf.5 +- Added ibus-xkb-1.5.0.tar.gz for po files. +- Added ibus-xx-f19-password.patch for back compatibility. +- Added ibus-wayland in f20 or later. + +* Fri Jul 26 2013 Takao Fujiwara - 1.5.3-1 +- Bumped to 1.5.3 +- Deleted ibus-xx-g-s-disable-preedit.patch as EOL. +- Deleted ibus-gjs as EOL. +- Removed imsettings-gnome, im-chooser, libgnomekbd dependencies. + +* Thu Jul 11 2013 Takao Fujiwara - 1.5.2-8 +- Updated ibus-HEAD.patch to delete pyxdg dependencies. + +* Mon Jun 17 2013 Takao Fujiwara - 1.5.2-7 +- Bug 972328 - Deleted ibus-panel + +* Mon Jun 17 2013 Takao Fujiwara - 1.5.2-6 +- Bug 972328 - Bring back the dependency of ibus-setup. + +* Tue Jun 11 2013 Takao Fujiwara - 1.5.2-5 +- Removed dependencies of ibus-setup and ibus-pygtk2 + +* Wed Jun 05 2013 Takao Fujiwara - 1.5.2-4 +- Updated ibus-HEAD.patch for upstream. +- Added ibus-xx-1.5.2.patch until 1.5.3 will be released. +- Added ibus-xx-ctrl-space.patch for back compatible triggers. + +* Wed May 01 2013 Takao Fujiwara - 1.5.2-3 +- Updated ibus-HEAD.patch for upstream. +- Deleted ibus-947318-reconnect-gtk-client.patch + +* Sun Apr 21 2013 Takao Fujiwara - 1.5.2-2 +- Separate python files in f19 or later. + +* Thu Apr 18 2013 Takao Fujiwara - 1.5.2-1 +- Bumped to 1.5.2 +- Created noarch packages for python files due to .pyc and .pyo. +- Added man pages. + +* Mon Feb 18 2013 Takao Fujiwara - 1.5.1-3 +- Copied gtk2 module to gtk3 one. + +* Thu Jan 31 2013 Takao Fujiwara - 1.5.1-2 +- Updated ibus-530711-preload-sys.patch. Fixes #904799 + +* Tue Jan 08 2013 Takao Fujiwara - 1.5.1-1 +- Bumped to 1.5.1 +- Bumped to ibus-gjs 3.4.1.20130115 for f17 +- Removed ibus-xx-no-use.diff + +* Fri Dec 14 2012 Takao Fujiwara - 1.4.99.20121109-9 +- Updated ibus-xx-no-use.diff not to use variant.dup_strv() + +* Fri Dec 07 2012 Takao Fujiwara - 1.4.99.20121109-8 +- Resolves #869584 - Removed libgnomekbd dependency in f18. + +* Fri Nov 30 2012 Takao Fujiwara - 1.4.99.20121109-7 +- Set time stamp of ibus/_config.py + +* Fri Nov 30 2012 Takao Fujiwara - 1.4.99.20121109-6 +- Set time stamp of ibus/_config.py + +* Fri Nov 30 2012 Takao Fujiwara - 1.4.99.20121109-5 +- Updated spec file to work witout pkgconfig. + +* Tue Nov 27 2012 Takao Fujiwara - 1.4.99.20121109-4 +- Added comment lines for patches. + +* Tue Nov 27 2012 Takao Fujiwara - 1.4.99.20121109-3 +- Fixed misc issues. + +* Thu Oct 11 2012 Takao Fujiwara - 1.4.99.20121109-2 +- Obsoleted ibus-gnome3 + +* Thu Oct 11 2012 Takao Fujiwara - 1.4.99.20121109-1 +- Bumped to 1.4.99.20121109 +- Removed im-chooser, imsettings-gnome, gnome-icon-theme-symbolic + dependencies in f18 because ibus gnome integration is done. + Use ibus-keyboard instead of input-keyboard-symbolic. +- Disabled ibus-gjs build because of ibus gnome integration. + +* Thu Oct 11 2012 Takao Fujiwara - 1.4.99.20121006-2 +- Updated ibus-HEAD.patch to fix typo in data/dconf/profile/ibus + +* Thu Oct 11 2012 Takao Fujiwara - 1.4.99.20121006-2 +- Updated ibus-HEAD.patch to fix typo in data/dconf/profile/ibus + +* Sat Oct 06 2012 Takao Fujiwara - 1.4.99.20121006-1 +- Bumped to 1.4.99.20121006 +- Removed ibus-xx-segv-reg-prop.patch + +* Fri Sep 14 2012 Takao Fujiwara - 1.4.99.20120914-2 +- Added ibus-xx-segv-reg-prop.patch to avoid segv + +* Fri Sep 14 2012 Takao Fujiwara - 1.4.99.20120914-1 +- Bumped to 1.4.99.20120914 + +* Thu Sep 06 2012 Takao Fujiwara - 1.4.99.20120822-2 +- Updated ibus-530711-preload-sys.patch +- Updated ibus-541492-xkb.patch +- Updated ibus-xx-no-use.diff + Fixed Bug 854161 - not able to add keymap with ibus-setup + +* Wed Aug 22 2012 Takao Fujiwara - 1.4.99.20120822-1 +- Bumped to 1.4.99.20120822 +- Bumped to ibus-gjs 3.4.1.20120815 + Fixed Bug 845956 - ibus backward trigger key is not customized + Fixed Bug 844580 - ibus-dconf does not load the system gvdb +- Separated ibus-810211-no-switch-by-no-trigger.patch from ibus-HEAD.patch + +* Fri Jul 27 2012 Fedora Release Engineering - 1.4.99.20120712-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Thu Jul 19 2012 Takao Fujiwara - 1.4.99.20120712-2 +- Updated ibus-HEAD.patch + Support dconf 0.13.4 + +* Tue Jul 17 2012 Takao Fujiwara - 1.4.99.20120712-1 +- Bumped to 1.4.99.20120712 +- Removed ibus-xx-branding-switcher-ui.patch as upstreamed. + +* Fri Jun 8 2012 Matthias Clasen - 1.4.99.20120428-3 +- Rebuild against new libgnomekbd + +* Fri Apr 27 2012 Takao Fujiwara - 1.4.99.20120428-2 +- Updated ibus-HEAD.patch +- Updated ibus-541492-xkb.patch +- Updated ibus-xx-branding-switcher-ui.patch + Fixed Bug 810211 - Cancel Control + space pressing Control key. +- Updated ibus-xx-no-use.diff + Enabled to customize trigger keys with non-modifier trigger keys. + +* Fri Apr 27 2012 Takao Fujiwara - 1.4.99.20120428-1 +- Bumped to 1.4.99.20120428 + Fixed Bug 799571 - no IME list at the session login. + Fixed Bug 810415 - ibus does not handle Ctrl+space with BUTTON_PRESS. +- Bumped to ibus-gjs 3.4.1.20120428 + Fixed Bug 802052 - no modifiers trigger keys. + Fixed Bug 803244 - IME switch Ctrl+space not working on shell text entry. + +* Tue Apr 24 2012 Kalev Lember - 1.4.99.20120317-4 +- Update the dconf and icon cache rpm scriptlets + +* Wed Apr 18 2012 Takao Fujiwara - 1.4.99.20120317-3 +- Added a RHEL flag. + +* Tue Mar 27 2012 Takao Fujiwara - 1.4.99.20120317-2 +- Bumped to ibus-gjs 3.3.92.20120327 + +* Sat Mar 17 2012 Takao Fujiwara - 1.4.99.20120317-1 +- Bumped to 1.4.99.20120317 + Fixed Bug 718668 - focus move is slow with ibus-gnome3 + Fixed Bug 749497 - Enhance IME descriptions in status icon active menu +- Bumped to ibus-gjs 3.3.90.20120317 +- Added ibus-xx-no-use.diff + Fixed Bug 803260 - Disable non-global input method mode +- Updated ibus-HEAD.patch + Fixed Bug 803250 - ibus lookup window font customization + Fixed Bug 803177 - language id on ibus-ui-gtk3 switcher +- Update ibus-530711-preload-sys.patch + Fixed Bug 797023 - port preload engines + +* Thu Mar 08 2012 Takao Fujiwara - 1.4.99.20120303-3 +- Bumped to ibus-gjs 3.3.90.20120308 to work with gnome-shell 3.3.90 +- Fixed Bug 786906 - Added ifnarch ppc ppc64 s390 s390x +- Updated ibus-HEAD.patch + Fixed Bug 800897 - After doing "ctrl+space", ibus tray icon freezes + +* Mon Mar 05 2012 Takao Fujiwara - 1.4.99.20120303-2 +- Added ibus-HEAD.patch to fix python library to load libibus.so. + +* Sun Mar 04 2012 Takao Fujiwara - 1.4.99.20120303-1 +- Bumped to 1.4.99.20120303 + Fixed Bug 796070 - ibus-setup without no ibus-daemon + +* Wed Feb 08 2012 Takao Fujiwara - 1.4.99.20120203-3 +- Fixed ibus-setup on C locale +- Fixed to show no registered engines from g-c-c. +- Enabled Alt_R keybinding on ko locales for ibus gtk only. + +* Fri Feb 03 2012 Takao Fujiwara - 1.4.99.20120203-1 +- Updated to 1.4.99.20120203 +- Removed ibus-xx-bridge-hotkey.patch +- Updated ibus-541492-xkb.patch to use libgnomekbd. +- Updated ibus-xx-setup-frequent-lang.patch for 1.4.99.20120203 + +* Wed Jan 04 2012 Takao Fujiwara - 1.4.0-17 +- Added ibus-771115-property-compatible.patch for f16 + Fixed Bug 771115 - IBusProperty back compatibility. + +* Fri Dec 30 2011 Takao Fujiwara - 1.4.0-16 +- Enhanced ibus-gnome3 shell lookup window. +- Updated ibus-HEAD.patch from upstream + Fixed Bug 769135 - ibus-x11 SEGV in _process_key_event_done. +- Updated ibus-541492-xkb.patch + Fixed Bug 757889 - ibus-setup SEGV without active engine. + Fixed Bug 760213 - ibus-setup saves XKB variants correctly. + Fixed Bug 769133 - ibus-engine-xkb returns FALSE for ASCII typings. +- Updated ibus-xx-bridge-hotkey.patch for an enhancement. + +* Wed Nov 30 2011 Takao Fujiwara - 1.4.0-14 +- Enabled dconf. +- Updated ibus-HEAD.patch + Fixed Bug 618229 - engine setup buton on ibus-setup. +- Removed ibus-711632-fedora-fallback-icon.patch as upstreamed. +- Updated ibus-xx-bridge-hotkey.patch + Removed Enable/Disable buttons on ibus-setup + +* Fri Nov 18 2011 Takao Fujiwara - 1.4.0-11 +- Updated ibus-541492-xkb.patch + Fixed Bug 750484 - support reloading Xmodmap +- Updated ibus-HEAD.patch + Fixed Bug 753781 - ibus-x11 needs async for hangul ibus_commit_text. + +* Fri Nov 04 2011 Takao Fujiwara - 1.4.0-10 +- Updated ibus-xx-bridge-hotkey.patch for f16 + Fixed no XKB languages from layout only. e.g. in(eng). +- Updated ibus-541492-xkb.patch + Fixed not to show 'eng' on GUI for in(eng). + +* Wed Nov 02 2011 Takao Fujiwara - 1.4.0-9 +- Updated ibus-HEAD.patch + Fixed prev/next keys without global engine. +- Updated ibus-xx-bridge-hotkey.patch for f16 + Fixed Bug 747902 - mouse and ctrl+space not working + Fixed Bug 749770 - IME hotkey after Control + Space +- Updated ibus-711632-fedora-fallback-icon.patch + Fixed Bug 717831 - use old icon for desktops other than gnome + +* Fri Oct 28 2011 Takao Fujiwara - 1.4.0-8 +- Updated ibus-xx-bridge-hotkey.patch for f16 +- Fixed Bug 747902 - mouse and ctrl+space not working + +* Wed Oct 26 2011 Fedora Release Engineering - 1.4.0-6 +- Rebuilt for glibc bug#747377 + +* Fri Oct 21 2011 Takao Fujiwara - 1.4.0-5 +- Fixed Bug 747845 - ibus icon cannot open menu item on gnome-shell + +* Thu Oct 20 2011 Takao Fujiwara - 1.4.0-4 +- Fixed Bug 746869 - no keymaps if the XKB has no group and no variant + +* Fri Sep 30 2011 Takao Fujiwara - 1.4.0-3 +- Rebuilt for f16 gnome-shell 3.2 and gjs 1.30 + +* Wed Sep 28 2011 Takao Fujiwara - 1.4.0-2 +- Updated to 1.4.0 +- Updated ibus-gjs 3.0.2.20110928 for f15. +- Updated ibus-gjs 3.2.0.20110928 for f16. (#740588) +- Updated ibus-530711-preload-sys.patch + Fixed not to show duplicated engine names in setup treeview (#740447) +- Updated bus-gjs-xx-gnome-shell-3.1.4-build-failure.patch for f16. +- Updated ibus-xx-bridge-hotkey.patch + Fixed a XKB configuration without the input focus for f16 (#739165) + Fixed not to show null strings in case of no variants (#738130) + +* Tue Sep 13 2011 Takao Fujiwara - 1.3.99.20110817-5 +- Updated ibus-gjs 3.1.91.20110913 for f16. + +* Thu Sep 08 2011 Takao Fujiwara - 1.3.99.20110817-4 +- Updated ibus-gjs 3.1.91.20110908 and 3.0.2.20110908 for gnome-shell. + Fixed preedit active segments on gnome-shell and X11 apps. +- Added ibus-xx-g-s-disable-preedit.patch + Disabled preedit on gnome-shell for a workaround. +- Updated ibus.spec + Fixed Bug 735879 pre/postun scripts + +* Thu Sep 01 2011 Takao Fujiwara - 1.3.99.20110817-3 +- Fixed Bug 700472 Use a symbol icon instead of an image icon. +- Updated ibus-HEAD.patch for upstream. +- Removed ibus-435880-surrounding-text.patch as upstream. +- Added ibus-711632-fedora-fallback-icon.patch + Fixed SEGV with no icon in oxygen-gtk icon theme. +- Added ibus-xx-bridge-hotkey.patch + Triaged Bug 707370 SetEngine timeout + Fixed Bug 731610 Keep IM state when text input focus changes +- Added transitional ibus-gnome3 package. + Fixed Bug 718110 Use a shell icon instead of pygtk2 icon. + +* Thu May 26 2011 Takao Fujiwara - 1.3.99.20110419-1 +- Updated to 1.3.99.20110419 +- Added ibus-HEAD.patch + Fixed Bug 697471 - ibus-gconf zombie when restart ibus from ibus panel. +- Updated ibus-541492-xkb.patch + Fixed Bug 701202 - us(dvorak) does not show up in list + Updated ibus-1.0.pc for ibus-xkb + Showed XKB variant descriptions only without layout descriptions. +- Updated ibus-xx-setup-frequent-lang.patch + Updated UI strings + +* Tue Apr 19 2011 Takao Fujiwara - 1.3.99.20110408-1 +- Updated to 1.3.99.20110408 + Fixed Bug 683484 - Timed out SetEngine when select an engine from panel. + Fixed Bug 657165 - IBus for gnome-shell for Fedora 15. +- Upstreamed ibus-657165-panel-libs.patch +- Removed ibus-675503-gnome-shell-workaround.patch +- Added ibus-xx-setup-frequent-lang.patch +- Updated ibus-541492-xkb.patch + Fixed Bug 696481 - no the variant maps without language codes +- Added dependency of imsettings-gnome. + Fixed Bug 696510 - need a dependency in ibus-gtk3 for imsettings-gnome + +* Thu Mar 10 2011 Takao Fujiwara - 1.3.99.20110228-1 +- Updated to 1.3.99.20110228 +- Integrated the part of gjs in Bug 657165 ibus for gnome-shell. + Added ibus-657165-panel-libs.patch + Added gnome-shell-ibus-plugins-20110304.tar.bz2 +- Fixed Bug 675503 - a regression in sync mode + Added ibus-675503-gnome-shell-workaround.patch until gnome-shell is updated. +- Fixed Bug 677856 - left ibus snooper when im client is switched. +- Fixed Bug 673047 - abrt ibus_xkb_get_current_layout for non-XKB system + Updated ibus-541492-xkb.patch + +* Wed Feb 09 2011 Fedora Release Engineering - 1.3.99.20110127-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Feb 04 2011 Takao Fujiwara - 1.3.99.20110127-1 +- Updated to 1.3.99.20110127 +- Updated ibus-HEAD.patch from upstream. + +* Wed Jan 26 2011 Takao Fujiwara - 1.3.99.20110117-1 +- Updated to 1.3.99.20110117 +- Fixed Bug 666427 - ibus requires dbus-x11 +- Fixed Bug 670137 - QT_IM_MODULE=xim in ibus.conf without ibus-qt + +* Thu Dec 09 2010 Takao Fujiwara - 1.3.99.20101202-1 +- Updated to 1.3.99.20101202 +- Added ibus-530711-preload-sys.patch + Fixed Bug 530711 - Reload preloaded engines by login + +* Fri Oct 29 2010 Takao Fujiwara - 1.3.99.20101028-1 +- Updated to 1.3.99.20101028 +- Integrated gdbus +- Merged notify.patch into ibus-HEAD.patch + +* Fri Oct 22 2010 Takao Fujiwara - 1.3.8-1 +- Updated to 1.3.8 +- Added ibus-541492-xkb.patch + Fixes Bug 541492 - ibus needs to support some xkb layout switching +- Added ibus-435880-surrounding-text.patch + Fixes Bug 435880 - ibus-gtk requires surrounding-text support +- Added ibus-xx-workaround-gtk3.patch + Workaround for f14 http://koji.fedoraproject.org/koji/taskinfo?taskID=2516604 + +* Mon Aug 23 2010 Takao Fujiwara - 1.3.7-1 +- Updated to 1.3.7 + +* Wed Jul 28 2010 Mamoru Tasaka - 1.3.6-5 +- Rebuild against python 2.7 + +* Thu Jul 22 2010 Jens Petersen - 1.3.6-4 +- keep bumping ibus-gtk obsoletes to avoid upgrade problems + +* Wed Jul 21 2010 David Malcolm - 1.3.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Thu Jul 15 2010 Colin Walters - 1.3.6-2 +- Rebuild with new gobject-introspection + +* Tue Jul 06 2010 Takao Fujiwara - 1.3.6-1 +- Update to 1.3.6 + +* Wed Jun 30 2010 Jens Petersen +- version the ibus-gtk obsolete and provides +- drop the old redundant ibus-qt obsoletes + +* Mon Jun 28 2010 Matthias Clasen - 1.3.5-3 +- Rebuild against newer gtk + +* Tue Jun 22 2010 Colin Walters - 1.3.5-2 +- Bump Release to keep ahead of F-13 + +* Sat Jun 12 2010 Peng Huang - 1.3.5-1 +- Update to 1.3.5 +- Support gtk3, gobject-introspection and vala. + +* Sat May 29 2010 Peng Huang - 1.3.4-2 +- Update to 1.3.4 + +* Sat May 29 2010 Peng Huang - 1.3.4-1 +- Update to 1.3.4 + +* Tue May 04 2010 Peng Huang - 1.3.3-1 +- Update to 1.3.3 + +* Sun May 02 2010 Peng Huang - 1.3.2-3 +- Embedded language bar in menu by default. +- Fix bug 587353 - [abrt] crash in ibus-1.3.2-2.fc12 + +* Sat Apr 24 2010 Peng Huang - 1.3.2-2 +- Add requires librsvg2 +- Update ibus-HEAD.patch: Update po files and and setting + +* Wed Apr 21 2010 Peng Huang - 1.3.2-1 +- Update to 1.3.2 +- Fix bug 583446 - [abrt] crash in ibus-1.3.1-1.fc12 + +* Mon Apr 05 2010 Peng Huang - 1.3.1-1 +- Update to 1.3.1 + +* Fri Mar 26 2010 Peng Huang - 1.3.0-3 +- Update ibus-HEAD.patch +- Fix bug - some time panel does not show candidates. +- Update some po files + +* Mon Mar 22 2010 Peng Huang - 1.3.0-2 +- Does not check glib micro version in ibus im module. + +* Mon Mar 22 2010 Peng Huang - 1.3.0-1 +- Update to 1.3.0 + +* Tue Feb 02 2010 Peng Huang - 1.2.99.20100202-1 +- Update to 1.2.99.20100202 + +* Mon Jan 11 2010 Peng Huang - 1.2.0.20100111-1 +- Update to 1.2.0.20100111 + +* Fri Dec 25 2009 Peng Huang - 1.2.0.20091225-1 +- Update to 1.2.0.20091225 +- Fix bug 513895 - new IME does not show up in ibus-setup +- Fix bug 531857 - applet order should correspond with preferences order +- Fix bug 532856 - should not list already added input-methods in Add selector + +* Tue Dec 15 2009 Peng Huang - 1.2.0.20091215-1 +- Update to 1.2.0.20091215 + +* Thu Dec 10 2009 Peng Huang - 1.2.0.20091204-2 +- Fix rpmlint warnings and errors. + +* Fri Dec 04 2009 Peng Huang - 1.2.0.20091204-1 +- Update to 1.2.0.20091204 +- Fix Bug 529920 - language panel pops up on the wrong monitor +- Fix Bug 541197 - Ibus crash + +* Tue Nov 24 2009 Peng Huang - 1.2.0.20091124-1 +- Update to 1.2.0.20091124 +- Update some translations. +- Fix bug 538147 - [abrt] crash detected in firefox-3.5.5-1.fc12 + +* Sat Oct 24 2009 Peng Huang - 1.2.0.20091024-1 +- Update to 1.2.0.20091024 + +* Wed Oct 14 2009 Peng Huang - 1.2.0.20091014-2 +- Update to 1.2.0.20091014 +- Change ICON in ibus.conf + +* Sun Sep 27 2009 Peng Huang - 1.2.0.20090927-1 +- Update to 1.2.0.20090927 + +* Tue Sep 15 2009 Peng Huang - 1.2.0.20090915-1 +- Update to 1.2.0.20090915 +- Fix bug 521591 - check if the icon filename is a real file before trying to open it +- Fix bug 522310 - Memory leak on show/hide +- Fix bug 509518 - ibus-anthy should only override to jp layout for kana input + +* Fri Sep 04 2009 Peng Huang - 1.2.0.20090904-2 +- Refresh the tarball. + +* Fri Sep 04 2009 Peng Huang - 1.2.0.20090904-1 +- Update to 1.2.0.20090904 + +* Mon Aug 31 2009 Peng Huang - 1.2.0.20090828-2 +- Change icon path in ibus.conf + +* Fri Aug 28 2009 Peng Huang - 1.2.0.20090828-1 +- Update to 1.2.0.20090828 +- Change the icon on systray. +- Fix segment fault in ibus_hotkey_profile_destroy +- Fix some memory leaks. + +* Wed Aug 12 2009 Peng Huang - 1.2.0.20090812-1 +- Update to 1.2.0.20090812 + +* Mon Aug 10 2009 Peng Huang - 1.2.0.20090807-4 +- Update ibus-HEAD.patch +- Fix Numlock problem. +- Fix some memory leaks. + +* Fri Aug 07 2009 Peng Huang - 1.2.0.20090807-2 +- Update ibus-HEAD.patch +- Fix bug 516154. + +* Fri Aug 07 2009 Peng Huang - 1.2.0.20090807-1 +- Update to 1.2.0.20090807 + +* Thu Aug 06 2009 Peng Huang - 1.2.0.20090806-1 +- Update to 1.2.0.20090806 +- Fix bug 515106 - don't install duplicate files + +* Tue Jul 28 2009 Peng Huang - 1.2.0.20090723-3 +- Update xinput-ibus: setup QT_IM_MODULE if the ibus qt input method plugin exists. + +* Fri Jul 24 2009 Fedora Release Engineering - 1.2.0.20090723-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 23 2009 Peng Huang - 1.2.0.20090723-1 +- Update to 1.2.0.20090723 +- Fix dead loop in ibus-gconf + +* Wed Jul 22 2009 Peng Huang - 1.2.0.20090722-1 +- Update to 1.2.0.20090722 + +* Sun Jul 19 2009 Peng Huang - 1.2.0.20090719-1 +- Update to 1.2.0.20090719 + +* Mon Jun 22 2009 Peng Huang - 1.2.0.20090617-1 +- Update to 1.2.0.20090617 + +* Fri Jun 12 2009 Peng Huang - 1.1.0.20090612-1 +- Update to 1.1.0.20090612 +- Fix bug 504942 - PageUp and PageDown do not work in candidate list +- Fix bug 491040 - Implememnt mouse selection in candidate list + +* Wed Jun 10 2009 Peng Huang - 1.1.0.20090609-1 +- Update to Update to 1.1.0.20090609 +- Fix bug 502414 - Implemented on-screen help facility +- Fix bug 502561 - iBus should show keymap name on iBus panel +- Fix bug 498043 - ibus Alt-grave trigger conflicts with openoffice.org +- Implemented API for setting labels for candidates in LookupTable + +* Sun May 31 2009 Peng Huang - 1.1.0.20090531-1 +- Update to Update to 1.1.0.20090531 + +* Tue May 26 2009 Peng Huang - 1.1.0.20090508-5 +- Update ibus-HEAD.patch. +- Show the default input method with bold text +- Add information text below input methods list + +* Mon May 25 2009 Peng Huang - 1.1.0.20090508-4 +- Update ibus-HEAD.patch. +- Fix bug 501211 - ibus-setup window should be raised if running or just stay on top/grab focus +- Fix bug 501640 - ibus should adds new IMEs at end of engine list not beginning +- Fix bug 501644 - [IBus] focus-out and disabled IME should hide language panel + +* Thu May 14 2009 Peng Huang - 1.1.0.20090508-2 +- Remove requires notification-daemon +- Fix bug 500588 - Hardcoded requirement for notification-daemon + +* Fri May 08 2009 Peng Huang - 1.1.0.20090508-1 +- Update to 1.1.0.20090508 +- Fix bug 499533 - [Indic] ibus should allow input in KDE using all supported Indic locales +- Fix bug 498352 - hotkey config table should list keys in same order as on main setup page +- Fix bug 497707 - ibus French translation update + +* Fri May 08 2009 Peng Huang - 1.1.0.20090423-3 +- Fix bug 498541 - ibus-libs should not contain devel file libibus.so + +* Tue May 05 2009 Peng Huang - 1.1.0.20090423-2 +- Fix bug 498141 - new ibus install needs gtk immodules +- Separate ibus document from ibus-devel to ibus-devel-docs + +* Thu Apr 23 2009 Peng Huang - 1.1.0.20090423-1 +- Update to ibus-1.1.0.20090423. +- Fix bug 497265 - [mai_IN] Maithili language name is not correct. +- Fix bug 497279 - IBus does not works with evolution correctly. +- Enhance authentication both in daemon & clients + +* Fri Apr 17 2009 Peng Huang - 1.1.0.20090417-1 +- Update to ibus-1.1.0.20090417. +- Fix bug 496199 - cannot remove Ctrl+Space hotkey with ibus-setup + +* Fri Apr 17 2009 Peng Huang - 1.1.0.20090413-4 +- Update ibus-HEAD.patch. +- Next Engine hotkey will do nothing if the IM is not active. + +* Wed Apr 15 2009 Peng Huang - 1.1.0.20090413-3 +- Update ibus-HEAD.patch. +- Fix bug 495431 - ibus Release modifier doesn't work with Alt +- Fix bug 494445 - ibus-hangul missing Hangul Han/En mode + (and Alt_R+release hotkey) +- Update te.po + +* Tue Apr 14 2009 Peng Huang - 1.1.0.20090413-2 +- Update ibus-HEAD.patch. +- Change the mode of /tmp/ibus-$USER to 0700 to improve security +- Change the mode of /tmp/ibus-$USER/socket-address to 0600 to improve security +- Update as.po + +* Mon Apr 13 2009 Peng Huang - 1.1.0.20090413-1 +- Update to ibus-1.1.0.20090413. +- Fix crash when restart the ibus-daemon +- Add some translations. + +* Tue Apr 07 2009 Peng Huang - 1.1.0.20090407-3 +- Update the tarball. +- Fix bug 494511 - ibus-gtk makes gnome-terminal abort + when a key is pressed + +* Tue Apr 07 2009 Peng Huang - 1.1.0.20090407-2 +- Update default hotkey settings. + +* Tue Apr 07 2009 Peng Huang - 1.1.0.20090407-1 +- Update to ibus-1.1.0.20090407. +- Fix bug 491042 - ibus default trigger hotkeys +- Fix bug 492929 - ibus-hangul can cause gtk app to lockup +- Fix bug 493701 - (ibus) imsettings disconnect/reconnect kills gtk app +- Fix bug 493687 - ibus-hangul should default to vertical candidate selection +- Fix bug 493449 - ibus broke Alt-F2 command auto-completion + +* Tue Mar 31 2009 Peng Huang - 1.1.0.20090331-1 +- Update to ibus-1.1.0.20090331. +- Fix bug 492956 - screws up keyboard input in firefox +- Fix bug 490143 - ibus issue with gnome-keyring + +* Sun Mar 29 2009 Peng Huang - 1.1.0.20090311-3 +- Recreate the ibus-HEAD.patch from upstream git source tree +- Fix bug 491999 - up/down arrow keys broken in xchat + +* Sat Mar 28 2009 Peng Huang - 1.1.0.20090311-2 +- Recreate the ibus-HEAD.patch from upstream git source tree. +- Fix bug 490009 - Deleting Next Engine shortcuts doesn't work +- Fix bug 490381 - Change "Next/Previous engine" labels + +* Wed Mar 11 2009 Peng Huang - 1.1.0.20090311-1 +- Update to ibus-1.1.0.20090311. +- Update setup ui follow GNOME Human Interface Guidelines 2.2 (#489497). + +* Fri Mar 6 2009 Peng Huang - 1.1.0.20090306-1 +- Update to ibus-1.1.0.20090306. + +* Tue Mar 3 2009 Jens Petersen +- use post for ibus-gtk requires glib2 + +* Mon Mar 2 2009 Jens Petersen - 1.1.0.20090225-2 +- drop the superfluous ibus-0.1 engine obsoletes +- move glib2 requires to gtk package + +* Wed Feb 25 2009 Peng Huang - 1.1.0.20090225-1 +- Update to ibus-1.1.0.20090225. +- Fix problems in %%post and %%postun scripts. +- Hide ibus & ibus preferences menu items. + +* Tue Feb 17 2009 Peng Huang - 1.1.0.20090211-10 +- Recreate the ibus-HEAD.patch from upstream git source tree. +- Put 'Select an input method' in engine select combobox (#485861). + +* Tue Feb 17 2009 Peng Huang - 1.1.0.20090211-9 +- Add requires im-chooser >= 1.2.5. + +* Tue Feb 17 2009 Peng Huang - 1.1.0.20090211-8 +- Recreate the ibus-HEAD.patch from upstream git source tree. +- Fix ibus-hangul segfault (#485438). + +* Mon Feb 16 2009 Peng Huang - 1.1.0.20090211-6 +- Recreate the ibus-HEAD.patch from upstream git source tree. +- The new patch fixes ibus-x11 segfault (#485661). + +* Sun Feb 15 2009 Peng Huang - 1.1.0.20090211-5 +- Recreate the ibus-HEAD.patch from upstream git source tree. + +* Sun Feb 15 2009 Peng Huang - 1.1.0.20090211-4 +- Remove gnome-python2-gconf from requires. + +* Fri Feb 13 2009 Peng Huang - 1.1.0.20090211-3 +- Update ibus-HEAD.patch, to fix bug 484652. + +* Fri Feb 13 2009 Peng Huang - 1.1.0.20090211-2 +- Add patch ibus-HEAD.patch, to update ibus to HEAD version. + +* Wed Feb 11 2009 Peng Huang - 1.1.0.20090211-1 +- Add --xim argument in xinput-ibus +- Add Obsoletes: ibus-qt <= 1.1.0 +- Move libibus.so.* to ibus-libs to make ibus multilib. +- Update to 1.1.0.20090211. + +* Thu Feb 05 2009 Peng Huang - 1.1.0.20090205-1 +- Update to 1.1.0.20090205. + +* Tue Feb 03 2009 Peng Huang - 0.1.1.20090203-1 +- Update to 0.1.1.20090203. + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.1.1.20081023-3 +- Rebuild for Python 2.6 + +* Wed Nov 19 2008 Peng Huang - 0.1.1.20081023-2 +- Move libibus-gtk.so from ibus.rpm to ibus-gtk.rpm to fix bug 472146. + +* Thu Oct 23 2008 Peng Huang - 0.1.1.20081023-1 +- Update to 0.1.1.20081023. + +* Thu Oct 16 2008 Peng Huang - 0.1.1.20081016-1 +- Update to 0.1.1.20081016. + +* Tue Oct 7 2008 Jens Petersen - 0.1.1.20081006-3 +- remove the empty %%doc file entries + +* Tue Oct 7 2008 Jens Petersen - 0.1.1.20081006-2 +- add xinputrc alternative when installing or uninstalling + +* Mon Oct 06 2008 Peng Huang - 0.1.1.20081006-1 +- Update to 0.1.1.20081006. + +* Sun Oct 05 2008 Peng Huang - 0.1.1.20081005-1 +- Update to 0.1.1.20081005. + +* Sat Oct 04 2008 Peng Huang - 0.1.1.20081004-1 +- Update to 0.1.1.20081004. + +* Wed Oct 01 2008 Peng Huang - 0.1.1.20081001-1 +- Update to 0.1.1.20081001. + +* Tue Sep 30 2008 Peng Huang - 0.1.1.20080930-1 +- Update to 0.1.1.20080930. + +* Tue Sep 23 2008 Peng Huang - 0.1.1.20080923-1 +- Update to 0.1.1.20080923. + +* Wed Sep 17 2008 Peng Huang - 0.1.1.20080917-1 +- Update to 0.1.1.20080917. + +* Tue Sep 16 2008 Peng Huang - 0.1.1.20080916-1 +- Update to 0.1.1.20080916. + +* Mon Sep 15 2008 Peng Huang - 0.1.1.20080914-1 +- Update to 0.1.1.20080914. + +* Mon Sep 08 2008 Peng Huang - 0.1.1.20080908-1 +- Update to 0.1.1.20080908. + +* Mon Sep 01 2008 Peng Huang - 0.1.1.20080901-1 +- Update to 0.1.1.20080901. + +* Sat Aug 30 2008 Peng Huang - 0.1.1.20080830-1 +- Update to 0.1.1.20080830. + +* Mon Aug 25 2008 Peng Huang - 0.1.1.20080825-1 +- Update to 0.1.1.20080825. + +* Sat Aug 23 2008 Peng Huang - 0.1.1.20080823-1 +- Update to 0.1.1.20080823. + +* Fri Aug 15 2008 Peng Huang - 0.1.1.20080815-1 +- Update to 0.1.1.20080815. + +* Tue Aug 12 2008 Peng Huang - 0.1.1.20080812-1 +- Update to 0.1.1.20080812. + +* Mon Aug 11 2008 Peng Huang - 0.1.0.20080810-2 +- Add gnome-python2-gconf in Requires. + +* Thu Aug 07 2008 Peng Huang - 0.1.0.20080810-1 +- The first version.