[mcclim-devel] repaint-sheet, +everywhere+ and output recording

Clemens Fruhwirth clemens at endorphin.org
Mon Jan 2 21:47:50 UTC 2006


(repaint-sheet instance-inheriting-from-output-recording-stream
+everywhere+) does not work.

The reason is %handle-repaint in recording.lisp. It rewrites region to a
bounding-rectangle regardless the type of the region. Hence,
%handle-repaint needs to check whether region is region-equal to
+nowhere+ or +everywhere+, the only unbounded region types that do not
participate in the bounding rectangle protocol.

Please comment on my patch, because I personally don't like it. It seems
a bit ackward to make explicit checks for these two regions, probably
there are better solutions. 

If you need something to reproduce the bug, try
http://paste.lisp.org/display/15284#3 - uncomment
standard-output-recording-stream from the long list of superclasses that
imitate those of application-pane to reproduce the error.

-- 
Fruhwirth Clemens - http://clemens.endorphin.org 
for robots: sp4mtrap at endorphin.org

-------------- next part --------------
Index: recording.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/recording.lisp,v
retrieving revision 1.120
diff -u -r1.120 recording.lisp
--- recording.lisp	1 Dec 2005 11:10:55 -0000	1.120
+++ recording.lisp	2 Jan 2006 21:41:45 -0000
@@ -2235,9 +2235,17 @@
 ;;;        to explicit repaint requests from the user, not exposes from X
 ;;; FIXME: Use DRAW-DESIGN*, that is fix DRAW-DESIGN*.
 
+;;; %handle-repaint needs to check whether region is region-equal to
+;;; +nowhere+ or +everywhere+, the only unbounded region types that do not
+;;; participate in the bounding rectangle protocol.
+
 (defun %handle-repaint (stream region)
-  (when (output-recording-stream-p stream)
-    (let ((region (bounding-rectangle region)))
+  (when (and (output-recording-stream-p stream)
+	     (not (region-equal region +nowhere+)))
+    (let ((region (if (region-equal region +everywhere+)
+		      (when (sheetp stream)
+			(sheet-region stream))
+		    (bounding-rectangle region))))
       (with-bounding-rectangle* (x1 y1 x2 y2) region
         (with-output-recording-options (stream :record nil)
           (draw-rectangle* stream x1 y1 x2 y2 :filled T :ink +background-ink+)))


More information about the mcclim-devel mailing list