diff --git a/unix/gtkwin.c b/unix/gtkwin.c index 314db770..b058db27 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -91,6 +91,7 @@ struct clipboard_state { struct gui_data { GtkWidget *window, *area, *sbar; gboolean sbar_visible; + gboolean area_configured; GtkBox *hbox; GtkAdjustment *sbar_adjust; GtkWidget *menu, *specialsmenu, *specialsitem1, *specialsitem2, @@ -645,6 +646,16 @@ gint configure_area(GtkWidget *widget, GdkEventConfigure *event, gpointer data) need_size = 1; } + /* + * If the terminal size hasn't changed since the previous call to + * this function (in particular, if there has at least _been_ a + * previous call to this function), then, we can assume this event + * is spurious and do nothing further. + */ + if (!need_size && inst->area_configured) + return TRUE; + inst->area_configured = TRUE; + { int backing_w = w * inst->font_width + 2*inst->window_border; int backing_h = h * inst->font_height + 2*inst->window_border;