tdawson / rpms / ibus

Forked from rpms/ibus 3 years ago
Clone
5be3a0c
From 7b0d091839a4f1315ba216175fb2787e86f7fa31 Mon Sep 17 00:00:00 2001
5be3a0c
From: fujiwarat <takao.fujiwara1@gmail.com>
5be3a0c
Date: Tue, 3 Mar 2020 17:08:30 +0900
5be3a0c
Subject: [PATCH] src/tests: Delete graves in substitution in
5be3a0c
 ibus-desktop-testing-runner
5be3a0c
5be3a0c
Delete the single quotations to enclose grave chracters because
5be3a0c
DASH saves the single quoted '`id -u`' as the raw string in the command
5be3a0c
substitution not to be extracted.
5be3a0c
5be3a0c
BUG=https://github.com/ibus/ibus/issues/2189
5be3a0c
---
5be3a0c
 src/tests/ibus-desktop-testing-runner.in | 7 ++++---
5be3a0c
 1 file changed, 4 insertions(+), 3 deletions(-)
5be3a0c
5be3a0c
diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
index 0d9a847c..f9238e69 100755
5be3a0c
--- a/src/tests/ibus-desktop-testing-runner.in
5be3a0c
+++ b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
@@ -4,7 +4,7 @@
5be3a0c
 #
5be3a0c
 # ibus - The Input Bus
5be3a0c
 #
5be3a0c
-# Copyright (c) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
5be3a0c
+# Copyright (c) 2018-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
5be3a0c
 # Copyright (c) 2018 Red Hat, Inc.
5be3a0c
 #
5be3a0c
 # This program is free software; you can redistribute it and/or modify
5be3a0c
@@ -31,7 +31,8 @@
5be3a0c
 # POSIX sh has no 'echo -e'
5be3a0c
 : ${ECHO:='/usr/bin/echo'}
5be3a0c
 # POSIX sh has $UID
5be3a0c
-: ${UID:='`id -u`'}
5be3a0c
+# DASH saves the graves in '``' as characters not to be extracted
5be3a0c
+: ${UID:=`id -u`}
5be3a0c
 
5be3a0c
 
5be3a0c
 PROGNAME=`basename $0`
5be3a0c
@@ -170,7 +171,7 @@ _EOF
5be3a0c
 run_dbus_daemon()
5be3a0c
 {
5be3a0c
     # Use dbus-launch --exit-with-session later instead of --sh-syntax
5be3a0c
-    export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus
5be3a0c
+    export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
5be3a0c
 }
5be3a0c
 
5be3a0c
 run_desktop()
5be3a0c
-- 
5be3a0c
2.24.1
5be3a0c
5be3a0c
From 8ce25208c3f4adfd290a032c6aa739d2b7580eb1 Mon Sep 17 00:00:00 2001
5be3a0c
From: Carlos Garnacho <carlosg@gnome.org>
5be3a0c
Date: Thu, 12 Mar 2020 16:02:16 +0900
5be3a0c
Subject: [PATCH] src: Use WAYLAND_DISPLAY on Wayland sessions to make up
5be3a0c
 IBus socket name
5be3a0c
5be3a0c
In Wayland sessions, GNOME Shell 3.36 is leveraging 2 X11 Display
5be3a0c
connections so one is used to set up all services for a "X11 session"
5be3a0c
before user applications connected to the other display might require it.
5be3a0c
This allows seamlessly starting Xwayland on demand to X11 user applications.
5be3a0c
5be3a0c
IBus here belongs to the first described connection, it is started
5be3a0c
explicitly on that display by GNOME Shell as it is necessary to set up
5be3a0c
ibus-x11 before any other X11 client might want to use it.
5be3a0c
5be3a0c
However the use of this "secondary" display results in IBus daemon left
5be3a0c
unable to talk to applications, as the socket name is dependent on the
5be3a0c
DISPLAY envvar and ibus/applications don't agree on its content.
5be3a0c
5be3a0c
For wayland sessions, make it look for WAYLAND_DISPLAY, as that'll have
5be3a0c
the similar "per session bus" behavior that this seems to look after.
5be3a0c
5be3a0c
BUG=https://gitlab.gnome.org/GNOME/gnome-shell/issues/2341
5be3a0c
---
5be3a0c
 src/ibusshare.c | 11 +++++++++--
5be3a0c
 1 file changed, 9 insertions(+), 2 deletions(-)
