--- gaim-0.64/src/gtkconv.c Sun Aug 3 20:19:57 2003 +++ gaim-new/src/gtkconv.c Sun Aug 3 19:53:44 2003 @@ -975,12 +975,28 @@ struct gaim_conversation *conv; struct gaim_gtk_conversation *gtkconv; struct gaim_gtk_window *gtkwin; + gboolean im_context_retval = FALSE; + static guint32 last_event_time; conv = (struct gaim_conversation *)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_Escape) { if (convo_options & OPT_CONVO_ESC_CAN_CLOSE) { g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event");