summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-04-13 00:20:17 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-04-13 00:20:17 +0000
commite6af5d49ae76142a8bbdf5d8b4967189af3b2f15 (patch)
tree8a131c4a5f62bf1a93b2e552a372c8d12e8e8595 /gtk/gtklabel.c
parent0dfc14aa8b8d0e9a388eddfee688294ed4d1e445 (diff)
downloadgtk+-e6af5d49ae76142a8bbdf5d8b4967189af3b2f15.tar.gz
Set a flag so instead of clearing the area in advance. That looked
Sun Apr 12 20:09:40 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtklabel.[ch] (gtk_label_expose): Set a flag so instead of clearing the area in advance. That looked _really_ bad. * gtk/gtkcontainer.c (gtk_container_class_init): Changed "focus" to RUN_LAST. * gtk/gtkentry.c (gtk_entry_realize): Fixed place where allocation was used where requisition was meant. (Found by David J N Begley <david@avarice.nepean.uws.edu.au>) * gtk/gtkwindow.c (gtk_window_set_default): Fixed assertion in when setting default to NULL> ("Damon Chaplin" <DAChaplin@email.msn.com>) * gtk/gtkwidget.c (gtk_widget_unparent): Unset the default widget on the toplevel, if necessary. Sun Apr 12 02:04:21 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtkpreview.c: Removed unecessary and harmful htons/ntohs when storing properties. (X does the byte swapping itself)
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 77d738f291..e9f1558c99 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -139,6 +139,7 @@ gtk_label_init (GtkLabel *label)
label->label = NULL;
label->row = NULL;
label->jtype = GTK_JUSTIFY_CENTER;
+ label->needs_clear = 0;
gtk_label_set (label, "");
}
@@ -311,6 +312,23 @@ gtk_label_expose (GtkWidget *widget,
gdk_gc_set_clip_rectangle (widget->style->white_gc, &event->area);
gdk_gc_set_clip_rectangle (widget->style->fg_gc[state], &event->area);
+ /* We clear the whole allocation here so that if a partial
+ * expose is triggered we don't just clear part and mess up
+ * when the queued redraw comes along. (There will always
+ * be a complete queued redraw when the needs_clear flag
+ * is set.)
+ */
+ if (label->needs_clear)
+ {
+ gdk_window_clear_area (widget->window,
+ widget->allocation.x,
+ widget->allocation.y,
+ widget->allocation.width,
+ widget->allocation.height);
+
+ label->needs_clear = FALSE;
+ }
+
x = widget->allocation.x + misc->xpad +
(widget->allocation.width - widget->requisition.width)
* misc->xalign + 0.5;
@@ -377,25 +395,13 @@ static void
gtk_label_state_changed (GtkWidget *widget,
guint previous_state)
{
- if (GTK_WIDGET_NO_WINDOW (widget) &&
- GTK_WIDGET_DRAWABLE (widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ GTK_LABEL (widget)->needs_clear = 1;
}
static void
gtk_label_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
- if (GTK_WIDGET_NO_WINDOW (widget) &&
- GTK_WIDGET_DRAWABLE (widget))
- gdk_window_clear_area (widget->window,
- widget->allocation.x,
- widget->allocation.y,
- widget->allocation.width,
- widget->allocation.height);
+ GTK_LABEL (widget)->needs_clear = 1;
}