This commit is contained in:
Matthias Clasen 2006-06-12 01:54:54 +00:00
parent adb725eadc
commit df882a3279
5 changed files with 38 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2006-06-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprogressbar.h: Add a dirty flag to GtkProgressBar.n/
* gtk/gtkprogressbar.c: Defer updating of the offscreen
pixmap until expose. (#344543, Chris Wilson)
2006-06-11 Emmanuele Bassi <ebassi@gnome.org> 2006-06-11 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchooserdefault.c * gtk/gtkrecentchooserdefault.c

View File

@ -1,3 +1,9 @@
2006-06-11 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprogressbar.h: Add a dirty flag to GtkProgressBar.n/
* gtk/gtkprogressbar.c: Defer updating of the offscreen
pixmap until expose. (#344543, Chris Wilson)
2006-06-11 Emmanuele Bassi <ebassi@gnome.org> 2006-06-11 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchooserdefault.c * gtk/gtkrecentchooserdefault.c

View File

@ -56,7 +56,7 @@ static void gtk_progress_get_property (GObject *object,
static void gtk_progress_destroy (GtkObject *object); static void gtk_progress_destroy (GtkObject *object);
static void gtk_progress_finalize (GObject *object); static void gtk_progress_finalize (GObject *object);
static void gtk_progress_realize (GtkWidget *widget); static void gtk_progress_realize (GtkWidget *widget);
static gint gtk_progress_expose (GtkWidget *widget, static gboolean gtk_progress_expose (GtkWidget *widget,
GdkEventExpose *event); GdkEventExpose *event);
static void gtk_progress_size_allocate (GtkWidget *widget, static void gtk_progress_size_allocate (GtkWidget *widget,
GtkAllocation *allocation); GtkAllocation *allocation);
@ -283,7 +283,7 @@ gtk_progress_finalize (GObject *object)
G_OBJECT_CLASS (gtk_progress_parent_class)->finalize (object); G_OBJECT_CLASS (gtk_progress_parent_class)->finalize (object);
} }
static gint static gboolean
gtk_progress_expose (GtkWidget *widget, gtk_progress_expose (GtkWidget *widget,
GdkEventExpose *event) GdkEventExpose *event)
{ {

View File

@ -73,6 +73,8 @@ static void gtk_progress_bar_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static gboolean gtk_progress_bar_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_progress_bar_size_request (GtkWidget *widget, static void gtk_progress_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition); GtkRequisition *requisition);
static void gtk_progress_bar_real_update (GtkProgress *progress); static void gtk_progress_bar_real_update (GtkProgress *progress);
@ -105,6 +107,7 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
gobject_class->set_property = gtk_progress_bar_set_property; gobject_class->set_property = gtk_progress_bar_set_property;
gobject_class->get_property = gtk_progress_bar_get_property; gobject_class->get_property = gtk_progress_bar_get_property;
widget_class->expose_event = gtk_progress_bar_expose;
widget_class->size_request = gtk_progress_bar_size_request; widget_class->size_request = gtk_progress_bar_size_request;
progress_class->paint = gtk_progress_bar_paint; progress_class->paint = gtk_progress_bar_paint;
@ -438,7 +441,7 @@ gtk_progress_bar_real_update (GtkProgress *progress)
} }
} }
} }
gtk_progress_bar_paint (progress); pbar->dirty = TRUE;
gtk_widget_queue_draw (GTK_WIDGET (progress)); gtk_widget_queue_draw (GTK_WIDGET (progress));
} }
else else
@ -451,12 +454,28 @@ gtk_progress_bar_real_update (GtkProgress *progress)
if (pbar->in_block != in_block) if (pbar->in_block != in_block)
{ {
pbar->in_block = in_block; pbar->in_block = in_block;
gtk_progress_bar_paint (progress); pbar->dirty = TRUE;
gtk_widget_queue_draw (GTK_WIDGET (progress)); gtk_widget_queue_draw (GTK_WIDGET (progress));
} }
} }
} }
static gboolean
gtk_progress_bar_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GtkProgressBar *pbar;
g_return_val_if_fail (GTK_IS_PROGRESS_BAR (widget), FALSE);
pbar = GTK_PROGRESS_BAR (widget);
if (GTK_WIDGET_DRAWABLE (widget) && pbar->dirty)
gtk_progress_bar_paint (GTK_PROGRESS (pbar));
return GTK_WIDGET_CLASS (gtk_progress_bar_parent_class)->expose_event (widget, event);
}
static void static void
gtk_progress_bar_size_request (GtkWidget *widget, gtk_progress_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition) GtkRequisition *requisition)
@ -870,6 +889,8 @@ gtk_progress_bar_paint (GtkProgress *progress)
else else
gtk_progress_bar_paint_discrete (pbar, orientation); gtk_progress_bar_paint_discrete (pbar, orientation);
} }
pbar->dirty = FALSE;
} }
} }

View File

@ -77,6 +77,7 @@ struct _GtkProgressBar
guint activity_dir : 1; guint activity_dir : 1;
guint ellipsize : 3; guint ellipsize : 3;
guint dirty : 1;
}; };
struct _GtkProgressBarClass struct _GtkProgressBarClass