changeset 20309:d256249b22ea

applied changes from 4bbc209c8076ef89135700af844ec6bb04602c0a through 43311ea3963dadd958af56847cc36df60507673f
author Luke Schierer <lschiere@pidgin.im>
date Fri, 19 Oct 2007 17:10:50 +0000
parents c2d3c9fc71b5
children 311000f10bb0
files finch/libgnt/gntmain.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntmain.c	Fri Oct 19 17:10:04 2007 +0000
+++ b/finch/libgnt/gntmain.c	Fri Oct 19 17:10:50 2007 +0000
@@ -223,6 +223,7 @@
 	char keys[256];
 	int rd;
 	char *k;
+	char *cvrt = NULL;
 
 	if (wm->mode == GNT_KP_MODE_WAIT_ON_CHILD)
 		return FALSE;
@@ -243,15 +244,16 @@
 		raise(SIGABRT);
 	}
 
-	gnt_wm_set_event_stack(wm, TRUE);
 	rd += HOLDING_ESCAPE;
-	keys[rd] = 0;
-	if (mouse_enabled && detect_mouse_action(keys))
-		goto end;
-
 	if (HOLDING_ESCAPE)
 		keys[0] = '\033';
-	k = keys;
+	keys[rd] = 0;
+	gnt_wm_set_event_stack(wm, TRUE);
+
+	cvrt = g_locale_to_utf8(keys, rd, (gsize*)&rd, NULL, NULL);
+	k = cvrt ? cvrt : keys;
+	if (mouse_enabled && detect_mouse_action(k))
+		goto end;
 
 #if 0
 	/* I am not sure what's happening here. If this actually does something,
@@ -290,6 +292,7 @@
 	}
 end:
 	gnt_wm_set_event_stack(wm, FALSE);
+	g_free(cvrt);
 	return TRUE;
 }