;;; -*- Mode:Lisp; Readtable:ZL; Package:USER; Base:8; Patch-File:T -*-
;;; Patch file for System version 126.71
;;; Reason:
;;;  When warm-booting the Lambda, the SDU can clobber bits on the exposed
;;;  window.  In particular, this is annoying when the label gets clobbered.
;;;  (Not every user knows about [Terminal]+[Clear-Screen], which refreshes
;;;  everything; and see last comment, below).
;;;  
;;;  This patch creates a warm-initialization to redraw the labels on every
;;;  window. (We don't know how many, where, may have been clobbered.)
;;;  
;;;  To facilitate this, (:METHOD TV:ESSENTIAL-LABEL-MIXIN :REDRAW-LABEL) is
;;;  provided.  It erases, then draws, a window's label.
;;;  
;;;  A more radical approach would redisplay all windows, but some windows go
;;;  blank; look at, and try, TV:KBD-SCREEN-REDISPLAY.  I feel redrawing just
;;;  the labels is a nice compromise, since it cleans up the worst case only.
;;; Reason:
;;;  testing redraw-labels patch
;;; Written 7-Sep-88 23:33:46 by keith (Keith Corbett) at site Gigamos Cambridge
;;; while running on Breaking Glass from band 3
;;; with Experimental System 126.70, Experimental ZWEI 126.8, Experimental ZMail 74.1, Experimental Local-File 76.0, Experimental File-Server 25.0, Experimental Unix-Interface 14.0, Experimental Tape 25.1, Experimental Lambda-Diag 18.0, microcode 1762, SDU Boot Tape 3.14, SDU ROM 103, Lambda/Falcon Development System.



; From modified file DJ: L.WINDOW; BASWIN.LISP#579 at 7-Sep-88 23:36:21
#8R TV#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "TV")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: WINDOW; BASWIN  "


;;;The label is refreshed by an after demon on :REFRESH-MARGINS, below.
;;;But this is intended for other callers who need the label redrawn.
;;;(Possibly some dark external force has clobbered the bits, e.g. the
;;;SDU on the Lambda during warm-boot.)

(defmethod (essential-label-mixin :redraw-label) ()
  (erase-label)
  (draw-label))

))

; From modified file DJ: L.SYS; LTOP.LISP#584 at 7-Sep-88 23:40:43
#8R SYSTEM-INTERNALS#: 
(COMPILER-LET ((*PACKAGE* (PKG-FIND-PACKAGE "SYSTEM-INTERNALS")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: SYS; LTOP  "


(defun maybe-redraw-window-labels ()
  (unless *cold-booting*
    (dolist (window (send tv:main-screen :inferiors))
      (send-if-handles window :redraw-label))))

(add-initialization "Maybe redraw possibly clobbered window labels"
		    '(maybe-redraw-window-labels)
		    :warm)

))
