changeset 87:a2b0a7b0b490

Wed Oct 25 15:17:38 2006 John Ellis <johne@verizon.net> * pixbuf-renderer.c (pixbuf_renderer_scroll): Fix long standing bug where obstructed portions of an image were not always generating an expose event when scrolling the image.
author gqview
date Wed, 25 Oct 2006 19:23:46 +0000
parents cade6a52a165
children 2099ee3f9a8d
files ChangeLog src/pixbuf-renderer.c
diffstat 2 files changed, 26 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 23 09:40:37 2006 +0000
+++ b/ChangeLog	Wed Oct 25 19:23:46 2006 +0000
@@ -1,3 +1,9 @@
+Wed Oct 25 15:17:38 2006  John Ellis  <johne@verizon.net>
+
+	* pixbuf-renderer.c (pixbuf_renderer_scroll): Fix long standing bug
+	where obstructed portions of an image were not always generating an
+	expose event when scrolling the image.
+
 Mon Oct 23 05:34:29 2006  John Ellis  <johne@verizon.net>
 
 	* img-view.c, layout_image.c, layout_util.c, pan-view.c: Make F11 also
--- a/src/pixbuf-renderer.c	Mon Oct 23 09:40:37 2006 +0000
+++ b/src/pixbuf-renderer.c	Wed Oct 25 19:23:46 2006 +0000
@@ -2008,6 +2008,12 @@
 				w, h,
 				pr->dither_quality, it->x + x, it->y + y);
 		}
+
+#if 0
+	/* enable this line for debugging the edges of tiles */
+	gdk_draw_rectangle(it->pixmap, box->style->white_gc,
+			   FALSE, 0, 0, it->w, it->h);
+#endif
 }
 
 
@@ -2779,6 +2785,7 @@
 		gint x2, y2;
 		GtkWidget *box;
 		GdkGC *gc;
+		GdkEvent *event;
 
 		if (x_off < 0)
 			{
@@ -2833,6 +2840,19 @@
 				 pr->x_scroll, y_off > 0 ? pr->y_scroll + (pr->vis_height - h) : pr->y_scroll,
 				 pr->vis_width, h, TRUE, TILE_RENDER_ALL, FALSE, FALSE);
 			}
+
+		/* process exposures here, "expose_event" seems to miss a few with obstructed windows */
+		while ((event = gdk_event_get_graphics_expose(box->window)) != NULL)
+			{
+			pixbuf_renderer_paint(pr, &event->expose.area);
+
+			if (event->expose.count == 0)
+				{
+				gdk_event_free(event);
+				break;
+				}
+			gdk_event_free(event);
+			}
 		}
 }