5be3a0c
5be3a0c
diff --git a/src/ibusshare.c b/src/ibusshare.c
5be3a0c
index 0d50d3f5..e0ef2ce0 100644
5be3a0c
--- a/src/ibusshare.c
5be3a0c
+++ b/src/ibusshare.c
5be3a0c
@@ -100,6 +100,7 @@ ibus_get_socket_path (void)
5be3a0c
         gchar *display;
5be3a0c
         gchar *displaynumber = "0";
5be3a0c
         /* gchar *screennumber = "0"; */
5be3a0c
+        gboolean is_wayland = FALSE;
5be3a0c
         gchar *p;
5be3a0c
 
5be3a0c
         path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE"));
5be3a0c
@@ -108,13 +109,19 @@ ibus_get_socket_path (void)
5be3a0c
         }
5be3a0c
 
5be3a0c
         if (_display == NULL) {
5be3a0c
-            display = g_strdup (g_getenv ("DISPLAY"));
5be3a0c
+            display = g_strdup (g_getenv ("WAYLAND_DISPLAY"));
5be3a0c
+            if (display)
5be3a0c
+                is_wayland = TRUE;
5be3a0c
+            else
5be3a0c
+                display = g_strdup (g_getenv ("DISPLAY"));
5be3a0c
         }
5be3a0c
         else {
5be3a0c
             display = g_strdup (_display);
5be3a0c
         }
5be3a0c
 
