From 580fa084de560f5c3906746504f9f9ad9fb8459f Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 11 Apr 2010 12:13:53 +0000 Subject: Fix window updates when main window is scrolled. svn path=/trunk/netsurf/; revision=10347 --- gtk/gtk_window.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gtk/gtk_window.c b/gtk/gtk_window.c index cd50bea7a..cf0991096 100644 --- a/gtk/gtk_window.c +++ b/gtk/gtk_window.c @@ -794,8 +794,12 @@ void nsgtk_redraw_caret(struct gui_window *g) void gui_window_redraw(struct gui_window *g, int x0, int y0, int x1, int y1) { + int sx, sy; + + gui_window_get_scroll(g, &sx, &sy); + gtk_widget_queue_draw_area(GTK_WIDGET(g->layout), - x0, y0, x1-x0+1, y1-y0+1); + x0 - sx, y0 - sy, x1-x0+1, y1-y0+1); } void gui_window_redraw_window(struct gui_window *g) @@ -806,14 +810,17 @@ void gui_window_redraw_window(struct gui_window *g) void gui_window_update_box(struct gui_window *g, const union content_msg_data *data) { + int sx, sy; hlcache_handle *c = g->bw->current_content; if (c == NULL) return; + gui_window_get_scroll(g, &sx, &sy); + gtk_widget_queue_draw_area(GTK_WIDGET(g->layout), - data->redraw.x * g->bw->scale, - data->redraw.y * g->bw->scale, + data->redraw.x * g->bw->scale - sx, + data->redraw.y * g->bw->scale - sy, data->redraw.width * g->bw->scale, data->redraw.height * g->bw->scale); } -- cgit v1.2.3