diff options
author | fujiwarat <takao.fujiwara1@gmail.com> | 2022-09-21 21:08:29 +0900 |
---|---|---|
committer | fujiwarat <takao.fujiwara1@gmail.com> | 2022-09-21 21:08:29 +0900 |
commit | 8d0abbcbcef9a4fda706c70f12f4f596728bf90b (patch) | |
tree | 061fb0a3902ecedf015e70b206f278c1493239a0 | |
parent | babad7839ba6d72609c717d647bb2928724b4cc3 (diff) | |
download | ibus-8d0abbcbcef9a4fda706c70f12f4f596728bf90b.tar.gz |
client/gtk2: Stop many warnings of surrounding text
Surrounding text is requested by ibus_im_context_filter_keypress()
and the no supported warning could be output many times.
Now the warning is output one time by input context but
brower applicaations do not use GtkWidget for the input context
so the warning is output by instance but not input context.
BUG=https://github.com/ibus/ibus/issues/2418
-rw-r--r-- | client/gtk2/ibusimcontext.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c index bc14df00..3fc9c0f2 100644 --- a/client/gtk2/ibusimcontext.c +++ b/client/gtk2/ibusimcontext.c @@ -567,6 +567,7 @@ _process_key_event (IBusInputContext *context, static void _request_surrounding_text (IBusIMContext *context) { + static gboolean warned = FALSE; if (context && (context->caps & IBUS_CAP_SURROUNDING_TEXT) != 0 && context->ibuscontext != NULL && @@ -580,8 +581,11 @@ _request_surrounding_text (IBusIMContext *context) * fail with the first typing on firefox but it succeeds with * the second typing. */ - g_warning ("%s has no capability of surrounding-text feature", - g_get_prgname ()); + if (!warned) { + g_warning ("%s has no capability of surrounding-text feature", + g_get_prgname ()); + warned = TRUE; + } } } } |