aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2015-10-03 17:57:01 +0100
committerSimon Tatham <anakin@pobox.com>2015-10-03 18:01:18 +0100
commita800ff16bb10d41ed749d9b16e3eb3505bf9345e (patch)
tree82c26f8ab55dba03329373672e3ee97eb51aca8b
parente22a9c8396f1f0bd1c74cd8b738f5f9716760004 (diff)
downloadpuzzles-a800ff16bb10d41ed749d9b16e3eb3505bf9345e.zip
puzzles-a800ff16bb10d41ed749d9b16e3eb3505bf9345e.tar.gz
puzzles-a800ff16bb10d41ed749d9b16e3eb3505bf9345e.tar.bz2
puzzles-a800ff16bb10d41ed749d9b16e3eb3505bf9345e.tar.xz
Fix switching to a larger puzzle size under GTK 2.
Commit 8b491946e had a bug: configure_area stopped doing most of its work if the new size already matched fe->w and fe->h, but in fact the GTK2 resize_fe() _already_ set up fe->w and fe->h for the new size. I managed not to notice, because I checked it all worked on GTK 3 but only tested resizing to a _smaller_ puzzle on GTK 2. Ahem. Now we don't change fe->w and fe->h at all until configure_area is called. Also, we initialise them to dummy values at setup time, so that configure_area won't compare the new size with uninitialised data.
-rw-r--r--gtk.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gtk.c b/gtk.c
index 27eb5da..559ff82 100644
--- a/gtk.c
+++ b/gtk.c
@@ -1889,8 +1889,6 @@ static void resize_fe(frontend *fe)
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_resize_to_geometry(GTK_WINDOW(fe->window), x, y);
#else
- fe->w = x;
- fe->h = y;
fe->drawing_area_shrink_pending = FALSE;
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
{
@@ -2582,6 +2580,8 @@ static frontend *new_window(char *arg, int argtype, char **error)
gtk_window_set_geometry_hints(GTK_WINDOW(fe->window), fe->area,
&geom, GDK_HINT_BASE_SIZE);
}
+ fe->w = -1;
+ fe->h = -1;
get_size(fe, &x, &y);
#if GTK_CHECK_VERSION(3,0,0)
gtk_window_set_default_geometry(GTK_WINDOW(fe->window), x, y);
@@ -2589,8 +2589,6 @@ static frontend *new_window(char *arg, int argtype, char **error)
fe->drawing_area_shrink_pending = FALSE;
gtk_drawing_area_size(GTK_DRAWING_AREA(fe->area), x, y);
#endif
- fe->w = x;
- fe->h = y;
gtk_box_pack_end(vbox, fe->area, TRUE, TRUE, 0);