[gtk+/gtk-2-24] gtk: convert keyvals to unicode before committing to the imcontext



commit 1eb0d98d734d96a6612e320d32a2aded423d2746
Author: Michael Natterer <mitch lanedo com>
Date:   Fri Nov 30 15:06:48 2012 +0100

    gtk: convert keyvals to unicode before committing to the imcontext

 gtk/gtkimcontextsimple.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 7e323cd..1c40e9d 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -343,7 +343,7 @@ static gboolean
 check_quartz_special_cases (GtkIMContextSimple *context_simple,
                             gint                n_compose)
 {
-  gunichar value = 0;
+  guint value = 0;
 
   if (n_compose == 2)
     {
@@ -354,7 +354,7 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
             {
             case GDK_KEY_dead_doubleacute:
             case GDK_KEY_space:
-              value = '"'; break;
+              value = GDK_KEY_quotedbl; break;
 
             case 'a': value = GDK_KEY_adiaeresis; break;
             case 'A': value = GDK_KEY_Adiaeresis; break;
@@ -367,7 +367,7 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
             case 'u': value = GDK_KEY_udiaeresis; break;
             case 'U': value = GDK_KEY_Udiaeresis; break;
             case 'y': value = GDK_KEY_ydiaeresis; break;
-            case 'Y': value = 0x0178; break; /* should be GDK_KEY_Ydiaeresis ?? */
+            case 'Y': value = GDK_KEY_Ydiaeresis; break;
             }
           break;
 
@@ -383,7 +383,8 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
 
   if (value > 0)
     {
-      gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
+      gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple),
+                                         gdk_keyval_to_unicode (value));
       context_simple->compose_buffer[0] = 0;
 
       GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));



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