From: Chris Hanson Date: Thu, 24 Oct 1996 16:29:46 +0000 (+0000) Subject: Synchronize action of XTERM-SCREEN/ENTER! until after the window is X-Git-Tag: 20090517-FFI~5338 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=7a1f047b2a5786a85a0cd6a9f425ee8b7b26d197;p=mit-scheme.git Synchronize action of XTERM-SCREEN/ENTER! until after the window is properly mapped on the screen. This will hopefully eliminate the weird race condition that has been causing so many errors. --- diff --git a/v7/src/edwin/xterm.scm b/v7/src/edwin/xterm.scm index 4a1f9268f..20765231f 100644 --- a/v7/src/edwin/xterm.scm +++ b/v7/src/edwin/xterm.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: xterm.scm,v 1.53 1996/04/24 01:48:40 cph Exp $ +;;; $Id: xterm.scm,v 1.54 1996/10/24 16:29:46 cph Exp $ ;;; ;;; Copyright (c) 1989-96 Massachusetts Institute of Technology ;;; @@ -243,7 +243,10 @@ (if screen (let ((visibility (screen-visibility screen))) (if (pair? visibility) - (set-screen-visibility! screen (car visibility))))))) + (begin + (set-screen-visibility! screen (car visibility)) + (for-each (lambda (procedure) (procedure screen)) + (reverse (cdr visibility))))))))) (define-integrable (screen-xterm screen) (xterm-screen-state/xterm (screen-state screen))) @@ -325,12 +328,20 @@ (set-screen-redisplay-flag! screen true)) (define (xterm-screen/enter! screen) - (set-screen-selected?! screen true) - (let ((xterm (screen-xterm screen))) - (xterm-enable-cursor xterm true) - (xterm-draw-cursor xterm)) - (xterm-screen/grab-focus! screen) - (xterm-screen/flush! screen)) + (if (pair? (screen-visibility screen)) + (without-interrupts + (lambda () + (if (not (memq xterm-screen/enter! (cdr (screen-visibility screen)))) + (set-cdr! (screen-visibility screen) + (cons xterm-screen/enter! + (cdr (screen-visibility screen))))))) + (begin + (set-screen-selected?! screen true) + (let ((xterm (screen-xterm screen))) + (xterm-enable-cursor xterm true) + (xterm-draw-cursor xterm)) + (xterm-screen/grab-focus! screen) + (xterm-screen/flush! screen)))) (define (xterm-screen/grab-focus! screen) (and last-focus-time