summaryrefslogtreecommitdiff
blob: 9b94bcfacad334ca6a6c16d660fad73ccd343631 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff -uNr gaim-0.72.orig/src/gtkconv.c gaim-0.72/src/gtkconv.c
--- gaim-0.72.orig/src/gtkconv.c	2003-09-07 01:22:47.000000000 +0900
+++ gaim-0.72/src/gtkconv.c	2003-09-07 01:25:08.000000000 +0900
@@ -1136,12 +1136,28 @@
 	GaimConversation *conv;
 	GaimGtkConversation *gtkconv;
 	GaimGtkWindow *gtkwin;
+	gboolean im_context_retval = FALSE;
+	static guint32 last_event_time;
 
 	conv    = (GaimConversation *)data;
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
 	win     = gaim_conversation_get_window(conv);
 	gtkwin  = GAIM_GTK_WINDOW(win);
 
+	/*
+	 * Check if the input method handles this keyevent or we can use it.
+	 * We need to check the event time, otherwise the gtk xim module gets into an event loop (bug?)
+	 * Maybe this is not the best solution, but it works.
+	 */
+
+	if (last_event_time != event->time) {
+		im_context_retval = gtk_im_context_filter_keypress(GTK_TEXT_VIEW(gtkconv->entry)->im_context, event);
+	}
+	last_event_time = event->time;
+	if (im_context_retval == TRUE) {
+		return TRUE;
+	}
+
 	if (event->keyval == GDK_Page_Up) {
 		g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event");