From b1bffb48d34a1ea0cb066b6cd94eedfd87684d89 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 22 May 2009 09:52:05 +0000 Subject: [PATCH] Traps illegal printing to a window with line input pending git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@64 ddfedd41-794f-dd11-ae45-00112f111e67 --- src/strio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/strio.c b/src/strio.c index 4517b38..e30d52b 100644 --- a/src/strio.c +++ b/src/strio.c @@ -17,6 +17,12 @@ static void write_utf8_to_grid(winid_t win, gchar *s) { + if(win->input_request_type == INPUT_REQUEST_LINE || win->input_request_type == INPUT_REQUEST_LINE_UNICODE) + { + ILLEGAL("Tried to print to a text grid window with line input pending."); + return; + } + /* Number of characters to insert */ glong length = g_utf8_strlen(s, -1); glong chars_left = length; @@ -59,6 +65,12 @@ write_utf8_to_grid(winid_t win, gchar *s) static void write_utf8_to_window(winid_t win, gchar *s) { + if(win->input_request_type == INPUT_REQUEST_LINE || win->input_request_type == INPUT_REQUEST_LINE_UNICODE) + { + ILLEGAL("Tried to print to a text buffer window with line input pending."); + return; + } + gdk_threads_enter(); GtkTextBuffer *buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(win->widget) ); -- 2.30.2