Re: GQview 1.3.7-1.5.7 - buggy file refresh/image change interaction

John Ellis <[email protected]> Fri, 04 Feb 2005 20:28:03 -0500
Newsgroups gmane.comp.gnome.apps.gqview.devel
Message-ID <[email protected]>
Steven Mueller wrote:
> 
> Hello,
> 
> While previewing series of images while they are being downloaded,
> I've noticed that occasionally, if a directory-refresh occurs at just
> the right time when I'm switching from one image to another, the next
> image will load up all black, and then the next flip-image operation
> will skip either to the first image or, rarely, the last image in the
> directory.  Usually the black in-between "image" doesn't show up at
> all and the first image just suddenly pops up when I'm expecting the
> next one in the series.  This is often simultaneous with the redrawing
> of the image file list.  (Usually images are coming in to the end of

Please try the attached patch for view_file_list.c and let me know if it solves
the issue.


The selection changed signal for the file list is sent in an idle function (for
performance purposes, such as when deleting many images). The problem is that
the pointer to the selected image used by the idle function is not updated when
the file list is refreshed, so it becomes invalid. A timed event has priority
over an idle event, so the automatic timed refresh can occur when the idle
selection 'event' is still pending.

The patch adds a fix to update the selection pointer during a refresh, and adds
a sanity check to throw away the selection 'event' if the image pointer is no
longer valid (to avoid blanking the display if the selected image no longer
exists after a refresh).

I could not repeat the bug with the file list in icon mode, so if you have ever
seen it there too please let me know so I can investigate a little more.

Greetings,
John


-- 
John Ellis <[email protected]>

http://gqview.sourceforge.net <GQview> | http://hideseek.sourceforge.net
http://gqmpeg.sourceforge.net <GQmpeg> |     <Preferences Hide and Seek>
gqview-1.5.7-refreshfix.patch (text/plain, 740 B)
Index: view_file_list.c
===================================================================
RCS file: /devel/cvs/gqview/src/view_file_list.c,v
retrieving revision 1.34
diff -u -r1.34 view_file_list.c
--- view_file_list.c	30 Jan 2005 14:41:52 -0000	1.34
+++ view_file_list.c	5 Feb 2005 00:16:31 -0000
@@ -650,6 +650,7 @@
 	const gchar *read_ahead_path = NULL;
 
 	path = vflist_index_get_path(vfl, row);
+	if (!path) return;
 
 	if (path && enable_read_ahead)
 		{
@@ -1329,6 +1330,8 @@
 
 				gtk_list_store_set(store, &iter, FILE_COLUMN_THUMB, (thumbs) ? fd->pixbuf : NULL, -1);
 
+				if (vfl->select_fd == old_fd) vfl->select_fd = fd;
+
 				if (valid) valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
 
 				done = TRUE;