chiark / gitweb /
Tents: mark squares as non-tents with {Shift,Control}-cursor keys.
[sgt-puzzles.git] / gtk.c
diff --git a/gtk.c b/gtk.c
index 37eb50922605089a3244c8d03d25de6af2713803..a8416b0c5cb9f9c76197fb71fa84f15733795669 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -1310,22 +1310,22 @@ static gint configure_area(GtkWidget *widget,
 {
     frontend *fe = (frontend *)data;
     int x, y;
+    int oldw = fe->w, oldpw = fe->pw, oldh = fe->h, oldph = fe->ph;
 
     x = event->width;
     y = event->height;
-
-    if (x != fe->w || y != fe->h || !backing_store_ok(fe)) {
+    fe->w = x;
+    fe->h = y;
+    midend_size(fe->me, &x, &y, TRUE);
+    fe->pw = x;
+    fe->ph = y;
+    fe->ox = (fe->w - fe->pw) / 2;
+    fe->oy = (fe->h - fe->ph) / 2;
+
+    if (oldw != fe->w || oldpw != fe->pw ||
+        oldh != fe->h || oldph != fe->ph || !backing_store_ok(fe)) {
         if (backing_store_ok(fe))
             teardown_backing_store(fe);
-
-        fe->w = x;
-        fe->h = y;
-        midend_size(fe->me, &x, &y, TRUE);
-        fe->pw = x;
-        fe->ph = y;
-        fe->ox = (fe->w - fe->pw) / 2;
-        fe->oy = (fe->h - fe->ph) / 2;
-
         setup_backing_store(fe);
     }