[gtk+/gtk-3-0] Don't only use ch != 0 to check if a character is a control char.



commit 2dcfc1ebae078ff5ead0591bc7a3705d4d7ae08b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Mar 16 19:04:20 2011 -0400

    Don't only use ch != 0 to check if a character is a control char.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644976

 gtk/gtkimcontextsimple.c |    2 +-
 gtk/gtkimmulticontext.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index a68886f..68f7578 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -746,7 +746,7 @@ no_sequence_matches (GtkIMContextSimple *context_simple,
 	}
   
       ch = gdk_keyval_to_unicode (event->keyval);
-      if (ch != 0)
+      if (ch != 0 && !g_unichar_iscntrl (ch))
 	{
 	  gtk_im_context_simple_commit_char (context, ch);
 	  return TRUE;
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index f2454fc..ea471a8 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -355,7 +355,7 @@ gtk_im_multicontext_filter_keypress (GtkIMContext *context,
       gunichar ch;
 
       ch = gdk_keyval_to_unicode (event->keyval);
-      if (ch != 0)
+      if (ch != 0 && !g_unichar_iscntrl (ch))
         {
           gint len;
           gchar buf[10];



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]