Add some missing calls to midend_redraw().

I've just noticed that the GTK game window was not being redrawn when
changing between puzzle modes that don't involve a window resize - by
selecting a preset from the Type menu (e.g. changing between different
12x12 settings in Flood) or via the Custom menu.

It looks as if the bug was introduced in commit 8dfe5cec3, which
suggests that it was a side effect of the switch from
gtk_window_resize_to_geometry to plain gtk_window_resize. My guess is
that the implementation of the former function inside GTK might have
happened to trigger an unconditional window resize, while the latter
took the shortcut of doing nothing if the window was already the right
size; hence, resize_fe() would have been reliably generating a redraw
event without me having to ask for one, but now it doesn't, so I have
to trigger one myself any time I've just called resize_fe.
This commit is contained in:
Simon Tatham
2016-12-27 16:13:01 +00:00
parent 0b348877e2
commit 7cae89fb4b

3
gtk.c
View File

@ -1988,6 +1988,7 @@ static void menu_preset_event(GtkMenuItem *menuitem, gpointer data)
midend_new_game(fe->me);
changed_preset(fe);
resize_fe(fe);
midend_redraw(fe->me);
}
GdkAtom compound_text_atom, utf8_string_atom;
@ -2231,6 +2232,7 @@ static void menu_load_event(GtkMenuItem *menuitem, gpointer data)
changed_preset(fe);
resize_fe(fe);
midend_redraw(fe->me);
}
}
@ -2268,6 +2270,7 @@ static void menu_config_event(GtkMenuItem *menuitem, gpointer data)
midend_new_game(fe->me);
resize_fe(fe);
midend_redraw(fe->me);
}
static void menu_about_event(GtkMenuItem *menuitem, gpointer data)