Skip to content

Commit

Permalink
client/gtk2: Stop many warnings of surrounding text
Browse files Browse the repository at this point in the history
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=#2418
  • Loading branch information
fujiwarat committed Sep 21, 2022
1 parent babad78 commit 8d0abbc
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/gtk2/ibusimcontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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;
}
}
}
}
Expand Down

0 comments on commit 8d0abbc

Please sign in to comment.