Mercurial > pidgin
changeset 1527:11977dd0fd29
[gaim-migrate @ 1537]
fix trailing text on redraw
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 03 Mar 2001 06:58:43 +0000 |
parents | 190cef255530 |
children | b0f8f1865419 |
files | src/gtkimhtml.c |
diffstat | 1 files changed, 20 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkimhtml.c Sat Mar 03 06:19:19 2001 +0000 +++ b/src/gtkimhtml.c Sat Mar 03 06:58:43 2001 +0000 @@ -549,9 +549,11 @@ GtkIMHtmlBit *bit; GtkAdjustment *vadj; gfloat oldvalue; + gint oldy; vadj = GTK_LAYOUT (imhtml)->vadjustment; oldvalue = vadj->value / vadj->upper; + oldy = imhtml->y; gtk_layout_freeze (GTK_LAYOUT (imhtml)); @@ -582,12 +584,27 @@ gtk_imhtml_draw_bit (imhtml, bit); } - if (GTK_LAYOUT (imhtml)->bin_window && (imhtml->y < GTK_WIDGET (imhtml)->allocation.y)) - gdk_window_clear (GTK_LAYOUT (imhtml)->bin_window); - gtk_widget_set_usize (GTK_WIDGET (imhtml), -1, imhtml->y + 5); gtk_adjustment_set_value (vadj, vadj->upper * oldvalue); + if (GTK_LAYOUT (imhtml)->bin_window && (imhtml->y < oldy)) { + GdkGC *gc; + GdkColormap *cmap; + + gc = gdk_gc_new (GTK_LAYOUT (imhtml)->bin_window); + cmap = gtk_widget_get_colormap (GTK_WIDGET (imhtml)); + + gdk_color_alloc (cmap, imhtml->default_bg_color); + gdk_gc_set_foreground (gc, imhtml->default_bg_color); + + gdk_draw_rectangle (GTK_LAYOUT (imhtml)->bin_window, gc, TRUE, + 0, imhtml->y - GTK_LAYOUT (imhtml)->vadjustment->value, + GTK_WIDGET (imhtml)->allocation.width, + oldy - imhtml->y); + + gdk_gc_unref (gc); + } + gtk_layout_thaw (GTK_LAYOUT (imhtml)); }