Fixed grid line input bug introduced in [9f52ac]
authorP. F. Chimento <philip.chimento@gmail.com>
Sun, 1 May 2011 14:30:21 +0000 (16:30 +0200)
committerP. F. Chimento <philip.chimento@gmail.com>
Sun, 1 May 2011 14:30:21 +0000 (16:30 +0200)
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

index 4036117f48e5c900935bad3683a96c2bd137ae81..b43eae9b42c82055cb2ee0587ec9f2d5cf3f5694 100644 (file)
@@ -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) );