gschem file preview function renders files twice

Bug #698501 reported by thepurlieu
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gEDA
Fix Released
Low
Unassigned

Bug Description

Just a minor observation here...nothing big.

After opening the "open file" dialog and clicking on a schematic file, the preview window to the right renders everything twice. This is quite noticeable on some of my monster schematics...you have to wait for it to flash the rendered image two times before you can click on another file.

Maybe the preview code is getting a duplicate signal from the file window? Or maybe this is actually a GTK+ bug in the file chooser widget...I'm not sure.

Cheers--
Julian

Tags: sf-bugs
Revision history for this message
Peter Clifton (pcjc2) wrote :

I can't reproduce this with GTK 2.12. What version do you have?

I instrumented with this patch in x_fileselect.c:

diff --git a/gschem/src/x_fileselect.c b/gschem/src/x_fileselect.c
index bdf8188..84a9e98 100644
--- a/gschem/src/x_fileselect.c
+++ b/gschem/src/x_fileselect.c
@@ -91,6 +91,8 @@ x_fileselect_callback_update_preview (GtkFileChooser *chooser,
     preview_filename = filename;
   }

+ printf ("Updating file preview widget\n");
+
   /* update preview */
   g_object_set (preview,
                 "filename", preview_filename,

and only get one update per file clicked.

It would be helpful if you could check and see what your box does. If it turns out to be a GTK bug, we might be able to work around it by checking whether the current preview filename matches the new one being set.

Revision history for this message
thepurlieu (thepurlieu-users) wrote :

Peter,
   I'm running 2.12 as well. Looking more into the problem...it only seems to do the double-refresh if you are browsing through files in the same directory (if you change directory, it only refreshes once for the first file that comes up). It double-refreshes the first time you open the file chooser window.
    I put some debug messages into the gschem code exactly where you did, and it is only being called once, even though I can see it being drawn twice on the screen. Could it be doing a double refresh inside the preview object handler somehow (I'm not sure where that is in the gschem code...)? I vaguely remember reading a post from you talking about double-buffering the gschem draws...could that be somehow related?

Cheers--

Revision history for this message
Peter TB Brett (peter-b) wrote :

I can reproduce this with the following patch.

diff --git a/gschem/src/x_preview.c b/gschem/src/x_preview.c
index be76d64..60f88fc 100644
--- a/gschem/src/x_preview.c
+++ b/gschem/src/x_preview.c
@@ -131,6 +131,7 @@ preview_callback_expose (GtkWidget *widget,
   preview_w_current->pl = pango_cairo_create_layout (preview_w_current->cr);

   gdk_region_get_rectangles (event->region, &rectangles, &n_rectangles);
+ g_debug ("Preview redraw");
   o_redraw_rects (preview_w_current, rectangles, n_rectangles);
   g_free (rectangles);

Changed in geda:
importance: Undecided → Low
status: New → Confirmed
Peter TB Brett (peter-b)
Changed in geda:
status: Confirmed → Triaged
Revision history for this message
Vladimir Zhbanov (vzhbanov) wrote :

Hi all,
I could not reproduce this bug neither for 1.8.0 nor for the current git master head.
So I believe its status should be changed to "Fix commited".
Any objections?

Revision history for this message
Vladimir Zhbanov (vzhbanov) wrote :

OK, to check if the bug is now solved, I've made a big schematic
and chosen it in the file open dialog. While it takes more time to
show its contents compared with small schematics, it renders
anything once now. Therefore I close this as `committed' since I
don't know when it was solved.

Changed in geda:
status: Triaged → Fix Committed
Revision history for this message
Roland Lutz (rlutz) wrote :

released in gEDA/gaf 1.10.0

Changed in geda:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.