1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Ignore spurious configure_area events.

Colin Watson reports that on pre-releases of Ubuntu 18.04, configure
events which don't actually involve a change of window size show up
annoyingly often. Our handling of configure events involves throwing
away the backing Cairo surface, making a fresh blank one, and
scheduling a top-level callback to get terminal.c to do a repaint and
populate the new surface; so a draw event before that callback occurs
causes the window contents to flicker off and on again, not to mention
wasting a lot of time.

The simplest solution is to spot spurious configures, and respond by
not throwing away the previous Cairo surface in the first place.
This commit is contained in:
Simon Tatham 2018-04-03 18:57:00 +01:00
parent 971b04f9de
commit 510187a733

View File

@ -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;