anchor.diff:        (rotatef (screen-backbuffer screen) (screen-framebuffer screen))
         (funcall (screen-flip-function screen)))))
   
  -(defgeneric key-press-event (window character))
  -(defmethod key-press-event ((window window) character))
  -
   (defun handle-keypress (key)
     (let ((command (gethash key *global-keybindings*)))
       (when command
  
positive.code:            (dims (array-dimensions src-buffer))
             (width (second dims))
             (height (first dims)))
        (bitblt height width src-buffer 0 0 fb x y))))
  
  (defun compose-all-displays ()
    (when *screens*
  
negative.code:           (slot-value instance 'backbuffer) (make-array (list (+ height top bottom) (+ width left right))
                                                          :element-type '(unsigned-byte 32)))))
  
  (defvar *active-drag-window* nil)
  
  (defun window-begin-drag (window mouse-x mouse-y)
    (assert (not *active-drag-window*) () "Drag already in progress!")
    (setf *active-drag-window* (list window mouse-x mouse-y)))
  
  (defun window-finish-drag (window)
    (assert (and *active-drag-window* (eql (first *active-drag-window*) window))
            (window) "Not dragging window!")
    (setf *active-drag-window* nil))
  
  (defclass window-with-chrome (window)
    ((chrome-drag-state :initform '())))
  
  (defmethod compute-window-margins ((window window-with-chrome))
    (values 1 1 19 1))
  
  (defgeneric window-redraw (window))
  
  (defgeneric key-press-event (window character))
  (defmethod key-press-event ((window window) character))
  (defgeneric mouse-button-event (window button-id state mouse-x mouse-y))
  (defmethod mouse-button-event ((window window) button-id state mouse-x mouse-y))
  (defgeneric mouse-move-event (window mouse-x mouse-y rel-x rel-y button-state))
  (defmethod mouse-move-event ((window window) mouse-x mouse-y rel-x rel-y button-state))
  
  (defun window-to-front (window)
    (format t "Raising window ~S  (current is ~S)~%" window *window-list*)
    (unless (eql window *window-list*)
      (assert *window-list* () "No open windows?")
      (setf (slot-value (window-next window) 'prev) (window-prev window)
            (slot-value (window-prev window) 'next) (window-next window))
      (setf (slot-value window 'next) *window-list*
            (slot-value window 'prev) (window-prev *window-list*))
      (setf (slot-value (window-prev *window-list*) 'next) window)
      (setf (slot-value *window-list* 'prev) window)
      (setf *window-list* window)
      (setf *refresh-required* t)))
  
  (defmethod window-redraw :before ((window window-with-chrome))
    (let* ((fb (window-backbuffer window))
  