From ed204cc781c440e6fc02c90df4c6395909661a27 Mon Sep 17 00:00:00 2001 From: "P. F. Chimento" Date: Sun, 1 May 2011 16:30:21 +0200 Subject: [PATCH] Fixed grid line input bug introduced in [9f52ac] The window buffer of a text grid must be flushed before line input begins; line input replaces part of the text with a widget (GtkEntry) so if the buffer is flushed during, then it overwrites the widget, deleting it, and causing a crash. --- libchimara/input.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libchimara/input.c b/libchimara/input.c index 4036117..b43eae9 100644 --- a/libchimara/input.c +++ b/libchimara/input.c @@ -91,6 +91,10 @@ glk_cancel_char_event(winid_t win) static void text_grid_request_line_event_common(winid_t win, glui32 maxlen, gboolean insert, gchar *inserttext) { + /* All outstanding printing _must_ be finished before putting an input entry + into the buffer */ + flush_window_buffer(win); + gdk_threads_enter(); GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); -- 2.30.2