public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Takao Fujiwara <tfujiwar@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/ibus] autotool: Fix to connect button-press-event for Hangul
Date: Sun, 31 May 2026 02:07:18 GMT [thread overview]
Message-ID: <178019323873.1.17422326398109286558.rpms-ibus-9f9e09d31a5a@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/ibus
Branch : autotool
Commit : 9f9e09d31a5a3e392272a1568905f2a9236f3187
Author : Takao Fujiwara <tfujiwar@redhat.com>
Date : 2019-12-24T15:54:54+09:00
Stats : +73/-101 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ibus/c/9f9e09d31a5a3e392272a1568905f2a9236f3187?branch=autotool
Log:
Fix to connect button-press-event for Hangul
Delete a previous workaround targeted to firefox only for Hangul
---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 632c253..644bb67 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -3027,28 +3027,21 @@ index 5e3457ba..ac5de809 100644
--
2.21.0
-From 7830673205140e901df354b80a00254f7c08f30d Mon Sep 17 00:00:00 2001
+From 0544e4b9c68c43d41c18c73b6e5a394fead1321a Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
-Date: Wed, 11 Dec 2019 19:10:24 +0900
-Subject: [PATCH] client/gtk2: Add IBUS_AUTO_PREEDIT_COMMIT_APPS env for
- Hangul
+Date: Tue, 24 Dec 2019 12:23:27 +0900
+Subject: [PATCH] client/gtk2: Fix to connect button-press-event signal
-Firefox no longer connect "button-press-event" but uses
-GtkGestureMultiPress in GtkWindowPrivate and connects "pressed"
-instead and do not propagate the event with "button-press-event".
-
-We don't commit the preedit text in the client here for the
-workaround and let firefox commit the preedit text to avoid the
-double preedit text with mouse click.
+IBus clients do not connect button-press-event in some conditions
+and it will be fixed.
BUG=https://github.com/ibus/ibus/issues/1980
---
- client/gtk2/ibusimcontext.c | 32 ++++++++++++++++++++++++++++----
- configure.ac | 13 ++++++++++++-
- 2 files changed, 40 insertions(+), 5 deletions(-)
+ client/gtk2/ibusimcontext.c | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c
-index ac5de809..df78ce48 100644
+index ac5de809..6b5ab04f 100644
--- a/client/gtk2/ibusimcontext.c
+++ b/client/gtk2/ibusimcontext.c
@@ -2,8 +2,8 @@
@@ -3062,94 +3055,69 @@ index ac5de809..df78ce48 100644
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
-@@ -97,6 +97,9 @@ static gboolean _use_sync_mode = FALSE;
- static const gchar *_discard_password_apps = "";
- static gboolean _use_discard_password = FALSE;
+@@ -73,7 +73,7 @@ struct _IBusIMContext {
+ GCancellable *cancellable;
+ GQueue *events_queue;
-+static const gchar *_auto_commit_apps = AUTO_PREEDIT_COMMIT_APPS;
-+static gboolean _use_auto_commit = FALSE;
-+
- static GtkIMContext *_focus_im_context = NULL;
- static IBusInputContext *_fake_context = NULL;
- static GdkWindow *_input_window = NULL;
-@@ -636,6 +639,7 @@ ibus_im_context_class_init (IBusIMContextClass *class)
- !(ENABLE_SNOOPER));
- _use_sync_mode = _get_boolean_env ("IBUS_ENABLE_SYNC_MODE", FALSE);
- _use_discard_password = _get_boolean_env ("IBUS_DISCARD_PASSWORD", FALSE);
-+ _use_auto_commit = _get_boolean_env ("IBUS_AUTO_PREEDIT_COMMIT", FALSE);
-
- #define CHECK_APP_IN_CSV_ENV_VARIABLES(retval, \
- env_apps, \
-@@ -672,6 +676,12 @@ ibus_im_context_class_init (IBusIMContextClass *class)
- _discard_password_apps,
- TRUE);
- }
-+ if (!_use_auto_commit) {
-+ CHECK_APP_IN_CSV_ENV_VARIABLES (_use_auto_commit,
-+ IBUS_AUTO_PREEDIT_COMMIT_APPS,
-+ _auto_commit_apps,
-+ TRUE);
-+ }
+- gboolean use_button_press_event;
++ gboolean use_button_press_event;
+ };
- #undef CHECK_APP_IN_CSV_ENV_VARIABLES
-
-@@ -896,9 +906,23 @@ ibus_im_context_clear_preedit_text (IBusIMContext *ibusimcontext)
- IBUS_ENGINE_PREEDIT_CLEAR,
- ibusimcontext);
- if (preedit_string) {
-- g_signal_emit (ibusimcontext, _signal_commit_id, 0, preedit_string);
-+ /* Firefox no longer connect "button-press-event" but uses
-+ * GtkGestureMultiPress in GtkWindowPrivate and connects "pressed"
-+ * instead and do not propagate the event with "button-press-event".
-+ * We don't commit the preedit text in the client here for the
-+ * workaround and let firefox commit the preedit text to avoid the
-+ * double preedit text with mouse click.
-+ * After we fix the GTK reset signal to always emit the reset signal
-+ * with mouse click, also will try to fix the Firefox
-+ * reset signal so that ibus clients receive the signal before Firefox
-+ * composes the preedit text because the options of commit, clear,
-+ * keep depends on each IBus engine but Firefox cannot know each engine.
-+ */
-+ if (!_use_auto_commit) {
-+ g_signal_emit (ibusimcontext, _signal_commit_id, 0, preedit_string);
-+ _request_surrounding_text (ibusimcontext);
-+ }
- g_free (preedit_string);
-- _request_surrounding_text (ibusimcontext);
+ struct _IBusIMContextClass {
+@@ -1125,6 +1125,10 @@ ibus_im_context_get_preedit_string (GtkIMContext *context,
+
+
+ #if !GTK_CHECK_VERSION (3, 93, 0)
++/* Use the button-press-event signal until GtkIMContext always emits the reset
++ * signal.
++ * https://gitlab.gnome.org/GNOME/gtk/merge_requests/460
++ */
+ static gboolean
+ ibus_im_context_button_press_event_cb (GtkWidget *widget,
+ GdkEventButton *event,
+@@ -1157,11 +1161,13 @@ _connect_button_press_event (IBusIMContext *ibusimcontext,
+ "button-press-event",
+ G_CALLBACK (ibus_im_context_button_press_event_cb),
+ ibusimcontext);
++ ibusimcontext->use_button_press_event = TRUE;
+ } else {
+ g_signal_handlers_disconnect_by_func (
+ widget,
+ G_CALLBACK (ibus_im_context_button_press_event_cb),
+ ibusimcontext);
++ ibusimcontext->use_button_press_event = FALSE;
+ }
}
}
-
-diff --git a/configure.ac b/configure.ac
-index ab74a380..12642834 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -540,6 +540,16 @@ AC_ARG_WITH(no-snooper-apps,
- AC_DEFINE_UNQUOTED(NO_SNOOPER_APPS, "$NO_SNOOPER_APPS",
- [Does not enbale keyboard snooper in those applications])
-
-+# Option for auto-preedit-commit applications.
-+AC_ARG_WITH(auto-preedit-commit-apps,
-+ AS_HELP_STRING([--with-auto-preedit-commit-apps[=regex1,regex2]],
-+ [Applications have auto-commit of preedit with mouse click (like: .*chrome.*,firefox.*)]),
-+ AUTO_PREEDIT_COMMIT_APPS=$with_auto_preedit_commit_apps,
-+ AUTO_PREEDIT_COMMIT_APPS=[firefox.*,.*chrome.*,.*chromium.*]
-+)
-+AC_DEFINE_UNQUOTED(AUTO_PREEDIT_COMMIT_APPS, "$AUTO_PREEDIT_COMMIT_APPS",
-+ [Applications have auto-commit of preedit with mouse click])
-+
- # GNOME 3 uses the theme's icon.
- AC_ARG_WITH(panel-icon-keyboard,
- AS_HELP_STRING([--with-panel-icon-keyboard[=icon_name]],
-@@ -812,7 +822,8 @@ Build options:
- Build UI $enable_ui
- Build engine $enable_engine
- Enable key snooper $enable_key_snooper
-- No snooper regexes "$NO_SNOOPER_APPS"
-+ No snooper apps "$NO_SNOOPER_APPS"
-+ Auto preedit commit apps "$AUTO_PREEDIT_COMMIT_APPS"
- Panel icon "$IBUS_ICON_KEYBOARD"
- Enable surrounding-text $enable_surrounding_text
- Enable Emoji dict $enable_emoji_dict
+@@ -1180,6 +1186,8 @@ ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client)
+ #if !GTK_CHECK_VERSION (3, 93, 0)
+ if (ibusimcontext->use_button_press_event)
+ _connect_button_press_event (ibusimcontext, FALSE);
++#else
++ ibusimcontext->use_button_press_event = TRUE;
+ #endif
+ g_object_unref (ibusimcontext->client_window);
+ ibusimcontext->client_window = NULL;
+@@ -1188,8 +1196,10 @@ ibus_im_context_set_client_window (GtkIMContext *context, GdkWindow *client)
+ if (client != NULL) {
+ ibusimcontext->client_window = g_object_ref (client);
+ #if !GTK_CHECK_VERSION (3, 93, 0)
+- if (ibusimcontext->use_button_press_event)
++ if (!ibusimcontext->use_button_press_event)
+ _connect_button_press_event (ibusimcontext, TRUE);
++#else
++ ibusimcontext->use_button_press_event = FALSE;
+ #endif
+ }
+ if (ibusimcontext->slave)
+@@ -1660,7 +1670,6 @@ _ibus_context_update_preedit_text_cb (IBusInputContext *ibuscontext,
+ #if !GTK_CHECK_VERSION (3, 93, 0)
+ if (ibusimcontext->client_window) {
+ _connect_button_press_event (ibusimcontext, TRUE);
+- ibusimcontext->use_button_press_event = TRUE;
+ }
+ #else
+ ibusimcontext->use_button_press_event = TRUE;
--
2.21.0
diff --git a/ibus.spec b/ibus.spec
index c4fe6f6..fa8d42f 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -35,7 +35,7 @@
Name: ibus
Version: 1.5.21
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@@ -464,9 +464,13 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
+* Tue Dec 24 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.21-6
+- Fix to connect button-press-event for Hangul
+- Delete a previous workaround targeted to firefox only for Hangul
+
* Wed Dec 11 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.21-5
- Add RHEL code reviews
-- Fix Hangul preedit with mouse click for RHEL 8
+- Fix Hangul preedit with mouse click
* Mon Nov 18 2019 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.21-4
- Replace push with cd for Posix SH
reply other threads:[~2026-05-31 2:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178019323873.1.17422326398109286558.rpms-ibus-9f9e09d31a5a@fedoraproject.org \
--to=tfujiwar@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox