GtkIMContextIME: Ignore ASCII control characters
authorPhilip Zander <philip.zander@gmail.com>
Mon, 17 Jan 2022 10:56:48 +0000 (11:56 +0100)
committerPhilip Zander <philip.zander@gmail.com>
Mon, 17 Jan 2022 11:03:01 +0000 (12:03 +0100)
Make GtkIMContextIME ignore ASCII control characters just like other
IMContext implementations (e.G. GtkIMContextSimple). Fixes bogus
characters appearing in text input fields (old bug 676077).

gtk/gtkimcontextime.c

index 6025239543fa4c03819fa968c900d5ff1ebe8808..5c9282b59d58f91e2c0f4e26bc355b244d6ad3d6 100644 (file)
@@ -382,7 +382,7 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
 
   c = gdk_keyval_to_unicode (keyval);
 
-  if (c)
+  if (c && !g_unichar_iscntrl(c))
     {
       _gtk_im_context_ime_commit_unichar (context_ime, c);
       retval = TRUE;