Accepting request 1130443 from home:hillwood:branches:M17N

- Update version to 1.5.29
  * Add DeleteSurroundingText to PostProcessKeyEvent
  * Add preedit D-Bus signals to PostProcessKeyEvent
  * Tab should not be committed by IM
  * Translate keycodes with CapsLock
  * Update org.freedesktop.ibus.gschema.xml
  * Implement Plasma Wayland
  * Distinguish Arabic XKB and Keypad XKB options
  * Update simple.xml with xkeyboard-config 2.39
  * Fix key typing issues
  * Fix Emoji and Unicode issues
  * Fix setup dialog SEGV
  * Fix remote desktop issue
  * Enhance CI
  * Update translations
- Drop ibus-fix-key-release.patch, merged by upstream

OBS-URL: https://build.opensuse.org/request/show/1130443
OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=281
This commit is contained in:
Hillwood Yang 2023-12-02 11:51:55 +00:00 committed by Git OBS Bridge
parent 3070747703
commit 4aba617412
8 changed files with 54 additions and 444 deletions

BIN
ibus-1.5.28.tar.gz (Stored with Git LFS)

Binary file not shown.

3
ibus-1.5.29-rc2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3a27ed120485b2077c62e36e788c302f34544ceac3b3b9cda28b7418e8051415
size 3991416

View File

