Backport fix for input method preedit issue (MR #1084)

This commit is contained in:
Adam Williamson 2020-03-11 08:54:31 -07:00
parent b8a115257d
commit 4ef45d4ea0
2 changed files with 68 additions and 1 deletions

60
1084.patch Normal file
View File

@ -0,0 +1,60 @@
From b18469427e5c19402111de5fe9888bceec0eaacd Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg@gnome.org>
Date: Wed, 11 Mar 2020 12:32:07 +0100
Subject: [PATCH] St: Ensure to update entry hint visibility with IM preedit
Commit 88ac339774 changed StEntry behavior so the text hint would
stay visible while focused, as long as the text buffer is empty.
However, IMs that use preedit still should count as "started typing",
while the text buffer is still officially empty.
To fix this, check on st_entry_update_hint_visibility() that there's
indeed no preedit buffer before showing the hint. We can't directly
listen to internal preedit buffer changes in ClutterText, so handle
preedit buffer updates through the ::cursor-changed signal that will
be indirectly emitted.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1084
---
src/st/st-entry.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/st/st-entry.c b/src/st/st-entry.c
index 24fe7434c7..28dddc0537 100644
--- a/src/st/st-entry.c
+++ b/src/st/st-entry.c
@@ -232,6 +232,7 @@ st_entry_update_hint_visibility (StEntry *self)
StEntryPrivate *priv = ST_ENTRY_PRIV (self);
gboolean hint_visible =
priv->hint_actor != NULL &&
+ !clutter_text_has_preedit (CLUTTER_TEXT (priv->entry)) &&
strcmp (clutter_text_get_text (CLUTTER_TEXT (priv->entry)), "") == 0;
if (priv->hint_actor)
@@ -530,6 +531,13 @@ clutter_text_focus_out_cb (ClutterText *text,
clutter_text_set_cursor_visible (text, FALSE);
}
+static void
+clutter_text_cursor_changed (ClutterText *text,
+ StEntry *entry)
+{
+ st_entry_update_hint_visibility (entry);
+}
+
static void
clutter_text_changed_cb (GObject *object,
GParamSpec *pspec,
@@ -980,6 +988,9 @@ st_entry_init (StEntry *entry)
g_signal_connect (priv->entry, "button-press-event",
G_CALLBACK (clutter_text_button_press_event), entry);
+ g_signal_connect (priv->entry, "cursor-changed",
+ G_CALLBACK (clutter_text_cursor_changed), entry);
+
g_signal_connect (priv->entry, "notify::text",
G_CALLBACK (clutter_text_changed_cb), entry);
--
2.24.1

View File

@ -1,6 +1,6 @@
Name: gnome-shell Name: gnome-shell
Version: 3.36.0 Version: 3.36.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: Window management and application launching for GNOME Summary: Window management and application launching for GNOME
License: GPLv2+ License: GPLv2+
@ -22,6 +22,10 @@ Patch3: 0002-endSessionDialog-Support-rebooting-into-the-bootload.patch
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1080 # https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1080
Patch4: 1080.patch Patch4: 1080.patch
# Fix input method preedit not counting as 'started typing'
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1084
Patch5: 1084.patch
%define libcroco_version 0.6.8 %define libcroco_version 0.6.8
%define eds_version 3.33.1 %define eds_version 3.33.1
%define gnome_desktop_version 3.35.91 %define gnome_desktop_version 3.35.91
@ -232,6 +236,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/evolution-calendar.de
%{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Extensions-symbolic.svg %{_datadir}/icons/hicolor/symbolic/apps/org.gnome.Extensions-symbolic.svg
%changelog %changelog
* Wed Mar 11 2020 Adam Williamson <awilliam@redhat.com> - 3.36.0-3
- Backport fix for input method preedit issue (MR #1084)
* Tue Mar 10 2020 Adam Williamson <awilliam@redhat.com> - 3.36.0-2 * Tue Mar 10 2020 Adam Williamson <awilliam@redhat.com> - 3.36.0-2
- Backport fix for ibus failing to start automatically (MR #1080) - Backport fix for ibus failing to start automatically (MR #1080)