From: Simon Tatham Date: Tue, 14 Sep 2010 10:55:06 +0000 (+0000) Subject: Jonas Koelker reports that using the version of GTK currently in X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=26c669a6b2892b97b4a9bc6842f633291951fdbd;p=sgt-puzzles.git Jonas Koelker reports that using the version of GTK currently in 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] --- diff --git a/gtk.c b/gtk.c index 9d13442..cbd1181 100644 --- 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,