Jonas Koelker reports that using the version of GTK currently in
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 14 Sep 2010 10:55:06 +0000 (10:55 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Tue, 14 Sep 2010 10:55:06 +0000 (10:55 +0000)
Debian sid (2.20.1), there's a redraw problem when the window has a
different aspect ratio from the puzzle (due to resizing or
maximising): pieces of the window outside the real puzzle rectangle
don't get redrawn when exposed (e.g. by the drop-down menus).

Introduced code to explicitly redraw the whole exposed area,
including the parts that fall outside the pixmap. This makes the
problem go away in my hasty test install of sid, and doesn't seem to
affect the build on lenny.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@8997 cda61777-01e9-0310-a592-d414129be87e

gtk.c

diff --git a/gtk.c b/gtk.c
index 9d13442..cbd1181 100644 (file)
--- a/gtk.c
+++ b/gtk.c
@@ -411,6 +411,32 @@ static void teardown_backing_store(frontend *fe)
 static void repaint_rectangle(frontend *fe, GtkWidget *widget,
                              int x, int y, int w, int h)
 {
+    if (x < fe->ox) {
+       gdk_draw_rectangle(widget->window,
+                          widget->style->bg_gc[GTK_WIDGET_STATE(fe->area)],
+                          TRUE, x, y, fe->ox - x, h);
+       w -= (fe->ox - x);
+       x = fe->ox;
+    }
+    if (y < fe->oy) {
+       gdk_draw_rectangle(widget->window,
+                          widget->style->bg_gc[GTK_WIDGET_STATE(fe->area)],
+                          TRUE, x, y, w, fe->oy - y);
+       h -= (fe->oy - y);
+       y = fe->oy;
+    }
+    if (w > fe->pw) {
+       gdk_draw_rectangle(widget->window,
+                          widget->style->bg_gc[GTK_WIDGET_STATE(fe->area)],
+                          TRUE, x + fe->pw, y, w - fe->pw, h);
+       w = fe->pw;
+    }
+    if (h > fe->ph) {
+       gdk_draw_rectangle(widget->window,
+                          widget->style->bg_gc[GTK_WIDGET_STATE(fe->area)],
+                          TRUE, x, y + fe->ph, w, h - fe->ph);
+       h = fe->ph;
+    }
     gdk_draw_pixmap(widget->window,
                    widget->style->fg_gc[GTK_WIDGET_STATE(fe->area)],
                    fe->pixmap,