Fix bug that would cause SIGSEGV when a screen changed while it was
authorChris Hanson <org/chris-hanson/cph>
Sun, 2 Jul 1995 06:38:33 +0000 (06:38 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 2 Jul 1995 06:38:33 +0000 (06:38 +0000)
not visible.  The optimization being performed for invisible screens
was leaving the window redisplay data structures in an inconsistent
state.  The fix uses a less-agressive optimization that does all the
redisplay up to the screen matrix, but avoids transferring the changes
to the X window.

v7/src/edwin/screen.scm

index f7855ef17a150997c8087ddf06e9974cf0be38ff..7df2c71e4e736af17c15e9d35a28af8b4c5614e3 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: screen.scm,v 1.105 1994/03/08 22:05:44 cph Exp $
+;;;    $Id: screen.scm,v 1.106 1995/07/02 06:38:33 cph Exp $
 ;;;
-;;;    Copyright (c) 1989-93 Massachusetts Institute of Technology
+;;;    Copyright (c) 1989-95 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
   (eq? 'DELETED (screen-visibility screen)))
 
 (define (update-screen! screen display-style)
-  (and (or (not (screen-visible? screen))
-          (begin
-            (if (and display-style (not (eq? 'NO-OUTPUT display-style)))
-                (screen-force-update screen))
-            (with-screen-in-update screen display-style
-              (lambda ()
-                (editor-frame-update-display! (screen-root-window screen)
-                                              display-style)))))
+  (if (and display-style (not (eq? 'NO-OUTPUT display-style)))
+      (screen-force-update screen))
+  (and (with-screen-in-update screen display-style
+        (lambda ()
+          (editor-frame-update-display! (screen-root-window screen)
+                                        display-style)))
        (begin
         (set-screen-needs-update?! screen false)
         true)))
               screen
               (lambda ()
                 (and (thunk)
-                     (or (not (screen-needs-update? screen))
-                         (and (not (eq? 'NO-OUTPUT display-style))
-                              (screen-update screen display-style)))
-                     (begin
-                       (screen-update-cursor screen)
-                       true))))))
+                     (or (not (screen-visible? screen))
+                         (and (or (not (screen-needs-update? screen))
+                                  (and (not (eq? 'NO-OUTPUT display-style))
+                                       (screen-update screen display-style)))
+                              (begin
+                                (screen-update-cursor screen)
+                                true))))))))
         (set-screen-in-update?! screen old-flag)
         finished?)))))