ibus/ibus-HEAD.patch

2304 lines
78 KiB
Diff
Raw Normal View History

2021-09-01 03:21:31 +00:00
From 571e3b6e4f386abf12d3db70b9468e092c8d72bd Mon Sep 17 00:00:00 2001
From: Alynx Zhou <alynx.zhou@gmail.com>
Date: Tue, 24 Aug 2021 10:12:52 +0800
Subject: [PATCH] client/gtk2/ibusimcontext: Fix wrong cursor location in gtk3
apps
If you apply this patch in your tarball, please also apply this to
client/gtk3/ibusimcontext.c besides client/gtk2/ibusimcontext.c .
BUG=https://github.com/ibus/ibus/issues/2337
---
client/gtk2/ibusimcontext.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index da9a402f..b1ccede9 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -1497,7 +1497,10 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext)
#if GTK_CHECK_VERSION (3, 98, 4)
#elif GTK_CHECK_VERSION (2, 91, 0)
- area.y += gdk_window_get_height (ibusimcontext->client_window);
+ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
+ area.x = 0;
+ area.y += gdk_window_get_height (ibusimcontext->client_window);
+ }
#else
if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) {
gint w, h;
--
2.31.1
From 5487a6baa4b22605ba8197ca1a0fa43c91d57786 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 6 Sep 2021 20:23:59 +0900
Subject: [PATCH] client/gtk2/ibusimcontext: Implement clear preedit for GTK4
IBus IM module uses synchornized key processes for GTK4 and the timing
of the GTK reset siginal may work with focus-in/out between windows.
(I don't test GTK4 firefox and terminal yet and the verification is not
completed.)
So ibus_im_context_clear_preedit_text() is now called with the GTK4 reset
siginal.
ibus_im_context_clear_preedit_text() works with ibus-setup-anthy ->
"Conversion" tab -> "Behavior on Focus Out" pull down menu.
BUG=https://github.com/ibus/ibus/issues/2334
---
client/gtk2/ibusimcontext.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index b1ccede9..e12be45d 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -1270,6 +1270,8 @@ ibus_im_context_reset (GtkIMContext *context)
* IBus uses button-press-event instead until GTK is fixed.
* https://gitlab.gnome.org/GNOME/gtk/issues/1534
*/
+ if (_use_sync_mode)
+ ibus_im_context_clear_preedit_text (ibusimcontext);
ibus_input_context_reset (ibusimcontext->ibuscontext);
}
gtk_im_context_reset (ibusimcontext->slave);
@@ -1383,7 +1385,7 @@ ibus_im_context_set_client_window (GtkIMContext *context,
if (ibusimcontext->client_window) {
#if !GTK_CHECK_VERSION (3, 98, 4)
- if (ibusimcontext->use_button_press_event)
+ if (ibusimcontext->use_button_press_event && !_use_sync_mode)
_connect_button_press_event (ibusimcontext, FALSE);
#endif
g_object_unref (ibusimcontext->client_window);
@@ -1393,7 +1395,7 @@ ibus_im_context_set_client_window (GtkIMContext *context,
if (client != NULL) {
ibusimcontext->client_window = g_object_ref (client);
#if !GTK_CHECK_VERSION (3, 98, 4)
- if (!ibusimcontext->use_button_press_event)
+ if (!ibusimcontext->use_button_press_event && !_use_sync_mode)
_connect_button_press_event (ibusimcontext, TRUE);
#endif
}
@@ -1994,7 +1996,8 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext,
#if !GTK_CHECK_VERSION (3, 98, 4)
if (!ibusimcontext->use_button_press_event &&
- mode == IBUS_ENGINE_PREEDIT_COMMIT) {
+ mode == IBUS_ENGINE_PREEDIT_COMMIT &&
+ !_use_sync_mode) {
if (ibusimcontext->client_window) {
_connect_button_press_event (ibusimcontext, TRUE);
}
--
2.28.0
From 4957d1468db4fc5ed30c3ae1f2afac9e51b329d6 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 6 Sep 2021 20:25:52 +0900
Subject: [PATCH] client/gtk2/ibusimcontext: Calculate keycode from keysym in
GTK3 forward-key-event
IBus GTK3 mode also calculates keycode from keysym if keycode == 0
with forward-key-event signal to follow GTK4.
---
client/gtk2/ibusimcontext.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index e12be45d..b1424e87 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -1939,13 +1939,16 @@ _ibus_context_forward_key_event_cb (IBusInputContext *ibuscontext,
int group = 0;
g_return_if_fail (GTK_IS_IM_CONTEXT (ibusimcontext));
if (keycode == 0 && ibusimcontext->client_window) {
- GdkDisplay *display = gtk_widget_get_display (ibusimcontext->client_window);
+ GdkDisplay *display =
+ gtk_widget_get_display (ibusimcontext->client_window);
GdkKeymapKey *keys = NULL;
gint n_keys = 0;
- if (!gdk_display_map_keyval (display, keyval, &keys, &n_keys))
+ if (gdk_display_map_keyval (display, keyval, &keys, &n_keys)) {
+ keycode = keys->keycode;
+ group = keys->group;
+ } else {
g_warning ("Failed to parse keycode from keyval %x", keyval);
- keycode = keys->keycode;
- group = keys->group;
+ }
}
gtk_im_context_filter_key (
GTK_IM_CONTEXT (ibusimcontext),
@@ -1957,6 +1960,17 @@ _ibus_context_forward_key_event_cb (IBusInputContext *ibuscontext,
(GdkModifierType)state,
group);
#else
+ if (keycode == 0 && ibusimcontext->client_window) {
+ GdkDisplay *display =
+ gdk_window_get_display (ibusimcontext->client_window);
+ GdkKeymap *keymap = gdk_keymap_get_for_display (display);
+ GdkKeymapKey *keys = NULL;
+ gint n_keys = 0;
+ if (gdk_keymap_get_entries_for_keyval (keymap, keyval, &keys, &n_keys))
+ keycode = keys->keycode;
+ else
+ g_warning ("Failed to parse keycode from keyval %x", keyval);
+ }
GdkEventKey *event = _create_gdk_event (ibusimcontext, keyval, keycode, state);
gdk_event_put ((GdkEvent *)event);
gdk_event_free ((GdkEvent *)event);
--
2.28.0
From fbea5441fc53ae1d5533bed1ee53009141cf905a Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 10 Sep 2021 00:09:26 +0900
Subject: [PATCH] Fix build errors in Ubuntu focal
- Ubuntu focal uses glib 2.64.6 which does not include errno.h
so config.h includes errno.h as the workaround.
- make autogen.sh not to delete dist files in Travis
- Call $(PYTHON) for gensimple.py for Ubuntu python3
- Add a code review in src/ibuscomposetable.c
BUG=https://github.com/ibus/ibus/pull/2348
---
autogen.sh | 2 +-
configure.ac | 9 +++++++++
engine/Makefile.am | 2 +-
src/ibuscomposetable.c | 4 ++++
src/ibusregistry.c | 4 ++++
src/ibusshare.c | 3 +++
6 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 693a2740..ea633e06 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -53,4 +53,4 @@ ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 CFLAGS="$CFL
echo "rm $f"
rm $f
done
-}
+} || :
diff --git a/configure.ac b/configure.ac
index 29f8b3db..ce096ad3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -162,6 +162,15 @@ PKG_CHECK_MODULES(GIO2, [
PKG_CHECK_MODULES(GTHREAD2, [
gthread-2.0 >= glib_required_version
])
+PKG_CHECK_EXISTS(
+ [glib-2.0 >= 2.65.0],
+ [AC_DEFINE(GLIB2_EMBED_ERRNO_H, TRUE, [glib2 include errno.h])]
+)
+AH_BOTTOM([
+#ifndef GLIB2_EMBED_ERRNO_H
+# include <errno.h>
+#endif
+])
# --disable-tests option.
AC_ARG_ENABLE(tests,
diff --git a/engine/Makefile.am b/engine/Makefile.am
index 84bc7f6c..03867f52 100644
--- a/engine/Makefile.am
+++ b/engine/Makefile.am
@@ -99,7 +99,7 @@ simple.xml: simple.xml.in
mv $@.tmp $@
simple.xml.in:
- $(srcdir)/gensimple.py \
+ $(PYTHON) $(srcdir)/gensimple.py \
--input=$(XKBCONFIG_BASE)/rules/evdev.xml \
--output=$@ \
--version=$(VERSION).`date '+%Y%m%d'` \
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
index d4184d30..b76464bc 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include <glib.h>
#include <glib/gstdio.h>
@@ -1606,6 +1609,7 @@ ibus_compose_table_compact_check (const IBusComposeTableCompactEx
row_stride = i + 1;
if (seq_index[i + 1] - seq_index[i] > 0) {
+ g_assert (row_stride);
seq = bsearch (compose_buffer + 1,
table->data + seq_index[i],
(seq_index[i + 1] - seq_index[i]) / row_stride,
diff --git a/src/ibusregistry.c b/src/ibusregistry.c
index 23c5ca1b..962afb20 100644
--- a/src/ibusregistry.c
+++ b/src/ibusregistry.c
@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <gio/gio.h>
#include <glib/gstdio.h>
#include <string.h>
diff --git a/src/ibusshare.c b/src/ibusshare.c
index 8974511a..0c0bda10 100644
--- a/src/ibusshare.c
+++ b/src/ibusshare.c
@@ -20,6 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
* USA
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
#include "ibusshare.h"
#include <glib.h>
--
2.33.1
2021-08-09 04:27:50 +00:00
From 943d37444d9cc0881cb5fff87bdd4b9efd5abdb4 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Mon, 9 Aug 2021 12:49:15 +0900
Subject: [PATCH] client/gtk2/ibusimcontext: Fix a key event loop with
forwarding keys.
_ibus_context_forward_key_event_cb() caused a key event loop in
_key_snooper_cb() with key release events.
---
client/gtk2/ibusimcontext.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
index da9a402f..e66125df 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -366,6 +366,10 @@ ibus_im_context_commit_event (IBusIMContext *ibusimcontext,
g_signal_emit (ibusimcontext, _signal_commit_id, 0, text->text);
g_object_unref (text);
_request_surrounding_text (ibusimcontext);
+#if !GTK_CHECK_VERSION (3, 98, 4)
+ /* Avoid a loop with _ibus_context_forward_key_event_cb() */
+ event->state |= IBUS_HANDLED_MASK;
+#endif
return TRUE;
}
return FALSE;
@@ -643,12 +647,15 @@ _key_snooper_cb (GtkWidget *widget,
} while (0);
- if (ibusimcontext != NULL) {
+ if (ibusimcontext != NULL && event->type == GDK_KEY_PRESS) {
/* "retrieve-surrounding" signal sometimes calls unref by
* gtk_im_multicontext_get_slave() because priv->context_id is not
* the latest than global_context_id in GtkIMMulticontext.
* Since _focus_im_context is gotten by the focus_in event,
* it would be good to call ref here.
+ *
+ * Most release key events would be redundant from
+ * _ibus_context_forward_key_event_cb ().
*/
g_object_ref (ibusimcontext);
_request_surrounding_text (ibusimcontext);
@@ -657,7 +664,7 @@ _key_snooper_cb (GtkWidget *widget,
retval = _process_key_event (ibuscontext, event, ibusimcontext);
- if (ibusimcontext != NULL) {
+ if (ibusimcontext != NULL && event->type == GDK_KEY_PRESS) {
/* unref ibusimcontext could call ibus_im_context_finalize here
* because "retrieve-surrounding" signal could call unref.
*/
--
2.28.0
From 179ebddf4dbde1cef1cea2df4e659cf4940d1a30 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 27 Aug 2021 20:05:02 +0900
Subject: [PATCH] src/tests: Add --screendump option in
ibus-desktop-testing-runner
The screendump is useful in CI to if check gnome-shell-extension-no-overview
works.
Also add ibus-desktop-testing-autostart to get the debug info in CI.
You can copy ibus-desktop-testing.desktop to $HOME/.config/autostart
if CI fails.
---
src/tests/Makefile.am | 11 +++++
src/tests/ibus-desktop-testing-autostart | 55 +++++++++++++++++++++++
src/tests/ibus-desktop-testing-runner.in | 20 +++++++--
src/tests/ibus-desktop-testing.desktop.in | 11 +++++
4 files changed, 93 insertions(+), 4 deletions(-)
create mode 100755 src/tests/ibus-desktop-testing-autostart
create mode 100644 src/tests/ibus-desktop-testing.desktop.in
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 13c06eb4..7d00f236 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -96,6 +96,7 @@ test_sourcesdir = $(datadir)/installed-tests/ibus
CLEANFILES += \
$(test_metas) \
ibus-desktop-testing-runner \
+ org.freedesktop.IBus.Desktop.Testing.desktop \
$(NULL)
test_execs_PROGRAMS = $(TESTS)
@@ -106,6 +107,14 @@ CLEANFILES += \
$(NULL)
endif
test_execsdir = $(libexecdir)/installed-tests/ibus
+libexec_SCRIPTS = ibus-desktop-testing-autostart
+
+test_frame_DATA = org.freedesktop.IBus.Desktop.Testing.desktop
+test_framedir = $(pkgdatadir)/tests
+org.freedesktop.IBus.Desktop.Testing.desktop: ibus-desktop-testing.desktop.in
+ $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|g" \
+ $< > $@.tmp && \
+ mv $@.tmp $@
endif
$(test_metas): $(test_metas_in) $(test_programs)
@@ -133,6 +142,8 @@ EXTRA_DIST = \
ibus-compose.emoji \
ibus-compose.env \
ibus-compose-locales.in \
+ ibus-desktop-testing.desktop.in \
+ ibus-desktop-testing-autostart \
ibus-desktop-testing-runner.in \
$(NULL)
diff --git a/src/tests/ibus-desktop-testing-autostart b/src/tests/ibus-desktop-testing-autostart
new file mode 100755
index 00000000..da22b64e
--- /dev/null
+++ b/src/tests/ibus-desktop-testing-autostart
@@ -0,0 +1,55 @@
+#!/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 <takao.fujiwara1@gmail.com>
+# 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
+'
+
+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-runner.in b/src/tests/ibus-desktop-testing-runner.in
index c1016703..48528326 100755
--- a/src/tests/ibus-desktop-testing-runner.in
+++ b/src/tests/ibus-desktop-testing-runner.in
@@ -36,13 +36,14 @@
PROGNAME=`basename $0`
-VERSION=0.2
+VERSION=0.3
DISPLAY=:99.0
BUILDDIR="."
SRCDIR="."
TEST_LOG="test-suite.log"
TEST_LOG_STDOUT=0
RESULT_LOG=""
+SCREEN_LOG=""
HAVE_GRAPHICS=1
DESKTOP_COMMAND="dbus-launch --exit-with-session gnome-session"
PID_XORG=0
@@ -90,14 +91,15 @@ usage()
"-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" \
""
}
parse_args()
{
# This is GNU getopt. "sudo port getopt" in BSD?
- ARGS=`getopt -o hvb:s:cd:t:r:T:o:O: --long \
- help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:\
+ ARGS=`getopt -o hvb:s:cd:t:r:T:o:O:S: --long \
+ help,version,builddir:,srcdir:,no-graphics,desktop:,tests:,runner:,timeout:,output:,result:,screendump:\
-- "$@"`;
eval set -- "$ARGS"
while [ 1 ] ; do
@@ -113,6 +115,7 @@ parse_args()
-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
@@ -259,6 +262,7 @@ 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
@@ -266,7 +270,6 @@ run_desktop()
fi
PID_XORG=$!
sleep 1
- export DISPLAY=$DISPLAY
# init_gnome need to be called with $DISPLAY before gnome-session is called
if [ $HAS_GNOME -eq 0 ] ; then
init_gnome
@@ -454,6 +457,15 @@ main()
init_desktop
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_test_suite
finit
}
diff --git a/src/tests/ibus-desktop-testing.desktop.in b/src/tests/ibus-desktop-testing.desktop.in
new file mode 100644
index 00000000..fa0c9b40
--- /dev/null
+++ b/src/tests/ibus-desktop-testing.desktop.in
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Name=IBus Desktop Testing Runner
+GenericName=Input Method Desktop Testing Runner
+Comment=Test plugin for IBus Desktop Testing
+Exec=@ibexecdir@/ibus-desktop-testing-autostart /var/tmp/ibus-ci-autostart.log
+Terminal=false
+Type=Application
+Encoding=UTF-8
+Icon=ibus
+Categories=System
+Keywords=im;
--
2.28.0
From acc5570511698c7b5cc037eb81be2c4be52a824f Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 29 Oct 2021 12:56:49 +0900
Subject: [PATCH] ui/gtk3: Erase Emojier preedit/lookup popup between
applications
It would be better to erase Emojier popup window when users change
the input focus between applications. But it hasn't been implemented
because the focus-out/in events also happen when the Emojier popup window
is launching or rebuilding to the category list in GNOME Wayland.
The focus-out/in events do not happen in Xorg desktops with the rebuilding
GUI because GTK popup window causes focus-in/out evnets in Wayland.
Now I'm convinced with several issues and added a little complicated logic
to erase Emojier popup window with the focus changes between input contexts
to handle focus-in/out events in Wayland.
BUG=rhbz#1942970
---
ui/gtk3/emojier.vala | 69 ++++++++++++++++++++++++++++++++++++---
ui/gtk3/emojierapp.vala | 12 +++++--
ui/gtk3/panelbinding.vala | 21 ++++++++++--
3 files changed, 94 insertions(+), 8 deletions(-)
diff --git a/ui/gtk3/emojier.vala b/ui/gtk3/emojier.vala
index 9e6e9263..69fb8abe 100644
--- a/ui/gtk3/emojier.vala
+++ b/ui/gtk3/emojier.vala
@@ -2,7 +2,7 @@
*
* ibus - The Input Bus
*
- * Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (c) 2017-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -227,6 +227,8 @@ public class IBusEmojier : Gtk.ApplicationWindow {
BACKWARD,
}
+ public bool is_wayland { get; set; }
+
public const uint BUTTON_CLOSE_BUTTON = 1000;
private const uint EMOJI_GRID_PAGE = 10;
@@ -317,15 +319,18 @@ public class IBusEmojier : Gtk.ApplicationWindow {
private Gdk.Rectangle m_cursor_location;
private bool m_is_up_side_down = false;
private uint m_redraw_window_id;
+ private bool m_rebuilding_gui = false;
+ private uint m_rebuilding_gui_timeout_id;
public signal void candidate_clicked(uint index, uint button, uint state);
public signal void commit_text(string text);
public signal void cancel();
- public IBusEmojier() {
+ public IBusEmojier(bool is_wayland) {
GLib.Object(
type : Gtk.WindowType.POPUP
);
+ this.is_wayland = is_wayland;
// GLib.ActionEntry accepts const variables only.
var action = new GLib.SimpleAction.stateful(
@@ -1002,6 +1007,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
button.button_press_event.connect((w, e) => {
m_category_active_index = -1;
m_show_unicode = false;
+ start_rebuild_gui(false);
hide_candidate_panel();
show_all();
return true;
@@ -1458,6 +1464,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
show_emoji_for_category(m_backward);
show_candidate_panel();
} else {
+ start_rebuild_gui(false);
hide_candidate_panel();
show_all();
}
@@ -1778,6 +1785,34 @@ public class IBusEmojier : Gtk.ApplicationWindow {
}
+ private void start_rebuild_gui(bool initial_launching) {
+ if (!this.is_wayland)
+ return;
+ if (!initial_launching && !base.get_visible())
+ return;
+ if (initial_launching && base.get_visible())
+ return;
+ if (m_rebuilding_gui_timeout_id != 0) {
+ GLib.Source.remove(m_rebuilding_gui_timeout_id);
+ m_rebuilding_gui_timeout_id = 0;
+ }
+
+ m_rebuilding_gui = true;
+ m_rebuilding_gui_timeout_id =
+ GLib.Timeout.add_seconds(10, () => {
+ if (!m_rebuilding_gui) {
+ m_rebuilding_gui_timeout_id = 0;
+ return false;
+ }
+ warning("Rebuilding GUI is time out.");
+ m_rebuilding_gui = false;
+ m_rebuilding_gui_timeout_id = 0;
+ return false;
+ },
+ GLib.Priority.DEFAULT_IDLE);
+ }
+
+
public bool has_variants(uint index,
bool need_commit_signal) {
if (index >= m_lookup_table.get_number_of_candidates())
@@ -1880,12 +1915,17 @@ public class IBusEmojier : Gtk.ApplicationWindow {
m_show_unicode = false;
m_category_active_index = -1;
}
+ start_rebuild_gui(false);
hide_candidate_panel();
return true;
} else if (m_backward_index >= 0 && m_backward != null) {
+ // Escape on Emoji variants window does not call focus-out events
+ // because hide() is not called here so start_rebuild_gui()
+ // is not called.
show_emoji_for_category(m_backward);
return true;
} else if (m_candidate_panel_is_visible && m_backward != null) {
+ start_rebuild_gui(false);
hide_candidate_panel();
return true;
}
@@ -2218,7 +2258,7 @@ public class IBusEmojier : Gtk.ApplicationWindow {
/* Some window managers, e.g. MATE, GNOME, Plasma desktops,
* does not give the keyboard focus when Emojier is lauched
- * twice with Ctrl-Shift-e via XIEvent, if present_with_time()
+ * twice with Ctrl-period via XIEvent, if present_with_time()
* is not applied.
* But XFCE4 desktop does not effect this bug.
* Seems this is caused by the window manager's focus stealing
@@ -2265,8 +2305,10 @@ public class IBusEmojier : Gtk.ApplicationWindow {
#endif
- /* override virtual functions */
+ // override virtual functions
public override void show_all() {
+ // Ctrl-period, space keys causes focus-out/in events in GNOME Wayland.
+ start_rebuild_gui(true);
base.show_all();
if (m_candidate_panel_mode)
show_candidate_panel();
@@ -2416,6 +2458,17 @@ public class IBusEmojier : Gtk.ApplicationWindow {
}
+ public override bool focus_in_event(Gdk.EventFocus event) {
+ m_rebuilding_gui = false;
+ return base.focus_in_event(event);
+ }
+
+
+ public override bool focus_out_event(Gdk.EventFocus event) {
+ return base.focus_out_event(event);
+ }
+
+
public bool is_running() {
return m_is_running;
}
@@ -2511,6 +2564,14 @@ public class IBusEmojier : Gtk.ApplicationWindow {
}
+ public bool is_rebuilding_gui() {
+ /* The candidate window and preedit text should not be closed
+ * when the GUI is rebuilding.
+ */
+ return m_rebuilding_gui;
+ }
+
+
public static bool has_loaded_emoji_dict() {
if (m_emoji_to_data_dict == null)
return false;
diff --git a/ui/gtk3/emojierapp.vala b/ui/gtk3/emojierapp.vala
index 783c611c..812356f0 100644
--- a/ui/gtk3/emojierapp.vala
+++ b/ui/gtk3/emojierapp.vala
@@ -3,7 +3,7 @@
* ibus - The Input Bus
*
* Copyright (c) 2017 Peng Wu <alexepico@gmail.com>
- * Copyright (c) 2017-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (c) 2017-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -208,7 +208,15 @@ public class EmojiApplication : Gtk.Application {
IBusEmojier.load_unicode_dict();
if (m_emojier == null) {
- m_emojier = new IBusEmojier();
+ bool is_wayland = false;
+#if USE_GDK_WAYLAND
+ Type instance_type = Gdk.Display.get_default().get_type();
+ Type wayland_type = typeof(GdkWayland.Display);
+ is_wayland = instance_type.is_a(wayland_type);
+#else
+ warning("Checking Wayland is disabled");
+#endif
+ m_emojier = new IBusEmojier(is_wayland);
// For title handling in gnome-shell
add_window(m_emojier);
m_emojier.candidate_clicked.connect((i, b, s) => {
diff --git a/ui/gtk3/panelbinding.vala b/ui/gtk3/panelbinding.vala
index 861255b1..e63d93f2 100644
--- a/ui/gtk3/panelbinding.vala
+++ b/ui/gtk3/panelbinding.vala
@@ -3,7 +3,7 @@
* ibus - The Input Bus
*
* Copyright(c) 2018 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright(c) 2018-2020 Takao Fujwiara <takao.fujiwara1@gmail.com>
+ * Copyright(c) 2018-2021 Takao Fujwiara <takao.fujiwara1@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -799,6 +799,23 @@ class PanelBinding : IBus.PanelService {
public override void focus_out(string input_context_path) {
m_current_context_path = "";
+ /* Close emoji typing when the focus out happens but it's not a
+ * rebuilding GUI.
+ * Emojier rebuilding GUI happens when Escape key is pressed on
+ * Emojier candidate list and the rebuilding also causes focus-out/in
+ * events in GNOME Wayland but not Xorg desktops.
+ * The rebuilding GUI can be checked with m_emojier.is_rebuilding_gui()
+ * in Wayland.
+ * m_emojier.is_rebuilding_gui() always returns false in Xorg desktops
+ * since focus-out/in events does not happen.
+ */
+ if (m_emojier != null && !m_emojier.is_rebuilding_gui()) {
+ m_preedit.reset();
+ m_emojier.set_annotation("");
+ if (m_wayland_lookup_table_is_visible)
+ hide_wayland_lookup_table();
+ key_press_escape();
+ }
}
@@ -822,7 +839,7 @@ class PanelBinding : IBus.PanelService {
m_loaded_unicode = true;
}
if (m_emojier == null) {
- m_emojier = new IBusEmojier();
+ m_emojier = new IBusEmojier(m_is_wayland);
// For title handling in gnome-shell
m_application.add_window(m_emojier);
m_emojier.candidate_clicked.connect((i, b, s) => {
--
2.28.0
From 28acfd433b3df1673b7c7177915c027ce48c061e Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 5 Nov 2021 07:22:34 +0900
Subject: [PATCH] ui/gtk2: Deprecate gettext.bind_textdomain_codeset()
since Python 3.8
setup/i18n.py is a symlink of ui/gtk2/i18n.py
env PYTHONWARNINGS='d' ibus-setup
BUG=https://github.com/ibus/ibus/issues/2276
---
setup/i18n.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/setup/i18n.py b/setup/i18n.py
index 976d1aee..af14efc6 100644
--- a/setup/i18n.py
+++ b/setup/i18n.py
@@ -3,7 +3,9 @@
# ibus - The Input Bus
#
# Copyright(c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright(c) 2012-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright(c) 2007-2015 Google, Inc.
+# Copyright(c) 2012-2021 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -23,12 +25,14 @@
import locale
import gettext
import os
+import sys
DOMAINNAME = "ibus10"
_ = lambda a: gettext.dgettext(DOMAINNAME, a)
N_ = lambda a: a
+PY3K = sys.version_info >= (3, 0)
LOCALEDIR = os.getenv("IBUS_LOCALEDIR")
def init_textdomain(domainname):
@@ -42,7 +46,9 @@ def init_textdomain(domainname):
except AttributeError:
pass
gettext.bindtextdomain(domainname, LOCALEDIR)
- gettext.bind_textdomain_codeset(domainname, 'UTF-8')
+ # https://docs.python.org/3/library/gettext.html#gettext.lgettext
+ if not PY3K:
+ gettext.bind_textdomain_codeset(domainname, 'UTF-8')
def gettext_engine_longname(engine):
name = engine.get_name()
--
2.33.1
From cfcc6f194cfc95ab0cf1b3b719d77321c249a83b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Na=C3=AFm=20Favier?= <n@monade.li>
Date: Tue, 16 Nov 2021 00:33:37 +0100
Subject: [PATCH] src/ibuscomposetable: invalidate cache based on symlink
mtime too
When the compose file is a symbolic link, take the link itself's
modification time into account (in addition to its target's) in
determining whether to invalidate the compose cache.
This is useful e.g. on NixOS systems where the compose file might point
to a store path with an irrelevant modification time, and we want the
cache to expire when the symlink itself changes.
BUG=https://github.com/ibus/ibus/pull/2362
---
src/ibuscomposetable.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
index b76464bc..250e0139 100644
--- a/src/ibuscomposetable.c
+++ b/src/ibuscomposetable.c
@@ -1040,10 +1040,14 @@ ibus_compose_table_load_cache (const gchar *compose_file)
if (!g_file_test (path, G_FILE_TEST_EXISTS))
break;
- if (g_stat (compose_file, &original_buf))
- break;
if (g_stat (path, &cache_buf))
break;
+ if (g_lstat (compose_file, &original_buf))
+ break;
+ if (original_buf.st_mtime > cache_buf.st_mtime)
+ break;
+ if (g_stat (compose_file, &original_buf))
+ break;
if (original_buf.st_mtime > cache_buf.st_mtime)
break;
if (!g_file_get_contents (path, &contents, &length, &error)) {
--
2.33.1
From 2bc47f09832073c87ccdf1060bd93ff95878685a Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 2 Dec 2021 23:52:36 +0900
Subject: [PATCH] autogen: Delete gnome-autogen dependency
You may like to call ./autogen.sh --enable-gtk-doc with your custom
configure options.
Also set SAVE_DIST_FILE=1 by default
---
autogen.sh | 96 +++++++++++++++++++++++++++++++++----------------
src/Makefile.am | 18 ++++++----
3 files changed, 80 insertions(+), 41 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index ea633e06..1acbf705 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,22 +1,47 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-srcdir=`dirname $0`
-test -z "$srcdir" && srcdir=.
-
-PKG_NAME="ibus"
-DIST_FILES="
-engine/simple.xml.in
-src/ibusemojigen.h
-src/ibusunicodegen.h
-"
+: ${srcdir=$(dirname $0)}
+: ${srcdir:=.}
+: ${SAVE_DIST_FILES:=0}
+
+olddir=$(pwd)
+# shellcheck disable=SC2016
+PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
+WANT_GTK_DOC=0
+GCC_VERSION=$(gcc --version | head -1 | awk '{print $3}')
+GCC_MAJOR_VERSION=$(echo "$GCC_VERSION" | awk -F. '{print $1}')
FEDORA_PKG1='autoconf automake libtool gettext-devel'
FEDORA_PKG2='glib2-devel gtk2-devel gtk3-devel
wayland-devel'
FEDORA_PKG3='cldr-emoji-annotation iso-codes-devel unicode-emoji unicode-ucd
xkeyboard-config-devel'
-(test -z "$DISABLE_INSTALL_PKGS") && {
+CFLAGS=${CFLAGS-"-Wall -Wformat -Werror=format-security"}
+(test $GCC_MAJOR_VERSION -ge 10) && {
+ CFLAGS="$CFLAGS -fanalyzer -fsanitize=address -fsanitize=leak"
+ FEDORA_PKG1="$FEDORA_PKG1 libasan"
+}
+
+cd "$srcdir"
+
+(test -f configure.ac \
+ && test -f README ) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+(test $(grep -q "^GTK_DOC_CHECK" configure.ac)) || {
+ WANT_GTK_DOC=1
+ FEDORA_PKG2="$FEDORA_PKG2 gtk-doc"
+}
+
+(test -f ChangeLog) || {
+ touch ChangeLog
+}
+
+(test "x$DISABLE_INSTALL_PKGS" = "x") && {
(test -f /etc/fedora-release ) && {
rpm -q $FEDORA_PKG1 || exit 1
rpm -q $FEDORA_PKG2 || exit 1
@@ -27,30 +52,39 @@ FEDORA_PKG3='cldr-emoji-annotation iso-codes-devel unicode-emoji unicode-ucd
}
}
-(test -f $srcdir/configure.ac \
- && test -f $srcdir/README ) || {
- echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level $PKG_NAME directory"
- exit 1
-}
-
-which gnome-autogen.sh || {
- echo "Not found gnome-autogen.sh. You may need to install gnome-common"
- exit 1
+CONFIGFLAGS="$@"
+(test "$#" = 0 -a "x$NOCONFIGURE" = "x" ) && {
+ echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
+ echo "*** If you wish to pass any to it, please specify them on the" >&2
+ echo "*** '$0' command line." >&2
+ echo "" >&2
+ (test $WANT_GTK_DOC -eq 1) && CONFIGFLAGS="--enable-gtk-doc $@"
}
-(test -f $srcdir/ChangeLog) || {
- touch $srcdir/ChangeLog
-}
+(test $WANT_GTK_DOC -eq 1) && gtkdocize --copy
-CFLAGS=${CFLAGS-"-Wall -Wformat -Werror=format-security"}
+ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 \
+autoreconf --verbose --force --install || exit 1
-# need --enable-gtk-doc for gnome-autogen.sh to make dist
-ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I m4" REQUIRED_AUTOMAKE_VERSION=1.11 CFLAGS="$CFLAGS" . gnome-autogen.sh "$@"
+cd "$olddir"
+(test "x$NOCONFIGURE" = "x" ) && {
+ echo "$srcdir/configure $CONFIGFLAGS"
+ $srcdir/configure $CONFIGFLAGS || exit 1
+ (test "$1" = "--help" ) && {
+ exit 0
+ } || {
+ echo "Now type 'make' to compile $PKG_NAME" || exit 1
+ }
+} || {
+ echo "Skipping configure process."
+}
-(test -z "$SAVE_DIST_FILES") && {
- for f in $DIST_FILES ; do
- echo "rm $f"
- rm $f
- done
+cd "$srcdir"
+(test "x$SAVE_DIST_FILES" = "x0" ) && {
+ # rm engine/simple.xml.in src/ibusemojigen.h src/ibusunicodegen.h
+ for d in engine src; do
+ echo "make -C $d maintainer-clean-generic"
+ make -C $d maintainer-clean-generic
+ done
} || :
+cd "$olddir"
diff --git a/src/Makefile.am b/src/Makefile.am
index 742ee7d7..578694b5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2015-2020 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
@@ -296,8 +296,8 @@ dicts/emoji-%.dict: emoji-parser
echo "Skip $$plus_comment $@"; \
fi;
-ibusemojigen.h: dicts/emoji-en.dict
- $(NULL)
+ibusemojigen.h:
+ $(MAKE) $(AM_MAKEFLAGS) dicts/emoji-en.dict
# We put dicts/emoji-%.dict as the make target for the parallel build
# and the make target has to be genarated even if the file size is zero.
@@ -364,8 +364,8 @@ dicts/unicode-blocks.dict: unicode-parser
echo "Generated $@"; \
fi;
-ibusunicodegen.h: dicts/unicode-blocks.dict
- $(NULL)
+ibusunicodegen.h:
+ $(MAKE) $(AM_MAKEFLAGS) dicts/unicode-blocks.dict
unicode_parser_SOURCES = \
unicode-parser.c \
@@ -398,9 +398,15 @@ CLEANFILES += \
stamp-ibusenumtypes.h \
$(NULL)
-DISTCLEANFILES = \
+MAINTAINERCLEANFILES = \
ibusemojigen.h \
ibusunicodegen.h \
+ dicts/emoji-en.dict \
+ dicts/unicode-blocks.dict \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(MAINTAINERCLEANFILES) \
ibusversion.h \
$(NULL)
--
2.33.1
From 104148bcdada1f8f22ef905c930f9944f3e99a63 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 2 Dec 2021 23:53:28 +0900
Subject: [PATCH] src: Disable emoji shortcut key with no-emoji hint
BUG=https://gitlab.gnome.org/GNOME/gtk/-/issues/4337
---
src/ibusengine.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ibusengine.c b/src/ibusengine.c
index 9aeafbf9..7e844838 100644
--- a/src/ibusengine.c
+++ b/src/ibusengine.c
@@ -2,8 +2,8 @@
/* vim:set et sts=4: */
/* ibus - The Input Bus
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2018-2019 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2019 Red Hat, Inc.
+ * Copyright (C) 2018-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2021 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -954,6 +954,10 @@ ibus_engine_filter_key_event (IBusEngine *engine,
return FALSE;
for (n = names; n; n = n->next) {
const gchar *name = (const gchar *)n->data;
+ if (!g_strcmp0 (name, "emoji") &&
+ (engine->priv->content_hints & IBUS_INPUT_HINT_NO_EMOJI)) {
+ continue;
+ }
keys = g_hash_table_lookup (priv->extension_keybindings, name);
for (; keys; keys++) {
if (keys->keyval == 0 && keys->keycode == 0 && keys->state == 0)
--
2.33.1
From f5757ada54edaa7d2e3ea948d340cdf48064e30c Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 6 Jan 2022 11:20:26 +0900
Subject: [PATCH] ibusenginesimple: Fix to send char position at
update_preedit_text
ibus_engine_update_preedit_text() should send the character position
instead of the byte position.
BUG=https://github.com/ibus/ibus/issues/2368
---
src/ibusenginesimple.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
index 83b04ebc..a80e41a5 100644
--- a/src/ibusenginesimple.c
+++ b/src/ibusenginesimple.c
@@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* ibus - The Input Bus
* Copyright (C) 2014 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) 2014-2017 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -386,7 +386,7 @@ ibus_engine_simple_update_preedit_text (IBusEngineSimple *simple)
} else if (s->len >= G_MAXINT) {
g_warning ("%s is too long compose length: %lu", s->str, s->len);
} else {
- int len = (int)s->len;
+ guint len = (guint)g_utf8_strlen (s->str, -1);
IBusText *text = ibus_text_new_from_string (s->str);
ibus_text_append_attribute (text,
IBUS_ATTR_TYPE_UNDERLINE, IBUS_ATTR_UNDERLINE_SINGLE, 0, len);
--
2.33.1
From 0e118e7e57caaa298e367ed99f2051ba47a35f81 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 20 Jan 2022 16:33:11 +0900
Subject: [PATCH] data/dconf: Change XKB layout string color in panel
Replace '#415099' with '#51a2da' in XKB layout string color
BUG=https://github.com/ibus/ibus/issues/2364
---
data/dconf/org.freedesktop.ibus.gschema.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
index 099b9c60..e90ee5ab 100644
--- a/data/dconf/org.freedesktop.ibus.gschema.xml
+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
@@ -146,7 +146,7 @@
<description>Show input method name on language bar</description>
</key>
<key name="xkb-icon-rgba" type="s">
- <default>'#415099'</default>
+ <default>'#51a2da'</default>
<summary>RGBA value of XKB icon</summary>
<description>XKB icon shows the layout string and the string is rendered with the RGBA value. The RGBA value can be 1. a color name from X11, 2. a hex value in form '#rrggbb' where 'r', 'g' and 'b' are hex digits of the red, green, and blue, 3. a RGB color in form 'rgb(r,g,b)' or 4. a RGBA color in form 'rgba(r,g,b,a)' where 'r', 'g', and 'b' are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and 'a' is a floating point value in the range 0 to 1 of the alpha.</description>
</key>
--
2.33.1
From d9ff2bb6b04a7cf7d99f4e9832b4b8905858178c Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 20 Jan 2022 16:41:37 +0900
Subject: [PATCH] data/dconf: Add Ctrl-semicolon to Emoji shortcut key
period key is needed Shift key in French keyboard and Ctrl-period does
not work.
Add Ctrl-semicolon in org.freedesktop.ibus.panel.emoji.hotkey to fix
the problem.
BUG=https://github.com/ibus/ibus/issues/2360
---
data/dconf/org.freedesktop.ibus.gschema.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/dconf/org.freedesktop.ibus.gschema.xml b/data/dconf/org.freedesktop.ibus.gschema.xml
index e90ee5ab..516f7520 100644
--- a/data/dconf/org.freedesktop.ibus.gschema.xml
+++ b/data/dconf/org.freedesktop.ibus.gschema.xml
@@ -183,7 +183,7 @@
<description>The shortcut keys for turning Unicode typing on or off</description>
</key>
<key name="hotkey" type="as">
- <default>[ '&lt;Control&gt;period' ]</default>
+ <default>[ '&lt;Control&gt;period', '&lt;Control&gt;semicolon' ]</default>
<summary>Emoji shortcut keys for gtk_accelerator_parse</summary>
<description>The shortcut keys for turning emoji typing on or off</description>
</key>
--
2.33.1
From 5a455b1ead5d72483952356ddfe25b9e3b637e6f Mon Sep 17 00:00:00 2001
From: Eberhard Beilharz <eb1@sil.org>
Date: Wed, 13 Oct 2021 19:00:47 +0200
Subject: [PATCH] Fix unref problems with floating references
When running with debug-enabled GLIB there are several critical
errors output: "A floating object ... was finalized. This means
that someone called g_object_unref() on an object that had only
a floating reference; the initial floating reference is not
owned by anyone and must be removed with g_object_ref_sink()."
This change fixes this by calling `g_object_ref_sink()` before
`g_object_unref()` if we have a floating reference.
It also fixes another related problem where we called
`g_object_unref()` on a static IBusText string (created with
`ibus_text_new_from_static_string()`) for which the API documentation
says not to free.
BUG=https://github.com/ibus/ibus/pull/2359
---
src/ibusinputcontext.c | 21 ++++++++++++++-------
src/ibusproperty.c | 32 ++++++++++++++++----------------
2 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
index 2b1438fc..4b27551b 100644
--- a/src/ibusinputcontext.c
+++ b/src/ibusinputcontext.c
@@ -550,7 +550,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
g_signal_emit (context, context_signals[COMMIT_TEXT], 0, text);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
if (g_strcmp0 (signal_name, "UpdatePreeditText") == 0) {
@@ -569,7 +570,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
visible);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
if (g_strcmp0 (signal_name, "UpdatePreeditTextWithMode") == 0) {
@@ -591,7 +593,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
mode);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
@@ -619,7 +622,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
text,
visible);
if (g_object_is_floating (text))
- g_object_unref (text);
+ g_object_ref_sink (text);
+ g_object_unref (text);
return;
}
@@ -637,7 +641,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
table,
visible);
if (g_object_is_floating (table))
- g_object_unref (table);
+ g_object_ref_sink (table);
+ g_object_unref (table);
return;
}
@@ -655,7 +660,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
prop_list);
if (g_object_is_floating (prop_list))
- g_object_unref (prop_list);
+ g_object_ref_sink (prop_list);
+ g_object_unref (prop_list);
return;
}
@@ -668,7 +674,8 @@ ibus_input_context_g_signal (GDBusProxy *proxy,
g_signal_emit (context, context_signals[UPDATE_PROPERTY], 0, prop);
if (g_object_is_floating (prop))
- g_object_unref (prop);
+ g_object_ref_sink (prop);
+ g_object_unref (prop);
return;
}
diff --git a/src/ibusproperty.c b/src/ibusproperty.c
index e87d26b6..6d4ed088 100644
--- a/src/ibusproperty.c
+++ b/src/ibusproperty.c
@@ -336,17 +336,20 @@ ibus_property_destroy (IBusProperty *prop)
prop->priv->icon = NULL;
if (prop->priv->label) {
- g_object_unref (prop->priv->label);
+ if (!ibus_text_get_is_static (prop->priv->label))
+ g_object_unref (prop->priv->label);
prop->priv->label = NULL;
}
if (prop->priv->symbol) {
- g_object_unref (prop->priv->symbol);
+ if (!ibus_text_get_is_static (prop->priv->symbol))
+ g_object_unref (prop->priv->symbol);
prop->priv->symbol = NULL;
}
if (prop->priv->tooltip) {
- g_object_unref (prop->priv->tooltip);
+ if (!ibus_text_get_is_static (prop->priv->tooltip))
+ g_object_unref (prop->priv->tooltip);
prop->priv->tooltip = NULL;
}
@@ -401,7 +404,7 @@ ibus_property_deserialize (IBusProperty *prop,
g_variant_get_child (variant, retval++, "u", &prop->priv->type);
GVariant *subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->label != NULL) {
+ if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
g_object_unref (prop->priv->label);
}
prop->priv->label = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -411,7 +414,7 @@ ibus_property_deserialize (IBusProperty *prop,
ibus_g_variant_get_child_string (variant, retval++, &prop->priv->icon);
subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->tooltip != NULL) {
+ if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
g_object_unref (prop->priv->tooltip);
}
prop->priv->tooltip = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -432,7 +435,7 @@ ibus_property_deserialize (IBusProperty *prop,
/* Keep the serialized order for the compatibility when add new members. */
subvar = g_variant_get_child_value (variant, retval++);
- if (prop->priv->symbol != NULL) {
+ if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
g_object_unref (prop->priv->symbol);
}
prop->priv->symbol = IBUS_TEXT (ibus_serializable_deserialize (subvar));
@@ -564,7 +567,7 @@ ibus_property_set_label (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_return_if_fail (label == NULL || IBUS_IS_TEXT (label));
- if (prop->priv->label) {
+ if (prop->priv->label && !ibus_text_get_is_static (prop->priv->label)) {
g_object_unref (prop->priv->label);
}
@@ -583,7 +586,7 @@ ibus_property_set_symbol (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_return_if_fail (symbol == NULL || IBUS_IS_TEXT (symbol));
- if (prop->priv->symbol) {
+ if (prop->priv->symbol && !ibus_text_get_is_static (prop->priv->symbol)) {
g_object_unref (prop->priv->symbol);
}
@@ -612,19 +615,16 @@ ibus_property_set_tooltip (IBusProperty *prop,
g_assert (IBUS_IS_PROPERTY (prop));
g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip));
- IBusPropertyPrivate *priv = prop->priv;
-
- if (priv->tooltip) {
- g_object_unref (priv->tooltip);
+ if (prop->priv->tooltip && !ibus_text_get_is_static (prop->priv->tooltip)) {
+ g_object_unref (prop->priv->tooltip);
}
if (tooltip == NULL) {
- priv->tooltip = ibus_text_new_from_static_string ("");
- g_object_ref_sink (priv->tooltip);
+ prop->priv->tooltip = ibus_text_new_from_static_string ("");
}
else {
- priv->tooltip = tooltip;
- g_object_ref_sink (priv->tooltip);
+ prop->priv->tooltip = tooltip;
+ g_object_ref_sink (prop->priv->tooltip);
}
}
--
2.33.1
From ad95015dc411f84dd9b8869e596e4707cd2ccd2b Mon Sep 17 00:00:00 2001
From: Sibo Dong <46512211+dongsibo@users.noreply.github.com>
Date: Wed, 2 Feb 2022 19:18:02 +0900
Subject: [PATCH] ui/gtk3: Update man page for Emoji shortcut key
The default Emoji shortcut key was changed but not updated in
the ibus-emoji.7 man page.
BUG=https://github.com/ibus/ibus/pull/2353
---
ui/gtk3/ibus-emoji.7.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/gtk3/ibus-emoji.7.in b/ui/gtk3/ibus-emoji.7.in
index 9c6d3c6f..b4d941ec 100644
--- a/ui/gtk3/ibus-emoji.7.in
+++ b/ui/gtk3/ibus-emoji.7.in
@@ -1,8 +1,8 @@
.\" This file is distributed under the same license as the ibus
.\" package.
-.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2017-2018.
+.\" Copyright (C) Takao Fujiwara <takao.fujiwara1@gmail.com>, 2017-2022.
.\"
-.TH "IBUS EMOJI" 7 "August 2018" "@VERSION@" "User Commands"
+.TH "IBUS EMOJI" 7 "February 2022" "@VERSION@" "User Commands"
.SH NAME
.B ibus-emoji
\- Call the IBus emoji utility by
@@ -51,7 +51,7 @@ E.g. "Noto Color Emoji", "Android Emoji" font.
.SH "KEYBOARD OPERATIONS"
.TP
-\fBControl-Shift-e\fR
+\fBControl-Period or Control-Semicolon\fR
Launch IBus Emojier. The shortcut key can be customized by
.B ibus\-setup (1).
.TP
--
2.33.1
From 0f1485bfa687386f26ef5909c123e0ae2e3e11b9 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 3 Feb 2022 14:03:30 +0900
Subject: [PATCH] src: Add IBUS_INPUT_HINT_PRIVATE for browser private mode
GTK4 added GTK_INPUT_HINT_PRIVATE recently for Web brower
private or guest mode.
BUG=https://github.com/ibus/ibus/issues/2315
---
src/ibustypes.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/ibustypes.h b/src/ibustypes.h
index 798ad04d..990659ac 100644
--- a/src/ibustypes.h
+++ b/src/ibustypes.h
@@ -2,7 +2,8 @@
/* vim:set et sts=4: */
/* ibus - The Input Bus
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2008-2020 Red Hat, Inc.
+ * Copyright (C) 2010-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -300,6 +301,8 @@ typedef enum
* @IBUS_INPUT_HINT_VERTICAL_WRITING: The text is vertical. Since 1.5.11
* @IBUS_INPUT_HINT_EMOJI: Suggest offering Emoji support. Since 1.5.24
* @IBUS_INPUT_HINT_NO_EMOJI: Suggest not offering Emoji support. Since 1.5.24
+ * @IBUS_INPUT_HINT_PRIVATE: Request that the input method should not
+ * update personalized data (like typing history). Since 1.5.26
*
* Describes hints that might be taken into account by engines. Note
* that engines may already tailor their behaviour according to the
@@ -326,7 +329,8 @@ typedef enum
IBUS_INPUT_HINT_INHIBIT_OSK = 1 << 7,
IBUS_INPUT_HINT_VERTICAL_WRITING = 1 << 8,
IBUS_INPUT_HINT_EMOJI = 1 << 9,
- IBUS_INPUT_HINT_NO_EMOJI = 1 << 10
+ IBUS_INPUT_HINT_NO_EMOJI = 1 << 10,
+ IBUS_INPUT_HINT_PRIVATE = 1 << 11
} IBusInputHints;
#endif
--
2.33.1
From 787b564982d17017cb35ab87b71b6a16d7440387 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 3 Feb 2022 14:34:34 +0900
Subject: [PATCH] bus: mkdir socket dirs instead of socket paths
IBus ran mkdir for socket paths for --address=unix:path
but should does the socket directories instead.
BUG=https://github.com/ibus/ibus/issues/2363
---
bus/server.c | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/bus/server.c b/bus/server.c
index e8d0ce2b..6abf8427 100644
--- a/bus/server.c
+++ b/bus/server.c
@@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* bus - The Input Bus
* Copyright (C) 2008-2010 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2011-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2011-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
@@ -38,14 +38,14 @@ static GDBusServer *server = NULL;
static GMainLoop *mainloop = NULL;
static BusDBusImpl *dbus = NULL;
static BusIBusImpl *ibus = NULL;
-static gchar *address = NULL;
+static char *address = NULL;
static gboolean _restart = FALSE;
static void
_restart_server (void)
{
- gchar *exe;
- gint fd;
+ char *exe;
+ int fd;
ssize_t r;
int MAXSIZE = 0xFFF;
char proclnk[MAXSIZE];
@@ -201,11 +201,11 @@ bus_acquired_handler (GDBusConnection *connection,
NULL);
}
-static gchar *
+static char *
_bus_extract_address (void)
{
- gchar *socket_address = g_strdup (g_address);
- gchar *p;
+ char *socket_address = g_strdup (g_address);
+ char *p;
#define IF_REPLACE_VARIABLE_WITH_FUNC(variable, func, format) \
if ((p = g_strstr_len (socket_address, -1, (variable)))) { \
@@ -242,12 +242,12 @@ bus_server_init (void)
#define IBUS_UNIX_ABSTRACT "unix:abstract="
#define IBUS_UNIX_DIR "unix:dir="
- gchar *socket_address;
+ char *socket_address;
GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE;
- gchar *guid;
+ char *guid;
GDBusAuthObserver *observer;
GError *error = NULL;
- gchar *unix_dir = NULL;
+ char *unix_dir = NULL;
dbus = bus_dbus_impl_get_default ();
ibus = bus_ibus_impl_get_default ();
@@ -256,18 +256,24 @@ bus_server_init (void)
/* init server */
socket_address = _bus_extract_address ();
-#define IF_GET_UNIX_DIR(prefix) \
+#define IF_GET_UNIX_DIR_FROM_DIR(prefix) \
if (g_str_has_prefix (socket_address, (prefix))) { \
unix_dir = g_strdup (socket_address + strlen (prefix)); \
}
+#define IF_GET_UNIX_DIR_FROM_PATH(prefix) \
+ if (g_str_has_prefix (socket_address, (prefix))) { \
+ const char *unix_path = socket_address + strlen (prefix); \
+ unix_dir = g_path_get_dirname (unix_path); \
+ }
+
- IF_GET_UNIX_DIR (IBUS_UNIX_TMPDIR)
+ IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_TMPDIR)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_PATH)
+ IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_PATH)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_ABSTRACT)
+ IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_ABSTRACT)
else
- IF_GET_UNIX_DIR (IBUS_UNIX_DIR)
+ IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_DIR)
else {
g_error ("Your socket address \"%s\" does not correspond with "
"one of the following formats; "
@@ -329,7 +335,8 @@ bus_server_init (void)
bus_acquired_handler,
NULL, NULL, NULL, NULL);
-#undef IF_GET_UNIX_DIR
+#undef IF_GET_UNIX_DIR_FROM_DIR
+#undef IF_GET_UNIX_DIR_FROM_PATH
#undef IBUS_UNIX_TMPDIR
#undef IBUS_UNIX_PATH
#undef IBUS_UNIX_ABSTRACT
--
2.33.1
From dfd3fbf26fa4b5ff20512b166a8dd321afc10344 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Thu, 3 Feb 2022 17:31:08 +0900
Subject: [PATCH] bus: Do not mkdir abstract unix socket
IBus ran mkdir for unix abstract sockets for --address=unix:abstract
but should not need to mkdir.
BUG=https://github.com/ibus/ibus/issues/2363
---
bus/server.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/bus/server.c b/bus/server.c
index 6abf8427..968d5346 100644
--- a/bus/server.c
+++ b/bus/server.c
@@ -265,13 +265,15 @@ bus_server_init (void)
const char *unix_path = socket_address + strlen (prefix); \
unix_dir = g_path_get_dirname (unix_path); \
}
+#define IF_GET_UNIX_DIR_FROM_ABSTRACT(prefix) \
+ if (g_str_has_prefix (socket_address, (prefix))) {}
IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_TMPDIR)
else
IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_PATH)
else
- IF_GET_UNIX_DIR_FROM_PATH (IBUS_UNIX_ABSTRACT)
+ IF_GET_UNIX_DIR_FROM_ABSTRACT (IBUS_UNIX_ABSTRACT)
else
IF_GET_UNIX_DIR_FROM_DIR (IBUS_UNIX_DIR)
else {
@@ -281,7 +283,8 @@ bus_server_init (void)
IBUS_UNIX_ABSTRACT "FILE, " IBUS_UNIX_DIR "DIR.",
socket_address);
}
- if (!g_file_test (unix_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
+ if (unix_dir &&
+ !g_file_test (unix_dir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
/* Require mkdir for BSD system.
* The mode 0700 can eliminate malicious users change the mode.
* `chmod` runs for the last directory only not to change the modes
@@ -337,6 +340,7 @@ bus_server_init (void)
#undef IF_GET_UNIX_DIR_FROM_DIR
#undef IF_GET_UNIX_DIR_FROM_PATH
+#undef IF_GET_UNIX_DIR_FROM_ABSTRACT
#undef IBUS_UNIX_TMPDIR
#undef IBUS_UNIX_PATH
#undef IBUS_UNIX_ABSTRACT
--
2.33.1
From c69b61aa66239e1b13c9764b2d3bf6f02d086785 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Fri, 4 Feb 2022 15:08:36 +0900
Subject: [PATCH] src: Fix ibus_key_event_from_string for
gobject-introspection
BUG=https://github.com/ibus/ibus/issues/2330
---
src/ibusshare.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ibusshare.h b/src/ibusshare.h
index d70af29f..d739e2ff 100644
--- a/src/ibusshare.h
+++ b/src/ibusshare.h
@@ -2,8 +2,8 @@
/* vim:set et sts=4: */
/* ibus - The Input Bus
* Copyright (C) 2008-2013 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2015-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
- * Copyright (C) 2008-2018 Red Hat, Inc.
+ * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2008-2022 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -333,8 +333,8 @@ gchar *ibus_key_event_to_string
/**
* ibus_key_event_from_string:
* @string: Key event string.
- * @keyval: Variable that hold key symbol result.
- * @modifiers: Variable that hold modifiers result.
+ * @keyval: (out): Variable that hold key symbol result.
+ * @modifiers: (out): Variable that hold modifiers result.
*
* Parse key event string and return key symbol and modifiers.
*
--
2.33.1
From a076b388d856aeb4c8f8317dd6cd9dd6d61fe9ac Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 4 Nov 2020 10:48:45 +0100
Subject: [PATCH] src, client/x11: Add systemd unit file
This so far depends on GNOME targets, and is thus just usable there.
Other DEs wishing to use systemd and ibus will need to add the
necessary dependencies where applicable.
There are 2 scenarios here:
- On X11 sessions, ibus-daemon will be launched with --xim parameter,
so ibus-x11 is started with it.
- On Wayland sessions, ibus-daemon will be started without XIM support,
ibus-x11 will be launched and tear down together with all other
session X11 services while Xwayland is running.
For the second part of the second situation, additionally install
a script at /etc/xdg/Xwayland-session.d, which takes care of X11
service initialization together with the Xwayland instance.
BUG=https://github.com/ibus/ibus/pull/2377
---
client/x11/10-ibus-x11.in | 2 ++
client/x11/Makefile.am | 18 ++++++++++++
configure.ac | 17 +++++++++++
src/Makefile.am | 16 +++++++++++
....freedesktop.IBus.session.GNOME.service.in | 28 +++++++++++++++++++
5 files changed, 81 insertions(+)
create mode 100755 client/x11/10-ibus-x11.in
create mode 100644 bus/services/org.freedesktop.IBus.session.GNOME.service.in
diff --git a/client/x11/10-ibus-x11.in b/client/x11/10-ibus-x11.in
new file mode 100755
index 00000000..973cbb6f
--- /dev/null
+++ b/client/x11/10-ibus-x11.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+@libexecdir@/ibus-x11 &
diff --git a/client/x11/Makefile.am b/client/x11/Makefile.am
index 12de6ea8..90454bcf 100644
--- a/client/x11/Makefile.am
+++ b/client/x11/Makefile.am
@@ -67,6 +67,16 @@ noinst_HEADERS = \
locales.h \
$(NULL)
+xwaylandsessiond_in_files = 10-ibus-x11.in
+xwaylandsessiond_DATA = $(xwaylandsessiond_in_files:.in=)
+xwaylandsessionddir=$(sysconfdir)/xdg/Xwayland-session.d
+
+10-ibus-x11: 10-ibus-x11.in
+ $(AM_V_GEN) sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@.tmp && mv $@.tmp $@
+
+install-data-hook:
+ chmod 755 $(DESTDIR)$(xwaylandsessionddir)/10-ibus-x11
+
$(libIMdkit):
(cd $(top_builddir)/util/IMdkit; make)
@@ -81,4 +91,12 @@ locales.h:
xargs python -c 'import sys;print "#define LOCALES_STRING \"%s\"" % ",".join(sys.argv[1:])' \
) > $@
+CLEANFILES = \
+ $(xwaylandsessiond_DATA) \
+ $(NULL)
+
+EXTRA_DIST = \
+ 10-ibus-x11.in \
+ $(NULL)
+
-include $(top_srcdir)/git.mk
diff --git a/configure.ac b/configure.ac
index ce096ad3..73c5e429 100644
--- a/configure.ac
+++ b/configure.ac
@@ -393,6 +393,22 @@ if test x"$enable_dconf" = x"yes"; then
enable_dconf="yes (enabled, use --disable-dconf to disable)"
fi
+AC_ARG_ENABLE(systemd-services,
+ AS_HELP_STRING([--disable-systemd-services],
+ [Disable systemd services installation]),
+ [enable_systemd=$enableval],
+ [enable_systemd=yes]
+)
+AM_CONDITIONAL([ENABLE_SYSTEMD], [test x"$enable_systemd" = x"yes"])
+
+if test x"$enable_systemd" = x"yes"; then
+ PKG_CHECK_MODULES(SYSTEMD, [
+ systemd >= 0.7.5
+ ])
+ AC_SUBST([SYSTEMD_USER_UNIT_DIR], [`$PKG_CONFIG --variable systemduserunitdir systemd`])
+ enable_systemd="yes (enabled, use --disable-systemd-services to disable)"
+fi
+
# Check env.
AC_PATH_PROG(ENV_IBUS_TEST, env)
AC_SUBST(ENV_IBUS_TEST)
@@ -860,6 +876,7 @@ Build options:
UCD directory $UCD_DIR
Socket directory "$IBUS_SOCKET_DIR"
XFixes client disconnect $have_xfixes
+ Install systemd service $enable_systemd
Run test cases $enable_tests
Install tests $enable_install_tests
])
diff --git a/src/Makefile.am b/src/Makefile.am
index 578694b5..bbaa6c90 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -317,6 +317,11 @@ install-data-hook:
rm "$(DESTDIR)$(dictdir)/$$file" || exit $$?; \
fi; \
done
+ $(MKDIR_P) "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants/"
+ ( \
+ cd "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants" ; \
+ $(LN_S) -f "../org.freedesktop.IBus.session.GNOME.service" .; \
+ )
emoji_parser_SOURCES = \
emoji-parser.c \
@@ -383,7 +388,17 @@ clean-local:
$(NULL)
endif
+if ENABLE_SYSTEMD
+systemdservice_in_files = org.freedesktop.IBus.session.GNOME.service.in
+systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
+systemdservicedir=$(SYSTEMD_USER_UNIT_DIR)
+
+org.freedesktop.IBus.session.GNOME.service: org.freedesktop.IBus.session.GNOME.service.in
+ $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" $< > $@.tmp && mv $@.tmp $@
+endif
+
EXTRA_DIST = \
+ org.freedesktop.IBus.session.GNOME.service.in \
emoji-parser.c \
ibusversion.h.in \
ibusmarshalers.list \
@@ -393,6 +408,7 @@ EXTRA_DIST = \
$(NULL)
CLEANFILES += \
+ $(systemdservice_DATA) \
$(BUILT_SOURCES) \
stamp-ibusmarshalers.h \
stamp-ibusenumtypes.h \
diff --git a/bus/services/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
new file mode 100644
index 00000000..76444dbd
--- /dev/null
+++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
@@ -0,0 +1,28 @@
+[Unit]
+Description=IBus Daemon
+CollectMode=inactive-or-failed
+
+# Require GNOME session and specify startup ordering
+Requisite=gnome-session-initialized.target
+After=gnome-session-initialized.target
+PartOf=gnome-session-initialized.target
+Before=gnome-session.target
+
+# Needs to run when DISPLAY/WAYLAND_DISPLAY is set
+After=gnome-session-initialized.target
+PartOf=gnome-session-initialized.target
+
+# Never run in GDM
+Conflicts=gnome-session@gnome-login.target
+
+[Service]
+Type=dbus
+# Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
+ExecStart=sh -c '@bindir@/ibus-daemon --panel disable $([[ $XDG_SESSION_TYPE == "x11" ]] && echo "--xim")'
+Restart=on-abnormal
+BusName=org.freedesktop.IBus
+TimeoutStopSec=5
+Slice=session.slice
+
+[Install]
+WantedBy=gnome-session.target
--
2.33.1
From 9a87a78549cb938c4810bcd311dd36823afd0fcd Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Sat, 12 Feb 2022 10:50:54 +0900
Subject: [PATCH] src/services: Add org.freedesktop.IBus.session.generic.service
Move bus/*.service.in & src/*.service.in into bus/services
BUG=https://github.com/ibus/ibus/pull/2381
---
bus/Makefile.am | 16 +----
bus/services/Makefile.am | 68 +++++++++++++++++++
.../org.freedesktop.IBus.service.in | 0
....freedesktop.IBus.session.GNOME.service.in | 2 +-
...reedesktop.IBus.session.generic.service.in | 15 ++++
configure.ac | 48 ++++++-------
src/Makefile.am | 16 -----
7 files changed, 112 insertions(+), 53 deletions(-)
create mode 100644 bus/services/Makefile.am
create mode 100644 bus/services/org.freedesktop.IBus.service.in
create mode 100644 bus/services/org.freedesktop.IBus.session.generic.service.in
diff --git a/bus/Makefile.am b/bus/Makefile.am
index 4383a874..e173ee25 100644
--- a/bus/Makefile.am
+++ b/bus/Makefile.am
@@ -3,8 +3,8 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2013 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2013-2018 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2018 Red Hat, Inc.
+# Copyright (c) 2013-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2022 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -22,6 +22,7 @@
# USA
NULL =
+SUBDIRS = . services
libibus = $(top_builddir)/src/libibus-@IBUS_API_VERSION@.la
@@ -190,15 +191,4 @@ man_onedir = $(mandir)/man1
%.1.gz: %.1
$(AM_V_GEN) gzip -c $< > $@.tmp && mv $@.tmp $@
-
-dbusservice_in_files = org.freedesktop.IBus.service.in
-dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
-dbusservicedir=${datadir}/dbus-1/services
-
-org.freedesktop.IBus.service: org.freedesktop.IBus.service.in
- $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" -e "s|\@xim_cli_arg\@|$(XIM_CLI_ARG)|" $< > $@.tmp && mv $@.tmp $@
-
-EXTRA_DIST += $(dbusservice_in_files)
-CLEANFILES += $(dbusservice_DATA)
-
-include $(top_srcdir)/git.mk
diff --git a/bus/services/Makefile.am b/bus/services/Makefile.am
new file mode 100644
index 00000000..53c21f58
--- /dev/null
+++ b/bus/services/Makefile.am
@@ -0,0 +1,68 @@
+# vim:set noet ts=4:
+#
+# ibus - The Input Bus
+#
+# Copyright (c) 2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2022 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+# USA
+
+NULL =
+
+# Originally this file was added for GNOME but seems not to be used
+# at present.
+#
+# TODO: Check if flatpack uses this file and we could rename
+# org.freedesktop.IBus.service to org.freedesktop.IBus.DBus.GNOME.service
+dbusservice_in_files = org.freedesktop.IBus.service.in
+dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
+dbusservicedir=${datadir}/dbus-1/services
+
+systemdservice_in_files = \
+ org.freedesktop.IBus.session.generic.service.in \
+ org.freedesktop.IBus.session.GNOME.service.in \
+ $(NULL)
+
+%.service: %.service.in
+ $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" \
+ -e "s|\@xim_cli_arg\@|$(XIM_CLI_ARG)|" $< > $@.tmp && \
+ mv $@.tmp $@
+
+if ENABLE_SYSTEMD
+systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
+systemdservicedir = $(SYSTEMD_USER_UNIT_DIR)
+
+# in install-data-hook.
+install-data-hook:
+ $(MKDIR_P) "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants/"
+ ( \
+ cd "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants" ; \
+ $(LN_S) -f "../org.freedesktop.IBus.session.GNOME.service" .; \
+ )
+ $(NULL)
+endif
+
+EXTRA_DIST = \
+ $(dbusservice_in_files) \
+ $(systemdservice_in_files) \
+ $(NULL)
+
+CLEANFILES = \
+ $(dbusservice_DATA) \
+ $(systemdservice_DATA) \
+ $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/bus/org.freedesktop.IBus.service.in b/bus/services/org.freedesktop.IBus.service.in
new file mode 100644
index 00000000..9d493159
--- /dev/null
+++ b/bus/services/org.freedesktop.IBus.service.in
@@ -0,0 +1,3 @@
+[D-BUS Service]
+Name=org.freedesktop.IBus
+Exec=@bindir@/ibus-daemon --replace --panel disable @xim_cli_arg@
diff --git a/bus/services/org.freedesktop.IBus.session.GNOME.service.in b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
index 76444dbd..a99370fa 100644
--- a/bus/services/org.freedesktop.IBus.session.GNOME.service.in
+++ b/bus/services/org.freedesktop.IBus.session.GNOME.service.in
@@ -1,5 +1,5 @@
[Unit]
-Description=IBus Daemon
+Description=IBus Daemon for GNOME
CollectMode=inactive-or-failed
# Require GNOME session and specify startup ordering
diff --git a/bus/services/org.freedesktop.IBus.session.generic.service.in b/bus/services/org.freedesktop.IBus.session.generic.service.in
new file mode 100644
index 00000000..9d493159
--- /dev/null
+++ b/bus/services/org.freedesktop.IBus.session.generic.service.in
@@ -0,0 +1,15 @@
+[Unit]
+Description=IBus Daemon for generic sessions
+CollectMode=inactive-or-failed
+
+# Never run in GNOME
+Conflicts=gnome-session-initialized.target
+
+[Service]
+Type=dbus
+# Only pull --xim in X11 session, it is done via Xwayland-session.d on Wayland
+ExecStart=sh -c '@bindir@/ibus-daemon $IBUS_DAEMON_ARGS'
+Restart=on-abnormal
+BusName=org.freedesktop.IBus
+TimeoutStopSec=5
+Slice=session.slice
diff --git a/configure.ac b/configure.ac
index 73c5e429..4137e6cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,8 +3,8 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2016 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2015-2021 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2021 Red Hat, Inc.
+# Copyright (c) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2022 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -791,24 +791,22 @@ AC_SUBST(XKBCONFIG_BASE)
AC_SUBST([GDBUS_CODEGEN], [`$PKG_CONFIG --variable gdbus_codegen gio-2.0`])
# OUTPUT files
-AC_CONFIG_FILES([ po/Makefile.in
-Makefile
-ibus-1.0.pc
-ibus.spec
+AC_CONFIG_FILES([
+po/Makefile.in
+bindings/Makefile
+bindings/pygobject/Makefile
+bindings/vala/Makefile
+bus/Makefile
+bus/services/Makefile
client/Makefile
client/gtk2/Makefile
client/gtk3/Makefile
client/gtk4/Makefile
client/x11/Makefile
client/wayland/Makefile
-src/Makefile
-src/ibusversion.h
-src/tests/Makefile
-bus/Makefile
-portal/Makefile
-engine/Makefile
-util/Makefile
-util/IMdkit/Makefile
+conf/Makefile
+conf/dconf/Makefile
+conf/memconf/Makefile
data/Makefile
data/annotations/Makefile
data/icons/Makefile
@@ -819,20 +817,24 @@ docs/Makefile
docs/reference/Makefile
docs/reference/ibus/ibus-docs.sgml
docs/reference/ibus/Makefile
-m4/Makefile
+engine/Makefile
ibus/_config.py
ibus/Makefile
ibus/interface/Makefile
-ui/Makefile
-ui/gtk3/Makefile
+m4/Makefile
+portal/Makefile
setup/Makefile
-bindings/Makefile
-bindings/pygobject/Makefile
-bindings/vala/Makefile
-conf/Makefile
-conf/dconf/Makefile
-conf/memconf/Makefile
+src/Makefile
+src/ibusversion.h
+src/tests/Makefile
tools/Makefile
+ui/Makefile
+ui/gtk3/Makefile
+util/Makefile
+util/IMdkit/Makefile
+Makefile
+ibus-1.0.pc
+ibus.spec
])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index bbaa6c90..578694b5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -317,11 +317,6 @@ install-data-hook:
rm "$(DESTDIR)$(dictdir)/$$file" || exit $$?; \
fi; \
done
- $(MKDIR_P) "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants/"
- ( \
- cd "$(DESTDIR)$(SYSTEMD_USER_UNIT_DIR)/gnome-session.target.wants" ; \
- $(LN_S) -f "../org.freedesktop.IBus.session.GNOME.service" .; \
- )
emoji_parser_SOURCES = \
emoji-parser.c \
@@ -388,17 +383,7 @@ clean-local:
$(NULL)
endif
-if ENABLE_SYSTEMD
-systemdservice_in_files = org.freedesktop.IBus.session.GNOME.service.in
-systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
-systemdservicedir=$(SYSTEMD_USER_UNIT_DIR)
-
-org.freedesktop.IBus.session.GNOME.service: org.freedesktop.IBus.session.GNOME.service.in
- $(AM_V_GEN) sed -e "s|\@bindir\@|$(bindir)|" $< > $@.tmp && mv $@.tmp $@
-endif
-
EXTRA_DIST = \
- org.freedesktop.IBus.session.GNOME.service.in \
emoji-parser.c \
ibusversion.h.in \
ibusmarshalers.list \
@@ -408,7 +393,6 @@ EXTRA_DIST = \
$(NULL)
CLEANFILES += \
- $(systemdservice_DATA) \
$(BUILT_SOURCES) \
stamp-ibusmarshalers.h \
stamp-ibusenumtypes.h \
--
2.33.1
From e325fc21b492eee83cb93712472495059395dc7b Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Sat, 12 Feb 2022 11:02:29 +0900
Subject: [PATCH] src/tests: Fix typos
- test_metas_in location
- Check ibus processes in CI
- Fix libexec path
---
src/tests/Makefile.am | 8 ++++----
src/tests/ibus-desktop-testing-autostart | 2 ++
src/tests/ibus-desktop-testing.desktop.in | 2 +-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 7d00f236..f932f18f 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -3,7 +3,7 @@
# ibus - The Input Bus
#
# Copyright (c) 2007-2015 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) 2007-2018 Red Hat, Inc.
#
# This library is free software; you can redistribute it and/or
@@ -117,11 +117,11 @@ org.freedesktop.IBus.Desktop.Testing.desktop: ibus-desktop-testing.desktop.in
mv $@.tmp $@
endif
-$(test_metas): $(test_metas_in) $(test_programs)
+$(test_metas): $(test_metas_in)
f=`echo $@ | sed -e 's/\.test//'`; \
TEST_EXEC=$(test_execsdir)/$$f; \
- sed -e "s|@TEST_EXEC[@]|$$TEST_EXEC|g" $(test_metas_in) > $@.tmp; \
- mv $@.tmp $@; \
+ sed -e "s|@TEST_EXEC[@]|$$TEST_EXEC|g" $(srcdir)/$(test_metas_in) \
+ > $@.tmp && mv $@.tmp $@; \
$(NULL)
ibus-compose-locales: ibus-compose-locales.in
diff --git a/src/tests/ibus-desktop-testing-autostart b/src/tests/ibus-desktop-testing-autostart
index da22b64e..1e1eb180 100755
--- a/src/tests/ibus-desktop-testing-autostart
+++ b/src/tests/ibus-desktop-testing-autostart
@@ -29,6 +29,8 @@ 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
diff --git a/src/tests/ibus-desktop-testing.desktop.in b/src/tests/ibus-desktop-testing.desktop.in
index fa0c9b40..1b815345 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=@ibexecdir@/ibus-desktop-testing-autostart /var/tmp/ibus-ci-autostart.log
+Exec=@libexecdir@/ibus-desktop-testing-autostart /var/tmp/ibus-ci-autostart.log
Terminal=false
Type=Application
Encoding=UTF-8
--
2.33.1