From ba697048386d840a5af8a9a56f47b7e3bd4ead9e Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 29 Oct 2005 14:21:24 +0000 Subject: Skip spinner update when we're not loaded. Should fix bug #320079. 2005-10-29 Christian Persch * lib/widgets/ephy-spinner.c: (bump_spinner_frame_cb), (ephy_spinner_start): Skip spinner update when we're not loaded. Should fix bug #320079. --- lib/widgets/ephy-spinner.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-spinner.c b/lib/widgets/ephy-spinner.c index 5ae2876f2..1371ea3dd 100644 --- a/lib/widgets/ephy-spinner.c +++ b/lib/widgets/ephy-spinner.c @@ -700,14 +700,19 @@ ephy_spinner_expose (GtkWidget *widget, static gboolean bump_spinner_frame_cb (EphySpinner *spinner) { + EphySpinnerDetails *details = spinner->details; GList *frame; - if (!GTK_WIDGET_DRAWABLE (spinner)) - { - return TRUE; - } + if (!GTK_WIDGET_DRAWABLE (spinner)) return TRUE; + + /* This can happen when we've unloaded the images on a theme + * change, but haven't been in the queued size request yet. + * Just skip this update. + */ + if (details->images == NULL) return TRUE; - frame = spinner->details->current_image; + frame = details->current_image; + g_assert (frame != NULL); if (frame->next != NULL) { @@ -718,7 +723,7 @@ bump_spinner_frame_cb (EphySpinner *spinner) frame = g_list_first (frame); } - spinner->details->current_image = frame; + details->current_image = frame; gtk_widget_queue_draw (GTK_WIDGET (spinner)); @@ -742,7 +747,6 @@ ephy_spinner_start (EphySpinner *spinner) if (GTK_WIDGET_MAPPED (GTK_WIDGET (spinner)) && details->timer_task == 0 && ephy_spinner_load_images (spinner)) - { if (details->images != NULL) { -- cgit v1.2.3