@ -1,7 +1,7 @@
diff -Nur ibus-1.5.22/ui/gtk3/panel.vala ibus-1.5.22-new/ui/gtk3/panel.vala
--- ibus-1.5.22/ui/gtk3/panel.vala 2020-02-21 20:46:17.000000000 +0800
+++ ibus-1.5.22-new/ui/gtk3/panel.vala 2020-02-24 17:55:17.718453204 +0800
@@ -1053,7 +1053,7 @@
diff -Nur ibus-1.5.29/ui/gtk3/panel.vala ibus-1.5.29-new/ui/gtk3/panel.vala
--- ibus-1.5.29/ui/gtk3/panel.vala 2023-11-30 23:08:12.858426343 +0800
+++ ibus-1.5.29-new/ui/gtk3/panel.vala 2023-11-30 23:08:43.015089972 +0800
@@ -1361,7 +1361,7 @@
private void show_setup_dialog() {
if (m_setup_pid != 0) {

View File

@ -1,411 +0,0 @@
From 7da18d08ce85405e41ba7bf363661292bc97ca39 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 22 Feb 2023 23:53:35 +0900
Subject: [PATCH] src: Call IBUS_TYPE_EMOJI_DATA in ibus_init()
Seems the evaluation of IBUS_EMOJI_DATA() depends on the compiler
optimization.
BUG=https://github.com/ibus/ibus/issues/2476
---
src/ibusshare.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/ibusshare.c b/src/ibusshare.c
index 340168c8..bb59f3cb 100644
--- a/src/ibusshare.c
+++ b/src/ibusshare.c
@@ -308,12 +308,15 @@ ibus_init (void)
IBUS_TYPE_TEXT;
IBUS_TYPE_ATTRIBUTE;
IBUS_TYPE_ATTR_LIST;
- IBUS_TYPE_LOOKUP_TABLE;
IBUS_TYPE_COMPONENT;
+ IBUS_TYPE_EMOJI_DATA;
IBUS_TYPE_ENGINE_DESC;
+ IBUS_TYPE_LOOKUP_TABLE;
IBUS_TYPE_OBSERVED_PATH;
IBUS_TYPE_REGISTRY;
IBUS_TYPE_X_EVENT;
+ IBUS_TYPE_UNICODE_BLOCK;
+ IBUS_TYPE_UNICODE_DATA;
_ibus_register_resource ();
}
--
2.38.1
From 9d9dca9e103e88b33e786c4a46f44123a6cf11c6 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 8 Mar 2023 19:44:16 +0900
Subject: [PATCH] client/x11: Fix Key typing order
ibus-x11 now also uses the hybrid process key events with
IBUS_ENABLE_SYNC_MODE=2 and it waits for the async API
with GSource and g_main_context_iteration() in xim_forward_event().
But g_main_context_iteration() calls gdk_event_source_dispatch()
and it can call another xim_forward_event() and the callbacks
of ibus_input_context_process_key_event_async() can be nested.
So if the forwarding API is called out of the callbacks of
ibus_input_context_process_key_event_async(), the key events
order is swapped due to the delayed return of
g_main_context_iteration().
To resolve this issue, the forwarding API should be called in
the callbacks of ibus_input_context_process_key_event_async().
BUG=https://github.com/ibus/ibus/issues/2480
---
client/x11/main.c | 160 ++++++++++++++++++++++++----------------------
1 file changed, 83 insertions(+), 77 deletions(-)
diff --git a/client/x11/main.c b/client/x11/main.c
index 905fd251..83d95cb7 100644
--- a/client/x11/main.c
+++ b/client/x11/main.c
@@ -2,7 +2,7 @@
/* vim:set et sts=4: */
/* ibus
* Copyright (C) 2007-2015 Peng Huang <shawn.p.huang@gmail.com>
- * Copyright (C) 2015-2022 Takao Fujiwara <takao.fujiwara1@gmail.com>
+ * Copyright (C) 2015-2023 Takao Fujiwara <takao.fujiwara1@gmail.com>
* Copyright (C) 2007-2015 Red Hat, Inc.
*
* main.c:
@@ -49,6 +49,8 @@
#include <getopt.h>
#define ESC_SEQUENCE_ISO10646_1 "\033%G"
+/* Wait for about 120 secs to return a key from async process-key-event. */
+#define MAX_WAIT_KEY_TIME 120000
#define LOG(level, fmt_args...) \
if (g_debug_level >= (level)) { \
@@ -461,11 +463,39 @@ xim_unset_ic_focus (XIMS xims, IMChangeFocusStruct *call_data)
}
+static void
+_xim_forward_key_event_done (X11IC *x11ic,
+ XEvent *event,
+ gboolean processed)
+{
+ IMForwardEventStruct fe;
+ if (processed) {
+ if (!x11ic->has_preedit_area) {
+ _xim_set_cursor_location (x11ic);
+ }
+ return;
+ }
+ g_assert (x11ic);
+ g_assert (event);
+
+ memset (&fe, 0, sizeof (fe));
+ fe.major_code = XIM_FORWARD_EVENT;
+ fe.icid = x11ic->icid;
+ fe.connect_id = x11ic->connect_id;
+ fe.sync_bit = 0;
+ fe.serial_number = 0L;
+ fe.event = *event;
+ IMForwardEvent (_xims, (XPointer) &fe);
+}
+
+
typedef struct {
- IMForwardEventStruct *pfe;
int count;
guint count_cb_id;
gboolean retval;
+ X11IC *x11ic;
+ CARD16 connect_id;
+ XEvent event;
} ProcessKeyEventReplyData;
static void
@@ -474,7 +504,7 @@ _process_key_event_done (GObject *object,
gpointer user_data)
{
IBusInputContext *context = (IBusInputContext *)object;
- IMForwardEventStruct *pfe = (IMForwardEventStruct*) user_data;
+ ProcessKeyEventReplyData *data = (ProcessKeyEventReplyData *)user_data;
GError *error = NULL;
gboolean retval = ibus_input_context_process_key_event_async_finish (
@@ -488,16 +518,15 @@ _process_key_event_done (GObject *object,
}
if (g_hash_table_lookup (_connections,
- GINT_TO_POINTER ((gint) pfe->connect_id))
+ GINT_TO_POINTER ((gint)data->connect_id))
== NULL) {
- g_slice_free (IMForwardEventStruct, pfe);
+ g_slice_free (ProcessKeyEventReplyData, data);
return;
}
- if (retval == FALSE) {
- IMForwardEvent (_xims, (XPointer) pfe);
- }
- g_slice_free (IMForwardEventStruct, pfe);
+ if (retval == FALSE)
+ _xim_forward_key_event_done (data->x11ic, &data->event, retval);
+ g_slice_free (ProcessKeyEventReplyData, data);
}
static void
@@ -518,6 +547,21 @@ _process_key_event_reply_done (GObject *object,
}
g_return_if_fail (data);
data->retval = retval;
+ if (g_hash_table_lookup (_connections,
+ GINT_TO_POINTER ((gint)data->connect_id))
+ == NULL) {
+ return;
+ }
+ /* _xim_forward_key_event_done() should be called in
+ * _process_key_event_reply_done() because g_main_context_iteration()
+ * can call another xim_forward_event() and xim_forward_event() can be
+ * nested and the first _process_key_event_reply_done() is returned
+ * at last with g_main_context_iteration() so
+ * if _xim_forward_key_event_done() is called out of
+ * _process_key_event_reply_done(), the key events order
+ * can be swapped.
+ */
+ _xim_forward_key_event_done (data->x11ic, &data->event, retval);
data->count = 0;
g_source_remove (data->count_cb_id);
}
@@ -529,9 +573,8 @@ _process_key_event_count_cb (gpointer user_data)
g_return_val_if_fail (data, G_SOURCE_REMOVE);
if (!data->count)
return G_SOURCE_REMOVE;
- /* Wait for about 10 secs. */
- if (data->count++ == 10000) {
- data->count = 0;
+ if (data->count++ == MAX_WAIT_KEY_TIME) {
+ g_warning ("Key event is not returned for %usecs.", MAX_WAIT_KEY_TIME);
return G_SOURCE_REMOVE;
}
return G_SOURCE_CONTINUE;
@@ -571,32 +614,13 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
event.keyval,
event.hardware_keycode - 8,
event.state);
- if (retval) {
- if (!x11ic->has_preedit_area) {
- _xim_set_cursor_location (x11ic);
- }
- return 1;
- }
-
- IMForwardEventStruct fe;
- memset (&fe, 0, sizeof (fe));
-
- fe.major_code = XIM_FORWARD_EVENT;
- fe.icid = x11ic->icid;
- fe.connect_id = x11ic->connect_id;
- fe.sync_bit = 0;
- fe.serial_number = 0L;
- fe.event = call_data->event;
-
- IMForwardEvent (_xims, (XPointer) &fe);
-
+ _xim_forward_key_event_done (x11ic, &call_data->event, retval);
retval = 1;
break;
}
case 2: {
GSource *source = g_timeout_source_new (1);
ProcessKeyEventReplyData *data = NULL;
- IMForwardEventStruct fe;
if (source)
data = g_slice_new0 (ProcessKeyEventReplyData);
@@ -610,11 +634,13 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
if (source)
g_source_destroy (source);
} else {
- CARD16 connect_id = x11ic->connect_id;
data->count = 1;
g_source_attach (source, NULL);
g_source_unref (source);
data->count_cb_id = g_source_get_id (source);
+ data->connect_id = call_data->connect_id;
+ data->x11ic = x11ic;
+ data->event = *((XEvent*)xevent);
ibus_input_context_process_key_event_async (
x11ic->context,
event.keyval,
@@ -626,7 +652,7 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
data);
g_source_set_callback (source, _process_key_event_count_cb,
data, NULL);
- while (data->count)
+ while (data->count > 0 && data->count < MAX_WAIT_KEY_TIME)
g_main_context_iteration (NULL, TRUE);
if (source->ref_count > 0) {
/* g_source_get_id() could causes a SEGV */
@@ -634,46 +660,33 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
"issue in %p.", source);
}
retval = data->retval;
- g_slice_free (ProcessKeyEventReplyData, data);
-
- if (g_hash_table_lookup (_connections,
- GINT_TO_POINTER ((gint)connect_id))
- == NULL) {
+ if (data->count == 0) {
+ g_slice_free (ProcessKeyEventReplyData, data);
return 1;
}
}
- if (retval) {
- if (! x11ic->has_preedit_area) {
- _xim_set_cursor_location (x11ic);
- }
- return 1;
+ g_slice_free (ProcessKeyEventReplyData, data);
+ if (g_hash_table_lookup (_connections,
+ GINT_TO_POINTER ((gint)call_data->connect_id))
+ == NULL) {
+ return 1;
}
-
- memset (&fe, 0, sizeof (fe));
-
- fe.major_code = XIM_FORWARD_EVENT;
- fe.icid = x11ic->icid;
- fe.connect_id = x11ic->connect_id;
- fe.sync_bit = 0;
- fe.serial_number = 0L;
- fe.event = call_data->event;
-
- IMForwardEvent (_xims, (XPointer) &fe);
-
+ _xim_forward_key_event_done (x11ic, &call_data->event, retval);
retval = 1;
break;
}
default: {
- IMForwardEventStruct *pfe;
+ ProcessKeyEventReplyData *data;
- pfe = g_slice_new0 (IMForwardEventStruct);
- pfe->major_code = XIM_FORWARD_EVENT;
- pfe->icid = x11ic->icid;
- pfe->connect_id = x11ic->connect_id;
- pfe->sync_bit = 0;
- pfe->serial_number = 0L;
- pfe->event = call_data->event;
+ if (!(data = g_slice_new0 (ProcessKeyEventReplyData))) {
+ g_warning ("Cannot allocate async data");
+ _xim_forward_key_event_done (x11ic, &call_data->event, 0);
+ return 1;
+ }
+ data->connect_id = call_data->connect_id;
+ data->x11ic = x11ic;
+ data->event = call_data->event;
ibus_input_context_process_key_event_async (
x11ic->context,
@@ -683,7 +696,7 @@ xim_forward_event (XIMS xims, IMForwardEventStruct *call_data)
-1,
NULL,
_process_key_event_done,
- pfe);
+ data);
retval = 1;
}
}
@@ -962,11 +975,10 @@ _xim_forward_key_event (X11IC *x11ic,
guint keycode,
guint state)
{
- g_return_if_fail (x11ic != NULL);
-
- IMForwardEventStruct fe = {0};
XEvent xkp = {0};
+ g_return_if_fail (x11ic != NULL);
+
xkp.xkey.type = (state & IBUS_RELEASE_MASK) ? KeyRelease : KeyPress;
xkp.xkey.serial = 0L;
xkp.xkey.send_event = False;
@@ -975,20 +987,14 @@ _xim_forward_key_event (X11IC *x11ic,
xkp.xkey.window =
x11ic->focus_window ? x11ic->focus_window : x11ic->client_window;
xkp.xkey.subwindow = None;
- xkp.xkey.root = DefaultRootWindow (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
+ xkp.xkey.root = DefaultRootWindow (
+ GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()));
xkp.xkey.time = 0;
xkp.xkey.state = state;
xkp.xkey.keycode = (keycode == 0) ? 0 : keycode + 8;
- fe.major_code = XIM_FORWARD_EVENT;
- fe.icid = x11ic->icid;
- fe.connect_id = x11ic->connect_id;
- fe.sync_bit = 0;
- fe.serial_number = 0L;
- fe.event = xkp;
-
- IMForwardEvent (_xims, (XPointer) & fe);
+ _xim_forward_key_event_done (x11ic, &xkp, FALSE);
}
static void
--
2.38.1
From 5b5d0795f297e330fdc84b6be6beab1305b0cda9 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Wed, 15 Mar 2023 10:22:05 +0900
Subject: [PATCH] util/IMdkit: Disable while loop before call
ForwardEventMessageProc()
Seems ProcessQueue() had a wrong XFree() with async process-key-event.
Fixes: c0fec89ae76f9522319f58107ab234992b249ec6
BUG=https://github.com/ibus/ibus/issues/2484
---
util/IMdkit/i18nPtHdr.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c
index 8dc52714..ec20e322 100644
--- a/util/IMdkit/i18nPtHdr.c
+++ b/util/IMdkit/i18nPtHdr.c
@@ -1747,11 +1747,13 @@ static void ProcessQueue (XIMS ims, CARD16 connect_id)
XimProtoHdr *hdr = (XimProtoHdr *) client->pending->p;
unsigned char *p1 = (unsigned char *) (hdr + 1);
IMProtocol call_data;
+ XIMPending *old = client->pending;
call_data.major_code = hdr->major_opcode;
call_data.any.minor_code = hdr->minor_opcode;
call_data.any.connect_id = connect_id;
+ client->pending = old->next;
switch (hdr->major_opcode)
{
case XIM_FORWARD_EVENT:
@@ -1760,12 +1762,7 @@ static void ProcessQueue (XIMS ims, CARD16 connect_id)
}
/*endswitch*/
XFree (hdr);
- {
- XIMPending *old = client->pending;
-
- client->pending = old->next;
- XFree (old);
- }
+ XFree (old);
}
/*endwhile*/
return;
--
2.39.2

