Fix bug: the C-x z command was closing the editor windows and leaving
authorChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 1995 21:20:13 +0000 (21:20 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 22 Apr 1995 21:20:13 +0000 (21:20 +0000)
the editor in an unusable state.  This happened because the actions of
initializing and finalizing the PM interface were happening in the
wrong place.

v7/src/edwin/os2term.scm

index c9d434f9a40f4de60d5cd66ef15d1b508a2278d7..627b2420bee7cc3f31d663045e0701bf2c0f2298 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: os2term.scm,v 1.6 1995/04/10 16:53:05 cph Exp $
+;;;    $Id: os2term.scm,v 1.7 1995/04/22 21:20:13 cph Exp $
 ;;;
 ;;;    Copyright (c) 1994-95 Massachusetts Institute of Technology
 ;;;
 (define reading-event?)
 (define desktop-width)
 (define desktop-height)
+(define hide-console?)
 
 (define (initialize-package!)
   (set! os2-display-type
        (make-display-type 'PM
                           #t
-                          (lambda () #t)
+                          (lambda () (initialize-pm-state) #t)
                           make-os2-screen
                           get-os2-input-operations
                           with-editor-interrupts-from-os2
        (set! screen-list '())
        (set! event-queue (make-queue))
        (set! event-descriptor (os2win-open-event-qid))
+       (set! desktop-width (os2win-desktop-width))
+       (set! desktop-height (os2win-desktop-height))
+       (set! hide-console? #t)
        unspecific)))
 
 (define (finalize-pm-state)
   (if event-descriptor
       (begin
-       (do () ((null? screen-list))
-         (os2-screen/discard! (car screen-list)))
+       (do () ((null? screen-list)) (os2-screen/discard! (car screen-list)))
        (set! event-queue)
        (os2win-close-event-qid event-descriptor)
        (set! event-descriptor #f)
              (signal-interrupts? #t)
              (previewer-registration))
     (dynamic-wind (lambda ()
-                   (initialize-pm-state)
                    (preview-event-stream)
-                   (set! desktop-width (os2win-desktop-width))
-                   (set! desktop-height (os2win-desktop-height))
-                   (os2win-set-state (os2win-console-wid) window-state:hide))
+                   (if hide-console?
+                       (begin
+                         (set! hide-console? #f)
+                         (os2win-set-state (os2win-console-wid)
+                                           window-state:hide))))
                  (lambda ()
                    (receiver (lambda (thunk) (thunk)) '()))
                  (lambda ()
-                   (deregister-input-thread-event previewer-registration)
-                   (finalize-pm-state)))))
+                   (deregister-input-thread-event previewer-registration)))))
 
 (define (with-os2-interrupts-enabled thunk)
   (with-signal-interrupts #t thunk))
                    unspecific))))
 \f
 (define (make-os2-screen)
-  ;; Call to INITIALIZE-PM-STATE needed because first screen is built
-  ;; before the display is grabbed.  This is a bug that should be
-  ;; fixed -- the display grab should be the very first thing that
-  ;; happens.
-  (initialize-pm-state)
   (call-with-values open-window
     (lambda (state x-size y-size)
       (let ((screen