chiark / gitweb /
Jonas Koelker reports that using the version of GTK currently in
authorSimon Tatham <anakin@pobox.com>
Tue, 14 Sep 2010 10:55:06 +0000 (10:55 +0000)
committerSimon Tatham <anakin@pobox.com>
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.

[originally from svn r8997]

gtk.c

diff --git a/gtk.c b/gtk.c
index 9d134426aabb328b09f9c2b20bba984f76f32e6f..cbd1181b570e6512c73516c97e65ed7833985b96 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,