mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
GTK misfires timers at inconvenient moments, sometimes causing a new
puzzle of a different size to be redrawn before the pixmap is resized, and since backends never redraw already-drawn stuff this is a problem. Was biting me when I entered a Mines game ID of a different size than the current settings into the Specific box. [originally from svn r5872]
This commit is contained in:
2
gtk.c
2
gtk.c
@ -468,7 +468,7 @@ static gint configure_area(GtkWidget *widget,
|
|||||||
gdk_draw_rectangle(fe->pixmap, gc, 1, 0, 0, fe->w, fe->h);
|
gdk_draw_rectangle(fe->pixmap, gc, 1, 0, 0, fe->w, fe->h);
|
||||||
gdk_gc_unref(gc);
|
gdk_gc_unref(gc);
|
||||||
|
|
||||||
midend_redraw(fe->me);
|
midend_force_redraw(fe->me);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
8
midend.c
8
midend.c
@ -132,6 +132,14 @@ static void midend_set_timer(midend_data *me)
|
|||||||
deactivate_timer(me->frontend);
|
deactivate_timer(me->frontend);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void midend_force_redraw(midend_data *me)
|
||||||
|
{
|
||||||
|
if (me->drawstate)
|
||||||
|
me->ourgame->free_drawstate(me->drawstate);
|
||||||
|
me->drawstate = me->ourgame->new_drawstate(me->states[0].state);
|
||||||
|
midend_redraw(me);
|
||||||
|
}
|
||||||
|
|
||||||
void midend_new_game(midend_data *me)
|
void midend_new_game(midend_data *me)
|
||||||
{
|
{
|
||||||
while (me->nstates > 0)
|
while (me->nstates > 0)
|
||||||
|
@ -131,6 +131,7 @@ void midend_size(midend_data *me, int *x, int *y);
|
|||||||
void midend_new_game(midend_data *me);
|
void midend_new_game(midend_data *me);
|
||||||
void midend_restart_game(midend_data *me);
|
void midend_restart_game(midend_data *me);
|
||||||
int midend_process_key(midend_data *me, int x, int y, int button);
|
int midend_process_key(midend_data *me, int x, int y, int button);
|
||||||
|
void midend_force_redraw(midend_data *me);
|
||||||
void midend_redraw(midend_data *me);
|
void midend_redraw(midend_data *me);
|
||||||
float *midend_colours(midend_data *me, int *ncolours);
|
float *midend_colours(midend_data *me, int *ncolours);
|
||||||
void midend_timer(midend_data *me, float tplus);
|
void midend_timer(midend_data *me, float tplus);
|
||||||
|
Reference in New Issue
Block a user