mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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]
This commit is contained in:
26
gtk.c
26
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,
|
||||
|
Reference in New Issue
Block a user