View File

@ -1,17 +1,16 @@
diff --git a/ui/gtk3/panel.vala b/ui/gtk3/panel.vala
index 452b14c8..81c246a2 100644
--- a/ui/gtk3/panel.vala
+++ b/ui/gtk3/panel.vala
@@ -1292,7 +1292,7 @@ class Panel : IBus.PanelService {
m_sys_menu.append(new Gtk.SeparatorMenuItem());
diff -Nur ibus-1.5.29/ui/gtk3/panel.vala ibus-1.5.29-new/ui/gtk3/panel.vala
--- ibus-1.5.29/ui/gtk3/panel.vala 2023-12-02 16:13:18.091542008 +0800
+++ ibus-1.5.29-new/ui/gtk3/panel.vala 2023-12-02 16:19:05.450810285 +0800
@@ -1459,7 +1459,7 @@
m_sys_menu.append(new Gtk.SeparatorMenuItem());
item = new Gtk.MenuItem.with_label(_("Restart"));
- item.activate.connect((i) => m_bus.exit(true));
+ item.activate.connect((i) => restart_daemon());
m_sys_menu.append(item);
item = new Gtk.MenuItem.with_label(_("Restart"));
- item.activate.connect((i) => m_bus.exit(true));
+ item.activate.connect((i) => restart_daemon());
m_sys_menu.append(item);
item = new Gtk.MenuItem.with_label(_("Quit"));
@@ -1305,6 +1305,144 @@ class Panel : IBus.PanelService {
item = new Gtk.MenuItem.with_label(_("Quit"));
@@ -1474,6 +1474,144 @@
return m_sys_menu;
}
@ -153,6 +152,6 @@ index 452b14c8..81c246a2 100644
+ m_bus.exit(true);
+ }
+
private Gtk.Menu create_activate_menu() {
m_ime_menu = new Gtk.Menu();
private Gtk.Menu create_activate_menu(bool use_x11 = false) {
Gdk.Display display_backup = null;
if (use_x11 && !BindingCommon.default_is_xdisplay()) {

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Sat Dec 2 08:30:07 UTC 2023 - Hillwood Yang <hillwood@opensuse.org>
- Update version to 1.5.29
* Add DeleteSurroundingText to PostProcessKeyEvent
* Add preedit D-Bus signals to PostProcessKeyEvent
* Tab should not be committed by IM
* Translate keycodes with CapsLock
* Update org.freedesktop.ibus.gschema.xml
* Implement Plasma Wayland
* Distinguish Arabic XKB and Keypad XKB options
* Update simple.xml with xkeyboard-config 2.39
* Fix key typing issues
* Fix Emoji and Unicode issues
* Fix setup dialog SEGV
* Fix remote desktop issue
* Enhance CI
* Update translations
- Drop ibus-fix-key-release.patch, merged by upstream
-------------------------------------------------------------------
Wed Oct 4 07:08:11 UTC 2023 - Marguerite Su <i@marguerite.su>

View File

@ -35,13 +35,13 @@
%define _name ibus
Name: %{_name}%{?nsuffix}
Version: 1.5.28
Version: 1.5.29
Release: 0
Summary: The "Intelligent Input Bus" input method
License: LGPL-2.1-or-later
Group: System/I18n/Chinese
URL: https://github.com/ibus/
Source: https://github.com/ibus/ibus/releases/download/%{version}/%{_name}-%{version}.tar.gz
Source: https://github.com/ibus/ibus/releases/download/%{version}/%{_name}-%{version}-rc2.tar.gz
Source2: README.SUSE
Source3: xim.ibus.suse.template
Source4: xim.d-ibus-121
@ -76,9 +76,8 @@ Patch15: ibus-socket-name-compatibility.patch
# PATCH-FIX-UPSTREAM ibus-ui-gtk3-restart-via-systemd.patch
# Allow ibus-ui-gtk3 to restart ibus-daemon when it is launched by systemd
Patch16: ibus-ui-gtk3-restart-via-systemd.patch
# PATCH-FIX-UPSTREAM ibus-fix-key-release.patch
# Fixes a problem that wine/proton (steam) got a key stuck
Patch17: ibus-fix-key-release.patch
BuildRequires: pkgconfig(dbusmenu-glib-0.4)
BuildRequires: pkgconfig(dbusmenu-gtk3-0.4)
BuildRequires: pkgconfig(iso-codes)
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(systemd)
@ -216,7 +215,7 @@ This package contains ibus im module for use by gtk4.
%endif
%prep
%setup -q -n %{_name}-%{version}
%setup -q -n %{_name}-%{version}-rc2
%patch4 -p1
%patch8 -p1
%if 0%{?sle_version} < 150200 && 0%{?suse_version} <=1500
@ -237,7 +236,6 @@ cp -r %{SOURCE11} .
%patch15 -p1
%endif
%patch16 -p1
%patch17 -p1
%build
%configure --disable-static \
@ -407,6 +405,7 @@ fi
%{_datadir}/ibus/keymaps
%{_datadir}/ibus/setup
%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop
%{_datadir}/applications/org.freedesktop.IBus.Panel.Wayland.Gtk3.desktop
%dir %{_datadir}/GConf
%dir %{_datadir}/GConf/gsettings
%{_datadir}/GConf/gsettings/ibus.convert

View File

@ -1,7 +1,8 @@
--- ibus-1.5.27/ui/gtk3/panel.vala.org 2022-08-23 00:32:16.000000000 +0900
+++ ibus-1.5.27/ui/gtk3/panel.vala 2022-08-27 11:48:21.086332809 +0900
@@ -589,9 +589,9 @@
}
diff -Nur ibus-1.5.29/ui/gtk3/panel.vala ibus-1.5.29-new/ui/gtk3/panel.vala
--- ibus-1.5.29/ui/gtk3/panel.vala 2023-11-09 13:59:25.000000000 +0800
+++ ibus-1.5.29-new/ui/gtk3/panel.vala 2023-11-30 23:07:02.891766723 +0800
@@ -636,10 +636,11 @@
get_engines_from_locale(engines);
string[] names = {};
- foreach (unowned IBus.EngineDesc engine in xkb_engines)
@ -10,5 +11,7 @@
+ names += engine.get_name();
+ foreach (unowned IBus.EngineDesc engine in xkb_engines)
names += engine.get_name();
+
m_settings_general.set_strv("preload-engines", names);
}