fujiwara / rpms / ibus

Forked from rpms/ibus 4 years ago
Clone
Blob Blame History Raw
From 1b5b9548ad418765717ce1fbdc70b3f3eaae67fc Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 14 Mar 2022 14:25:10 +0900
Subject: [PATCH] client/gtk2: Revert CCedilla change for pt-BR

gtk_im_context_simple_add_table() is deprecated in GTK4.
I decide to delete gtk_im_context_simple_add_table() here because
the change 03c9e591430c62354bbf26ef7bd4a2e6acfb7c8f is no longer needed
because IBusEngineSimple has implemented to load pt_br compose key
by locale

BUG=chromium-os:11421
BUG=http://codereview.appspot.com/3989060
---
 client/gtk2/ibusimcontext.c | 33 +--------------------------------
 1 file changed, 1 insertion(+), 32 deletions(-)

diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index a5e5e792..e314ae98 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -2,7 +2,7 @@
 /* vim:set et sts=4: */
 /* ibus - The Input Bus
  * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
  * Copyright (C) 2008-2021 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
@@ -874,33 +874,6 @@ ibus_im_context_class_fini (IBusIMContextClass *class)
     g_bus_unwatch_name (_daemon_name_watch_id);
 }
 
-/* Copied from gtk+2.0-2.20.1/modules/input/imcedilla.c to fix crosbug.com/11421.
- * Overwrite the original Gtk+'s compose table in gtk+-2.x.y/gtk/gtkimcontextsimple.c. */
-
-/* The difference between this and the default input method is the handling
- * of C+acute - this method produces C WITH CEDILLA rather than C WITH ACUTE.
- * For languages that use CCedilla and not acute, this is the preferred mapping,
- * and is particularly important for pt_BR, where the us-intl keyboard is
- * used extensively.
- */
-static guint16 cedilla_compose_seqs[] = {
-#ifdef DEPRECATED_GDK_KEYSYMS
-  GDK_dead_acute,	GDK_C,	0,	0,	0,	0x00C7,	/* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_dead_acute,	GDK_c,	0,	0,	0,	0x00E7,	/* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-  GDK_Multi_key,	GDK_apostrophe,	GDK_C,  0,      0,      0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_Multi_key,	GDK_apostrophe,	GDK_c,  0,      0,      0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-  GDK_Multi_key,	GDK_C,  GDK_apostrophe,	0,      0,      0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_Multi_key,	GDK_c,  GDK_apostrophe,	0,      0,      0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-#else
-  GDK_KEY_dead_acute,	GDK_KEY_C,	0,	0,	0,	0x00C7,	/* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_KEY_dead_acute,	GDK_KEY_c,	0,	0,	0,	0x00E7,	/* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-  GDK_KEY_Multi_key,	GDK_KEY_apostrophe,	GDK_KEY_C,  0,      0,      0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_KEY_Multi_key,	GDK_KEY_apostrophe,	GDK_KEY_c,  0,      0,      0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-  GDK_KEY_Multi_key,	GDK_KEY_C,  GDK_KEY_apostrophe,	0,      0,      0x00C7, /* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_KEY_Multi_key,	GDK_KEY_c,  GDK_KEY_apostrophe,	0,      0,      0x00E7, /* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-#endif
-};
-
 static void
 ibus_im_context_init (GObject *obj)
 {
@@ -936,10 +909,6 @@ ibus_im_context_init (GObject *obj)
 
     // Create slave im context
     ibusimcontext->slave = gtk_im_context_simple_new ();
-    gtk_im_context_simple_add_table (GTK_IM_CONTEXT_SIMPLE (ibusimcontext->slave),
-                                     cedilla_compose_seqs,
-                                     4,
-                                     G_N_ELEMENTS (cedilla_compose_seqs) / (4 + 2));
 
     g_signal_connect (ibusimcontext->slave,
                       "commit",
-- 
2.34.1

From 37900574934bb01cc31860ae3ae2f668e4360838 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 28 Mar 2022 23:18:58 +0900
Subject: [PATCH] src/tests: Run ibus-daemon from CI even if GNOME desktop

gnome-shell no longer launch ibus-daemon with IBus systemd file.
This is a workaround to call ibus-daemon after GNOME fails to
launch ibus-daemon

BUG=https://gitlab.gnome.org/GNOME/gdm/-/issues/777
---
 src/tests/ibus-desktop-testing-runner.in | 38 +++++++++++++++++++++---
 1 file changed, 34 insertions(+), 4 deletions(-)

diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
index 48528326..6b208345 100755
--- a/src/tests/ibus-desktop-testing-runner.in
+++ b/src/tests/ibus-desktop-testing-runner.in
@@ -55,6 +55,7 @@ GREEN='\033[0;32m'
 RED='\033[0;31m'
 NC='\033[0m'
 
+
 print_log()
 {
     if [ x"$RESULT_LOG" != x ] ; then
@@ -69,6 +70,7 @@ print_log()
     fi
 }
 
+
 usage()
 {
     $ECHO -e \
@@ -95,6 +97,7 @@ usage()
 ""
 }
 
+
 parse_args()
 {
     # This is GNU getopt. "sudo port getopt" in BSD?
@@ -129,6 +132,7 @@ parse_args()
     fi
 }
 
+
 init_desktop()
 {
     if [ "$RESULT_LOG" != "" ] ; then
@@ -207,6 +211,7 @@ _EOF
     #export XDG_SEAT=seat0
 }
 
+
 run_dbus_daemon()
 {
     # Use dbus-launch --exit-with-session later instead of --sh-syntax
@@ -216,6 +221,7 @@ run_dbus_daemon()
     export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
 }
 
+
 init_gnome()
 {
     # gsettings set command needs dconf-service with the same $DISPLAY
@@ -258,6 +264,7 @@ init_gnome()
     fi
 }
 
+
 run_desktop()
 {
     echo "$DESKTOP_COMMAND" | grep gnome-session > /dev/null
@@ -278,12 +285,28 @@ run_desktop()
     $DESKTOP_COMMAND &
     PID_GNOME_SESSION=$!
     sleep 30
-    if [  $HAS_GNOME -ne 0 ] ; then
-        ibus-daemon --daemonize --verbose
-        sleep 3
-    fi
+
+    # gnome-shell 42 checks if org.freedesktop.IBus.session.GNOME.service
+    # systemd file is available with org.freedesktop.systemd1.Manager.GetUnit
+    # D-Bus method, which is provided by IBus 1.5.26, and if the file
+    # is available, gnome-shell no longer launch ibus-daemon
+    # because gnome-shell assumes gnome-session would launch ibus-daemon
+    # with org.freedesktop.systemd1.Manager.StartUnit D-Bus method.
+    # But actually gnome-session failed to launch ibus-daemon
+    # because the IBus systemd file depends on gnome-session.target
+    # but this CI launches gnome-session directly.
+    #
+    # So ibus-dameon is now always called here after gnome-shell fails to
+    # launch ibus-daemon.
+    # It may be better this CI launches GDM autologin to run gnome-session
+    # with gnome-session.target systemd file.
+    # But `systemctl start gdm` terminates the parent script forcibly
+    # and the script cannot get the CI result.
+    ibus-daemon --daemonize --verbose
+    sleep 3
 }
 
+
 count_case_result()
 {
     retval=$1
@@ -298,6 +321,7 @@ count_case_result()
     echo $pass $fail
 }
 
+
 echo_case_result()
 {
     retval=$1
@@ -311,6 +335,7 @@ echo_case_result()
     fi
 }
 
+
 run_direct_test_cases()
 {
     pass=0
@@ -363,6 +388,7 @@ EOF_ENVS
     echo $pass $fail
 }
 
+
 run_gnome_desktop_testing_runner()
 {
     pass=0
@@ -397,6 +423,7 @@ EOF
     echo $pass $fail
 }
 
+
 run_test_suite()
 {
     pass=0
@@ -435,6 +462,7 @@ EOF_RUNNER
     fi
 }
 
+
 finit()
 {
     echo "# Killing left gnome-session and Xorg"
@@ -451,6 +479,7 @@ finit()
     echo "# Finished $PROGNAME testing"
 }
 
+
 main()
 {
     parse_args "$@"
@@ -470,5 +499,6 @@ main()
     finit
 }
 
+
 # Need to enclose $@ with double quotes not to split the array.
 main "$@"
-- 
2.34.1