summaryrefslogtreecommitdiff
path: root/src/gui_gtk_x11.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r--src/gui_gtk_x11.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index 541240de..c5b11285 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -813,10 +813,15 @@ focus_in_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
if (blink_state == BLINK_NONE)
gui_mch_start_blink();
- /* make sure keyboard input goes to the draw area (if this is focus for a window) */
+ /* make sure keyboard input goes to the draw area (if this is focus for a
+ * window) */
if (widget != gui.drawarea)
gtk_widget_grab_focus(gui.drawarea);
+ /* make sure the input buffer is read */
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
return TRUE;
}
@@ -829,6 +834,10 @@ focus_out_event(GtkWidget *widget, GdkEventFocus *event, gpointer data)
if (blink_state != BLINK_NONE)
gui_mch_stop_blink();
+ /* make sure the input buffer is read */
+ if (gtk_main_level() > 0)
+ gtk_main_quit();
+
return TRUE;
}