Update ibus_input_context_set_surrounding_text for a global IC
Also fix CI
This commit is contained in:
parent
1d4783734c
commit
3e0a79049c
@ -131,9 +131,9 @@ index 3fc9c0f2..eaf7eb90 100644
|
|||||||
--
|
--
|
||||||
2.37.3
|
2.37.3
|
||||||
|
|
||||||
From 483abb429fed4c51e214fa6c1efbb54ca73d5b28 Mon Sep 17 00:00:00 2001
|
From 7bbcce66e1ca694b7a62553327161290bf4ee283 Mon Sep 17 00:00:00 2001
|
||||||
From: fujiwarat <takao.fujiwara1@gmail.com>
|
From: fujiwarat <takao.fujiwara1@gmail.com>
|
||||||
Date: Fri, 16 Sep 2022 14:50:53 +0900
|
Date: Mon, 19 Sep 2022 11:52:14 +0900
|
||||||
Subject: [PATCH] client/gtk2: Update surrounding text properties by focus in
|
Subject: [PATCH] client/gtk2: Update surrounding text properties by focus in
|
||||||
|
|
||||||
ibus_input_context_set_surrounding_text() should be succeeded
|
ibus_input_context_set_surrounding_text() should be succeeded
|
||||||
@ -148,8 +148,8 @@ and clients can call set_surrounding_text() later.
|
|||||||
BUG=https://github.com/ibus/ibus/issues/2423
|
BUG=https://github.com/ibus/ibus/issues/2423
|
||||||
---
|
---
|
||||||
client/gtk2/ibusimcontext.c | 25 +++++++++++++++++++++++++
|
client/gtk2/ibusimcontext.c | 25 +++++++++++++++++++++++++
|
||||||
src/ibusinputcontext.c | 24 ++++++++++++++++++++++--
|
src/ibusinputcontext.c | 29 ++++++++++++++++++++++++++++-
|
||||||
2 files changed, 47 insertions(+), 2 deletions(-)
|
2 files changed, 53 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
|
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
|
||||||
index eaf7eb90..6e338157 100644
|
index eaf7eb90..6e338157 100644
|
||||||
@ -216,7 +216,7 @@ index eaf7eb90..6e338157 100644
|
|||||||
|
|
||||||
if (!g_queue_is_empty (ibusimcontext->events_queue)) {
|
if (!g_queue_is_empty (ibusimcontext->events_queue)) {
|
||||||
diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
|
diff --git a/src/ibusinputcontext.c b/src/ibusinputcontext.c
|
||||||
index 7981de38..ed887dde 100644
|
index 7981de38..28ae04ad 100644
|
||||||
--- a/src/ibusinputcontext.c
|
--- a/src/ibusinputcontext.c
|
||||||
+++ b/src/ibusinputcontext.c
|
+++ b/src/ibusinputcontext.c
|
||||||
@@ -2,7 +2,7 @@
|
@@ -2,7 +2,7 @@
|
||||||
@ -266,30 +266,26 @@ index 7981de38..ed887dde 100644
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1109,6 +1126,7 @@ ibus_input_context_set_surrounding_text (IBusInputContext *context,
|
@@ -1116,9 +1133,19 @@ ibus_input_context_set_surrounding_text (IBusInputContext *context,
|
||||||
guint32 cursor_pos,
|
|
||||||
guint32 anchor_pos)
|
|
||||||
{
|
|
||||||
+ static IBusInputContext *prev_context = NULL;
|
|
||||||
IBusInputContextPrivate *priv;
|
|
||||||
|
|
||||||
g_assert (IBUS_IS_INPUT_CONTEXT (context));
|
priv = IBUS_INPUT_CONTEXT_GET_PRIVATE (context);
|
||||||
@@ -1119,12 +1137,14 @@ ibus_input_context_set_surrounding_text (IBusInputContext *context,
|
|
||||||
|
+ /* This API should send "SetSurroundingText" D-Bus method when
|
||||||
|
+ * input contexts are switched between tabs in a text application
|
||||||
|
+ * so that engines can receive the updated surrounding texts after
|
||||||
|
+ * focus-in events happen.
|
||||||
|
+ *
|
||||||
|
+ * GNOME shell uses a single input context and the address of the input
|
||||||
|
+ * contexts are always same. So check the address of texts if the input
|
||||||
|
+ * contexts on applications are switched.
|
||||||
|
+ */
|
||||||
if (cursor_pos != priv->surrounding_cursor_pos ||
|
if (cursor_pos != priv->surrounding_cursor_pos ||
|
||||||
anchor_pos != priv->selection_anchor_pos ||
|
anchor_pos != priv->selection_anchor_pos ||
|
||||||
priv->surrounding_text == NULL ||
|
priv->surrounding_text == NULL ||
|
||||||
- g_strcmp0 (text->text, priv->surrounding_text->text) != 0) {
|
+ text != priv->surrounding_text ||
|
||||||
+ g_strcmp0 (text->text, priv->surrounding_text->text) != 0 ||
|
g_strcmp0 (text->text, priv->surrounding_text->text) != 0) {
|
||||||
+ context != prev_context) {
|
|
||||||
if (priv->surrounding_text)
|
if (priv->surrounding_text)
|
||||||
g_object_unref (priv->surrounding_text);
|
g_object_unref (priv->surrounding_text);
|
||||||
priv->surrounding_text = (IBusText *) g_object_ref_sink (text);
|
|
||||||
priv->surrounding_cursor_pos = cursor_pos;
|
|
||||||
priv->selection_anchor_pos = anchor_pos;
|
|
||||||
+ prev_context = context;
|
|
||||||
|
|
||||||
if (priv->needs_surrounding_text) {
|
|
||||||
GVariant *variant = ibus_serializable_serialize ((IBusSerializable *)text);
|
|
||||||
--
|
--
|
||||||
2.37.3
|
2.37.3
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
Name: ibus
|
Name: ibus
|
||||||
Version: 1.5.27
|
Version: 1.5.27
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Intelligent Input Bus for Linux OS
|
Summary: Intelligent Input Bus for Linux OS
|
||||||
License: LGPLv2+
|
License: LGPLv2+
|
||||||
URL: https://github.com/ibus/%name/wiki
|
URL: https://github.com/ibus/%name/wiki
|
||||||
@ -521,6 +521,10 @@ dconf update || :
|
|||||||
%{_datadir}/installed-tests/ibus
|
%{_datadir}/installed-tests/ibus
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Sep 19 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.27-3
|
||||||
|
- Update ibus_input_context_set_surrounding_text for a global IC
|
||||||
|
- Fix CI
|
||||||
|
|
||||||
* Fri Sep 16 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.27-2
|
* Fri Sep 16 2022 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.27-2
|
||||||
- Resolves: #2093313 Stop many warnings of surrounding text
|
- Resolves: #2093313 Stop many warnings of surrounding text
|
||||||
- Fix other surrounding text issues
|
- Fix other surrounding text issues
|
||||||
|
Loading…
Reference in New Issue
Block a user