5be3a0c
-        if (display) {
5be3a0c
+        if (is_wayland) {
5be3a0c
+            displaynumber = display;
5be3a0c
+        } else if (display) {
5be3a0c
             p = display;
5be3a0c
             hostname = display;
5be3a0c
             for (; *p != ':' && *p != '\0'; p++);
5be3a0c
-- 
5be3a0c
2.24.1
5be3a0c
5be3a0c
From 5765bfd69fb2ab1174378fbb0d8cac7f2bd2610f Mon Sep 17 00:00:00 2001
5be3a0c
From: Changwoo Ryu <cwryu@debian.org>
5be3a0c
Date: Wed, 15 Apr 2020 17:43:14 +0900
5be3a0c
Subject: [PATCH] client/gtk2: Remove glib_check_version() in gtk immodule
5be3a0c
5be3a0c
In the gtk2/gtk3 immodule, glib_check_version() is being used to make sure
5be3a0c
that the installed glib version is not older than the glib version which ibus
5be3a0c
is built with.
5be3a0c
5be3a0c
But there is no reason why glib version is checked in runtime. Library
5be3a0c
compatibility is already being checked more precisely by packaging systems and
5be3a0c
linkers.
5be3a0c
5be3a0c
This version check can break the ibus gtk immodule when used with an older but
5be3a0c
compatible version of glib, such as glib 2.62.x which is compatible with
5be3a0c
2.64.x.
5be3a0c
5be3a0c
BUG=https://github.com/ibus/ibus/issues/2200
5be3a0c
---
5be3a0c
 client/gtk2/ibusim.c | 4 +---
5be3a0c
 1 file changed, 1 insertion(+), 3 deletions(-)
5be3a0c
5be3a0c
diff --git a/client/gtk2/ibusim.c b/client/gtk2/ibusim.c
5be3a0c
index bfacd0f0..d70800d3 100644
5be3a0c
--- a/client/gtk2/ibusim.c
5be3a0c
+++ b/client/gtk2/ibusim.c
5be3a0c
@@ -41,9 +41,7 @@ static const GtkIMContextInfo *info_list[] = {
5be3a0c
 G_MODULE_EXPORT const gchar*
5be3a0c
 g_module_check_init (GModule *module)
5be3a0c
 {
5be3a0c
-    return glib_check_version (GLIB_MAJOR_VERSION,
5be3a0c
-                               GLIB_MINOR_VERSION,
5be3a0c
-                               0);
5be3a0c
+    return null;
5be3a0c
 }
5be3a0c
 
5be3a0c
 G_MODULE_EXPORT void
5be3a0c
-- 
5be3a0c
2.24.1
5be3a0c
5be3a0c
From 8da016764cee9616cca4658d1fb311d6b3bfc0df Mon Sep 17 00:00:00 2001
5be3a0c
From: fujiwarat <takao.fujiwara1@gmail.com>
5be3a0c
Date: Wed, 15 Apr 2020 17:55:03 +0900
5be3a0c
Subject: [PATCH] src/tests: Fix to get focus events with su in
5be3a0c
 ibus-desktop-testing-runner
5be3a0c
5be3a0c
GtkWindow haven't received focus events in any test cases since Fedora 31
5be3a0c
whenever Ansible runs ibus-desktop-testing-runner after `su root`.
5be3a0c
Seems su command does not run systemd automatically and now systemd
5be3a0c
requires XDG_RUNTIME_DIR and Ansible requires root access with ssh.
5be3a0c
This fix requires to restart sshd with modified /etc/ssh/sshd_config
5be3a0c
with "PermitRootLogin yes" in order to run with su command.
5be3a0c
5be3a0c
Ansible with ibus-desktop-testin-runner has worked fine if root console
5be3a0c
login is used without this patch because PAM runs systemd by login.
5be3a0c
---
5be3a0c
 src/tests/ibus-desktop-testing-runner.in | 36 ++++++++++++++++++++++--
5be3a0c
 1 file changed, 33 insertions(+), 3 deletions(-)
5be3a0c
5be3a0c
diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
index f9238e69..f760fd5b 100755
5be3a0c
--- a/src/tests/ibus-desktop-testing-runner.in
5be3a0c
+++ b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
@@ -49,6 +49,7 @@ PID_XORG=0
5be3a0c
 PID_GNOME_SESSION=0
5be3a0c
 TESTING_RUNNER="default"
5be3a0c
 TESTS=""
5be3a0c
+TIMEOUT=300
5be3a0c
 GREEN='\033[0;32m'
5be3a0c
 RED='\033[0;31m'
5be3a0c
 NC='\033[0m'
5be3a0c
@@ -84,6 +85,7 @@ usage()
5be3a0c
 "-r, --runner=RUNNER              Run TESTS programs with a test RUNNER.\n"    \
5be3a0c
 "                                 RUNNDER = gnome or default.\n"               \
5be3a0c
 "                                 default is an embedded runner.\n"            \
5be3a0c
+"-T, --timeout=TIMEOUT            Set timeout (default TIMEOUT is 300 sec).\n" \
5be3a0c
 "-o, --output=OUTPUT_FILE         OUtput the log to OUTPUT_FILE\n"             \
5be3a0c
 "-O, --result=RESULT_FILE         OUtput the result to RESULT_FILE\n"          \
5be3a0c
 ""
5be3a0c
@@ -92,8 +94,8 @@ usage()
5be3a0c
 parse_args()
5be3a0c
 {
5be3a0c
     # This is GNU getopt. "sudo port getopt" in BSD?
5be3a0c
-    ARGS=`getopt -o hvb:s:cd:t:r:o:O: --long \
5be3a0c
-          help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,output:,result:\
5be3a0c
+    ARGS=`getopt -o hvb:s:cd:t:r:T:o:O: --long \
5be3a0c
+          help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:\
5be3a0c
         -- "$@"`;
5be3a0c
     eval set -- "$ARGS"
5be3a0c
     while [ 1 ] ; do
5be3a0c
@@ -106,6 +108,7 @@ parse_args()
5be3a0c
         -d | --desktop )     DESKTOP_COMMAND="$2"; shift 2;;
5be3a0c
         -t | --tests )       TESTS="$2"; shift 2;;
5be3a0c
         -r | --runner )      TESTING_RUNNER="$2"; shift 2;;
5be3a0c
+        -T | --timeout )     TIMEOUT="$2"; shift 2;;
5be3a0c
         -o | --output )      TEST_LOG="$2"; shift 2;;
5be3a0c
         -O | --result )      RESULT_LOG="$2"; shift 2;;
5be3a0c
         -- )                 shift; break;;
5be3a0c
@@ -166,11 +169,37 @@ _EOF
5be3a0c
     fi
5be3a0c
     # `su` command does not run loginctl
5be3a0c
     export XDG_SESSION_TYPE='x11'
5be3a0c
+    export XDG_SESSION_CLASS=user
5be3a0c
+    # `su` command does not get focus in events without this variable.
5be3a0c
+    # Need to restart sshd after set "PermitRootLogin yes" in sshd_config
5be3a0c
+    if [ "x$XDG_RUNTIME_DIR" = x ] ; then
5be3a0c
+        export XDG_RUNTIME_DIR=/run/user/$UID
5be3a0c
+        is_root_login=`grep "^PermitRootLogin" /etc/ssh/sshd_config | grep yes`
5be3a0c
+        if [ "x$ANSIBLE" != x ] && [ "x$is_root_login" = x ] ; then
5be3a0c
+            print_log -e "${RED}FAIL${NC}: No permission to get focus-in events in GtkWindow with ansible"
5be3a0c
+            echo "su command does not configure necessary login info "         \
5be3a0c
+                 "with systemd and GtkWindow cannot receive focus-events "     \
5be3a0c
+                 "when ibus-desktop-testing-runner is executed by "            \
5be3a0c
+                 "ansible-playbook." >> $TEST_LOG
5be3a0c
+            echo "Enabling root login via sshd, restarting sshd, set "         \
5be3a0c
+                 "XDG_RUNTIME_DIR can resolve the problem under "              \
5be3a0c
+                 "ansible-playbook." >> $TEST_LOG
5be3a0c
+            exit 255
5be3a0c
+        fi
5be3a0c
+    fi
5be3a0c
+    #  Do we need XDG_SESSION_ID and XDG_SEAT?
5be3a0c
+    #export XDG_CONFIG_DIRS=/etc/xdg
5be3a0c
+    #export XDG_SESSION_ID=10
5be3a0c
+    #export XDG_SESSION_DESKTOP=gnome
5be3a0c
+    #export XDG_SEAT=seat0
5be3a0c
 }
5be3a0c
 
5be3a0c
 run_dbus_daemon()
5be3a0c
 {
5be3a0c
     # Use dbus-launch --exit-with-session later instead of --sh-syntax
5be3a0c
+    # GNOME uses a unix:abstract address and it effects gsettings set values
5be3a0c
+    # in each test case.
5be3a0c
+    # TODO: Should we comment out this line?
5be3a0c
     export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$UID/bus"
5be3a0c
 }
5be3a0c
 
5be3a0c
@@ -288,7 +317,8 @@ run_gnome_desktop_testing_runner()
5be3a0c
             fail=1
5be3a0c
             continue
5be3a0c
         fi
5be3a0c
-        gnome-desktop-testing-runner $tst 2>>$TEST_LOG 1>>$TEST_LOG
5be3a0c
+        gnome-desktop-testing-runner --timeout=$TIMEOUT $tst \
5be3a0c
+                2>>$TEST_LOG 1>>$TEST_LOG
5be3a0c
         retval=$?
5be3a0c
         read pass fail << EOF
5be3a0c
         `count_case_result $retval $pass $fail`
5be3a0c
-- 
5be3a0c
2.24.1
5be3a0c
5be3a0c
From 0b9d9365988a96a2bc31c48624f9c2b8081601b6 Mon Sep 17 00:00:00 2001
5be3a0c
From: fujiwarat <takao.fujiwara1@gmail.com>
5be3a0c
Date: Wed, 22 Apr 2020 20:17:12 +0900
5be3a0c
Subject: [PATCH] client/gtk2: Fix typo
5be3a0c
5be3a0c
---
5be3a0c
 client/gtk2/ibusim.c                     | 4 ++--
5be3a0c
 src/tests/ibus-desktop-testing-runner.in | 2 +-
5be3a0c
 2 files changed, 3 insertions(+), 3 deletions(-)
5be3a0c
5be3a0c
diff --git a/client/gtk2/ibusim.c b/client/gtk2/ibusim.c
5be3a0c
index d70800d3..55609ce7 100644
5be3a0c
--- a/client/gtk2/ibusim.c
5be3a0c
+++ b/client/gtk2/ibusim.c
5be3a0c
@@ -2,7 +2,7 @@
5be3a0c
 /* vim:set et ts=4: */
5be3a0c
 /* ibus - The Input Bus
5be3a0c
  * Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
5be3a0c
- * Copyright (C) 2008-2010 Red Hat, Inc.
5be3a0c
+ * Copyright (C) 2008-2020 Red Hat, Inc.
5be3a0c
  *
5be3a0c
  * This library is free software; you can redistribute it and/or
5be3a0c
  * modify it under the terms of the GNU Lesser General Public
5be3a0c
@@ -41,7 +41,7 @@ static const GtkIMContextInfo *info_list[] = {
5be3a0c
 G_MODULE_EXPORT const gchar*
5be3a0c
 g_module_check_init (GModule *module)
5be3a0c
 {
5be3a0c
-    return null;
5be3a0c
+    return NULL;
5be3a0c
 }
5be3a0c
 
5be3a0c
 G_MODULE_EXPORT void
5be3a0c
diff --git a/src/tests/ibus-desktop-testing-runner.in b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
index f760fd5b..4232c549 100755
5be3a0c
--- a/src/tests/ibus-desktop-testing-runner.in
5be3a0c
+++ b/src/tests/ibus-desktop-testing-runner.in
5be3a0c
@@ -173,7 +173,7 @@ _EOF
5be3a0c
     # `su` command does not get focus in events without this variable.
5be3a0c
     # Need to restart sshd after set "PermitRootLogin yes" in sshd_config
5be3a0c
     if [ "x$XDG_RUNTIME_DIR" = x ] ; then
5be3a0c
-        export XDG_RUNTIME_DIR=/run/user/$UID
5be3a0c
+        export XDG_RUNTIME_DIR="/run/user/$UID"
5be3a0c
         is_root_login=`grep "^PermitRootLogin" /etc/ssh/sshd_config | grep yes`
5be3a0c
         if [ "x$ANSIBLE" != x ] && [ "x$is_root_login" = x ] ; then
5be3a0c
             print_log -e "${RED}FAIL${NC}: No permission to get focus-in events in GtkWindow with ansible"
5be3a0c
-- 
5be3a0c
2.24.1
5be3a0c
c9bb32a
From 8c4125bc78ce3502b5aeb053e7029cc2594f83f2 Mon Sep 17 00:00:00 2001
c9bb32a
From: Changwoo Ryu <cwryu@debian.org>
c9bb32a
Date: Sun, 12 Apr 2020 05:28:15 +0900
c9bb32a
Subject: [PATCH] src: Build the Emoji dictionaries in parallel
c9bb32a
c9bb32a
Instead of building Emoji dictionaries src/dicts/emoji-*.dict in sequence, a
c9bb32a
pattern rule is specified for them. The make -jN option builds the
c9bb32a
dictionaries in parallel.
c9bb32a
c9bb32a
The GNU make extensions like pattern rule and patsubst function are used for
c9bb32a
it. But src/Makefile.am has had other GNU make extensions for a while, so
c9bb32a
using more extensions should not make portability worse.
c9bb32a
c9bb32a
BUG=https://github.com/ibus/ibus/pull/2209
c9bb32a
---
c9bb32a
 src/Makefile.am | 55 ++++++++++++++++++++++++-------------------------
c9bb32a
 1 file changed, 27 insertions(+), 28 deletions(-)
c9bb32a
c9bb32a
diff --git a/src/Makefile.am b/src/Makefile.am
c9bb32a
index a8e3d07d..99de1ab7 100644
c9bb32a
--- a/src/Makefile.am
c9bb32a
+++ b/src/Makefile.am
c9bb32a
@@ -246,42 +246,41 @@ if ENABLE_EMOJI_DICT
c9bb32a
 AM_CPPFLAGS += -DENABLE_EMOJI_DICT
c9bb32a
 
c9bb32a
 dictdir = $(pkgdatadir)/dicts
c9bb32a
-dict_DATA = dicts/emoji-en.dict
c9bb32a
 LANG_FILES = $(basename $(notdir $(wildcard $(EMOJI_ANNOTATION_DIR)/*.xml)))
c9bb32a
+EMOJI_DICT_FILES = $(patsubst %,dicts/emoji-%.dict,$(LANG_FILES))
c9bb32a
+dict_DATA = $(EMOJI_DICT_FILES)
c9bb32a
 
c9bb32a
 noinst_PROGRAMS += emoji-parser
c9bb32a
 
c9bb32a
-dicts/emoji-en.dict: emoji-parser
c9bb32a
+dicts/emoji-%.dict: emoji-parser
c9bb32a
 	$(AM_V_at)if test x"$(LANG_FILES)" = x ; then \
c9bb32a
 	    echo "WARNING: Not found $(EMOJI_ANNOTATION_DIR)/en.xml" 1>&2; \
c9bb32a
 	fi; \
c9bb32a
-	for f in $(LANG_FILES) ; do \
c9bb32a
-	    if test -f dicts/emoji-$$f.dict; then \
c9bb32a
-	        echo "Already exists dicts/emoji-$$f.dict"; \
c9bb32a
-	        continue; \
c9bb32a
-	    fi; \
c9bb32a
-	    if test -f \
c9bb32a
-	    "$(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$$f.xml" ; then \
c9bb32a
-	        xml_derived_option="--xml-derived $(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$$f.xml"; \
c9bb32a
+	if test -f $@; then \
c9bb32a
+	    echo "Already exists $@"; \
c9bb32a
+	    exit 0; \
c9bb32a
+	fi; \
c9bb32a
+	if test -f \
c9bb32a
+	    "$(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$*.xml" ; then \
c9bb32a
+	        xml_derived_option="--xml-derived $(EMOJI_ANNOTATION_DIR)/../annotationsDerived/$*.xml"; \
c9bb32a
 	        plus_comment="derived"; \
c9bb32a
-	    fi; \
c9bb32a
-	    if test x"$$f" = xen ; then \
c9bb32a
-	        $(builddir)/emoji-parser \
c9bb32a
-	            --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \
c9bb32a
-	            --xml $(EMOJI_ANNOTATION_DIR)/$$f.xml \
c9bb32a
-	            $$xml_derived_option \
c9bb32a
-	            --xml-ascii $(top_srcdir)/data/annotations/en_ascii.xml \
c9bb32a
-	            --out-category ibusemojigen.h \
c9bb32a
-	            --out $@; \
c9bb32a
-	    else \
c9bb32a
-	        $(builddir)/emoji-parser \
c9bb32a
-	            --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \
c9bb32a
-	            --xml $(EMOJI_ANNOTATION_DIR)/$$f.xml \
c9bb32a
-	            $$xml_derived_option \
c9bb32a
-	            --out dicts/emoji-$$f.dict; \
c9bb32a
-	    fi; \
c9bb32a
-	    echo "Generated $$plus_comment dicts/emoji-$$f.dict"; \
c9bb32a
-	done
c9bb32a
+	fi; \
c9bb32a
+	if test x"$*" = xen ; then \
c9bb32a
+	    $(builddir)/emoji-parser \
c9bb32a
+	        --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \
c9bb32a
+	        --xml $(EMOJI_ANNOTATION_DIR)/$*.xml \
c9bb32a
+	        $$xml_derived_option \
c9bb32a
+	        --xml-ascii $(top_srcdir)/data/annotations/en_ascii.xml \
c9bb32a
+	        --out-category ibusemojigen.h \
c9bb32a
+	        --out $@; \
c9bb32a
+	else \
c9bb32a
+	    $(builddir)/emoji-parser \
c9bb32a
+	        --unicode-emoji-dir $(UNICODE_EMOJI_DIR) \
c9bb32a
+	        --xml $(EMOJI_ANNOTATION_DIR)/$*.xml \
c9bb32a
+	        $$xml_derived_option \
c9bb32a
+	        --out $@; \
c9bb32a
+	fi; \
c9bb32a
+	echo "Generated $$plus_comment $@"
c9bb32a
 
c9bb32a
 ibusemojigen.h: dicts/emoji-en.dict
c9bb32a
 	$(NULL)
c9bb32a
-- 
c9bb32a
2.23.0.rc1
c9bb32a
c9bb32a
From 02105c4d486283e6b561181d9c934d4d23f2d65e Mon Sep 17 00:00:00 2001
c9bb32a
From: fujiwarat <takao.fujiwara1@gmail.com>
c9bb32a
Date: Thu, 14 May 2020 15:48:34 +0900
c9bb32a
Subject: [PATCH] bus: Fix SEGV in bus_panel_proxy_focus_in()
c9bb32a
c9bb32a
SEGV in BUS_IS_PANEL_PROXY() in bus_panel_proxy_focus_in()
c9bb32a
Check if GDBusConnect is closed before bus_panel_proxy_new() is called.
c9bb32a
c9bb32a
BUG=rhbz#1349148
c9bb32a
BUG=rhbz#1385349
c9bb32a
---
c9bb32a
 bus/ibusimpl.c | 25 ++++++++++++++++++++-----
c9bb32a
 1 file changed, 20 insertions(+), 5 deletions(-)
c9bb32a
c9bb32a
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
c9bb32a
index 85761d30..e432e849 100644
c9bb32a
--- a/bus/ibusimpl.c
c9bb32a
+++ b/bus/ibusimpl.c
c9bb32a
@@ -2,8 +2,8 @@
c9bb32a
 /* vim:set et sts=4: */
c9bb32a
 /* ibus - The Input Bus
c9bb32a
  * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
c9bb32a
- * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
c9bb32a
- * Copyright (C) 2008-2019 Red Hat, Inc.
c9bb32a
+ * Copyright (C) 2011-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
c9bb32a
+ * Copyright (C) 2008-2020 Red Hat, Inc.
c9bb32a
  *
c9bb32a
  * This library is free software; you can redistribute it and/or
c9bb32a
  * modify it under the terms of the GNU Lesser General Public
c9bb32a
@@ -464,13 +464,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl   *dbus,
c9bb32a
     else if (!g_strcmp0 (name, IBUS_SERVICE_PANEL_EXTENSION_EMOJI))
c9bb32a
         panel_type = PANEL_TYPE_EXTENSION_EMOJI;
c9bb32a
 
c9bb32a
-    if (panel_type != PANEL_TYPE_NONE) {
c9bb32a
+    do {
c9bb32a
+        if (panel_type == PANEL_TYPE_NONE)
c9bb32a
+            break;
c9bb32a
         if (g_strcmp0 (new_name, "") != 0) {
c9bb32a
             /* a Panel process is started. */
c9bb32a
             BusConnection *connection;
c9bb32a
             BusInputContext *context = NULL;
c9bb32a
             BusPanelProxy   **panel = (panel_type == PANEL_TYPE_PANEL) ?
c9bb32a
                                       &ibus->panel : &ibus->emoji_extension;
c9bb32a
+            GDBusConnection *dbus_connection = NULL;
c9bb32a
 
c9bb32a
             if (*panel != NULL) {
c9bb32a
                 ibus_proxy_destroy ((IBusProxy *)(*panel));
c9bb32a
@@ -479,9 +482,21 @@ _dbus_name_owner_changed_cb (BusDBusImpl   *dbus,
c9bb32a
                 g_assert (*panel == NULL);
c9bb32a
             }
c9bb32a
 
c9bb32a
-            connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name);
c9bb32a
+            connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS,
c9bb32a
+                                                               new_name);
c9bb32a
             g_return_if_fail (connection != NULL);
c9bb32a
 
c9bb32a
+            dbus_connection = bus_connection_get_dbus_connection (connection);
c9bb32a
+            /* rhbz#1349148 rhbz#1385349
c9bb32a
+             * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel)
c9bb32a
+             * This function is called during destroying the connection
c9bb32a
+             * in this case? */
c9bb32a
+            if (dbus_connection == NULL ||
c9bb32a
+                g_dbus_connection_is_closed (dbus_connection)) {
c9bb32a
+                new_name = "";
c9bb32a
+                break;
c9bb32a
+            }
c9bb32a
+
c9bb32a
             *panel = bus_panel_proxy_new (connection, panel_type);
c9bb32a
             if (panel_type == PANEL_TYPE_EXTENSION_EMOJI)
c9bb32a
                 ibus->enable_emoji_extension = FALSE;
c9bb32a
@@ -535,7 +550,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl   *dbus,
c9bb32a
                 }
c9bb32a
             }
c9bb32a
         }
c9bb32a
-    }
c9bb32a
+    } while (0);
c9bb32a
 
c9bb32a
     bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name);
c9bb32a
 }
c9bb32a
-- 
c9bb32a
2.24.1
c9bb32a
c9bb32a
From f591381e3c892947ecaffe9131b9039ab9014498 Mon Sep 17 00:00:00 2001
c9bb32a
From: fujiwarat <takao.fujiwara1@gmail.com>
c9bb32a
Date: Thu, 14 May 2020 16:02:00 +0900
c9bb32a
Subject: [PATCH] bus: Fix SEGV in bus_dbus_impl_name_owner_changed()
c9bb32a
c9bb32a
rhbz#1406699 SEGV in new_owner!=NULL in bus_dbus_impl_name_owner_changed()
c9bb32a
which is called by bus_name_service_remove_owner()
c9bb32a
If bus_connection_get_unique_name()==NULL, set new_owner="" in
c9bb32a
bus_name_service_remove_owner()
c9bb32a
c9bb32a
rhbz#1432252 SEGV in old_owner!=NULL in bus_dbus_impl_name_owner_changed()
c9bb32a
which is called by bus_name_service_set_primary_owner()
c9bb32a
If bus_connection_get_unique_name()==NULL, set old_owner="" in
c9bb32a
bus_name_service_set_primary_owner()
c9bb32a
c9bb32a
BUG=rhbz#1406699
c9bb32a
BUG=rhbz#1432252
c9bb32a
---
c9bb32a
 bus/dbusimpl.c | 27 +++++++++++++++++++++++----
c9bb32a
 1 file changed, 23 insertions(+), 4 deletions(-)
c9bb32a
c9bb32a
diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c
c9bb32a
index b54ef817..59787a80 100644
c9bb32a
--- a/bus/dbusimpl.c
c9bb32a
+++ b/bus/dbusimpl.c
c9bb32a
@@ -2,7 +2,8 @@
c9bb32a
 /* vim:set et sts=4: */
c9bb32a
 /* ibus - The Input Bus
c9bb32a
  * Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
c9bb32a
- * Copyright (C) 2008-2013 Red Hat, Inc.
c9bb32a
+ * Copyright (C) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
c9bb32a
+ * Copyright (C) 2008-2020 Red Hat, Inc.
c9bb32a
  *
c9bb32a
  * This library is free software; you can redistribute it and/or
c9bb32a
  * modify it under the terms of the GNU Lesser General Public
c9bb32a
@@ -344,6 +345,8 @@ bus_name_service_set_primary_owner (BusNameService     *service,
c9bb32a
                                     BusConnectionOwner *owner,
c9bb32a
                                     BusDBusImpl        *dbus)
c9bb32a
 {
c9bb32a
+    gboolean has_old_owner = FALSE;
c9bb32a
+
c9bb32a
     g_assert (service != NULL);
c9bb32a
     g_assert (owner != NULL);
c9bb32a
     g_assert (dbus != NULL);
c9bb32a
@@ -351,6 +354,13 @@ bus_name_service_set_primary_owner (BusNameService     *service,
c9bb32a
     BusConnectionOwner *old = service->owners != NULL ?
c9bb32a
             (BusConnectionOwner *)service->owners->data : NULL;
c9bb32a
 
c9bb32a
+    /* rhbz#1432252 If bus_connection_get_unique_name() == NULL,
c9bb32a
+     * "Hello" method is not received yet.
c9bb32a
+     */
c9bb32a
+    if (old != NULL && bus_connection_get_unique_name (old->conn) != NULL) {
c9bb32a
+        has_old_owner = TRUE;
c9bb32a
+    }
c9bb32a
+
c9bb32a
     if (old != NULL) {
c9bb32a
         g_signal_emit (dbus,
c9bb32a
                        dbus_signals[NAME_LOST],
c9bb32a
@@ -370,7 +380,8 @@ bus_name_service_set_primary_owner (BusNameService     *service,
c9bb32a
                    0,
c9bb32a
                    owner->conn,
c9bb32a
                    service->name,
c9bb32a
-                   old != NULL ? bus_connection_get_unique_name (old->conn) : "",
c9bb32a
+                   has_old_owner ? bus_connection_get_unique_name (old->conn) :
c9bb32a
+                           "",
c9bb32a
                    bus_connection_get_unique_name (owner->conn));
c9bb32a
 
c9bb32a
     if (old != NULL && old->do_not_queue != 0) {
c9bb32a
@@ -427,6 +438,7 @@ bus_name_service_remove_owner (BusNameService     *service,
c9bb32a
                                BusDBusImpl        *dbus)
c9bb32a
 {
c9bb32a
     GSList *owners;
c9bb32a
+    gboolean has_new_owner = FALSE;
c9bb32a
 
c9bb32a
     g_assert (service != NULL);
c9bb32a
     g_assert (owner != NULL);
c9bb32a
@@ -439,6 +451,13 @@ bus_name_service_remove_owner (BusNameService     *service,
c9bb32a
         BusConnectionOwner *_new = NULL;
c9bb32a
         if (owners->next != NULL) {
c9bb32a
             _new = (BusConnectionOwner *)owners->next->data;
c9bb32a
+            /* rhbz#1406699 If bus_connection_get_unique_name() == NULL,
c9bb32a
+             * "Hello" method is not received yet.
c9bb32a
+             */
c9bb32a
+            if (_new != NULL &&
c9bb32a
+                bus_connection_get_unique_name (_new->conn) != NULL) {
c9bb32a
+                has_new_owner = TRUE;
c9bb32a
+            }
c9bb32a
         }
c9bb32a
 
c9bb32a
         if (dbus != NULL) {
c9bb32a
@@ -447,7 +466,7 @@ bus_name_service_remove_owner (BusNameService     *service,
c9bb32a
                            0,
c9bb32a
                            owner->conn,
c9bb32a
                            service->name);
c9bb32a
-            if (_new != NULL) {
c9bb32a
+            if (has_new_owner) {
c9bb32a
                 g_signal_emit (dbus,
c9bb32a
                                dbus_signals[NAME_ACQUIRED],
c9bb32a
                                0,
c9bb32a
@@ -460,7 +479,7 @@ bus_name_service_remove_owner (BusNameService     *service,
c9bb32a
                     _new != NULL ? _new->conn : NULL,
c9bb32a
                     service->name,
c9bb32a
                     bus_connection_get_unique_name (owner->conn),
c9bb32a
-                    _new != NULL ? bus_connection_get_unique_name (_new->conn) : "");
c9bb32a
+                    has_new_owner ? bus_connection_get_unique_name (_new->conn) : "");
c9bb32a
 
c9bb32a
         }
c9bb32a
     }
c9bb32a
-- 
c9bb32a
2.24.1
c9bb32a