From 20433d88f15209b2f7398ccec7500de9b900cbcc Mon Sep 17 00:00:00 2001 From: Marijn van Vliet Date: Sat, 18 Jun 2011 18:44:19 +0200 Subject: [PATCH 1/1] Fixed #31 --- libchimara/input.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libchimara/input.c b/libchimara/input.c index 95a2aa4..653d9c1 100644 --- a/libchimara/input.c +++ b/libchimara/input.c @@ -23,7 +23,15 @@ request_char_event_common(winid_t win, gboolean unicode) flush_window_buffer(win); - ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key); + if(win->type == wintype_TextBuffer) { + /* Move the input_position mark to the end of the window_buffer */ + GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); + GtkTextMark *input_position = gtk_text_buffer_get_mark(buffer, "input_position"); + GtkTextIter end_iter; + gtk_text_buffer_get_end_iter(buffer, &end_iter); + gtk_text_buffer_move_mark(buffer, input_position, &end_iter); + } + win->input_request_type = unicode? INPUT_REQUEST_CHARACTER_UNICODE : INPUT_REQUEST_CHARACTER; g_signal_handler_unblock( win->widget, win->char_input_keypress_handler ); @@ -33,6 +41,7 @@ request_char_event_common(winid_t win, gboolean unicode) gdk_threads_leave(); /* Emit the "waiting" signal to let listeners know we are ready for input */ + ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key); g_signal_emit_by_name(glk_data->self, "waiting"); } -- 2.30.2