From: P. F. Chimento Date: Sun, 1 May 2011 14:30:21 +0000 (+0200) Subject: Fixed grid line input bug introduced in [9f52ac] X-Git-Tag: v0.9~88 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=ed204cc781c440e6fc02c90df4c6395909661a27;p=projects%2Fchimara%2Fchimara.git 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. --- 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) );