[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: branch: master updated (1.3.1-20080110-25-g5d619d9)



The branch, master has been updated
       via  5d619d94e6142ad683b26aa302348b3cf559d459 (commit)
      from  f1d90025127f83b606003ae9a42b85fdba60e490 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gschem/src/o_basic.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)


=================
 Commit Messages
=================

commit 5d619d94e6142ad683b26aa302348b3cf559d459
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 27 02:51:01 2008 +0000

    Only call gdk_window_invalidate_rect() when drawing to a GdkWindow.
    
    For image export, a GdkPixmap is used in place of w_current->window,
    and calling gdk_window_invalidate_rect() with this as an argument
    causes lots of nasty warnings. It led to a crash when print.scm is
    used to export from the command line.
    
    This "fix" is really quite a nasty hack. Since w_current->window is
    a GObject in both cases, a test with GDK_IS_WINDOW() can be used to
    distinguish the cases. A better fix will come from future rework of
    the drawing code.

:100644 100644 374a979... ad205e8... M	gschem/src/o_basic.c

=========
 Changes
=========

commit 5d619d94e6142ad683b26aa302348b3cf559d459
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sun Jan 27 02:51:01 2008 +0000

    Only call gdk_window_invalidate_rect() when drawing to a GdkWindow.
    
    For image export, a GdkPixmap is used in place of w_current->window,
    and calling gdk_window_invalidate_rect() with this as an argument
    causes lots of nasty warnings. It led to a crash when print.scm is
    used to export from the command line.
    
    This "fix" is really quite a nasty hack. Since w_current->window is
    a GObject in both cases, a test with GDK_IS_WINDOW() can be used to
    distinguish the cases. A better fix will come from future rework of
    the drawing code.

diff --git a/gschem/src/o_basic.c b/gschem/src/o_basic.c
index 374a979..ad205e8 100644
--- a/gschem/src/o_basic.c
+++ b/gschem/src/o_basic.c
@@ -678,6 +678,12 @@ void o_glist_draw_xor(GSCHEM_TOPLEVEL *w_current, int dx, int dy, GList *list)
  *  to expand the invalidated region if anti-aliased drawing is ever
  *  used.
  *
+ *  If the GSCHEM_TOPLEVEL in question is not rendering to a GDK_WINDOW,
+ *  (e.g. image export), this function call is a no-op. A test is used:
+ *  GDK_IS_WINDOW(), which should be safe since in either case,
+ *  w_current->window is a GObject. This is really a _HACK_,
+ *  and should be fixed with a re-worked drawing model.
+ *
  *  \param [in] w_current  The GSCHEM_TOPLEVEL who's drawing area is being invalidated.
  *  \param [in] x1         X coord for corner 1 (SCREEN units)
  *  \param [in] y1         Y coord for corner 1 (SCREEN units)
@@ -689,6 +695,11 @@ void o_invalidate_rect( GSCHEM_TOPLEVEL *w_current,
 {
   GdkRectangle rect;
 
+  /* BUG: We get called when rendering an image, and w_current->window
+   *      is a GdkPixmap. Ensure we only invalidate GdkWindows. */
+  if (!GDK_IS_WINDOW( w_current->window ))
+    return;
+
   rect.x = MIN(x1, x2) - INVALIDATE_MARGIN;
   rect.y = MIN(y1, y2) - INVALIDATE_MARGIN;
   rect.width = 1 + abs( x1 - x2 ) + 2 * INVALIDATE_MARGIN;




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs