anchor.diff:    (mezzano.gui.widgets:frame-mouse-event (frame window) event))
   
   (defmethod dispatch-event (window (event mezzano.gui.compositor:window-close-event))
  -  (throw 'mezzano.supervisor::terminate-thread nil)
  -  (setf (window-closed window) t))
  +  (throw 'mezzano.supervisor:terminate-thread nil))
  +
  +(defmethod dispatch-event (app (event mezzano.gui.compositor:resize-request-event))
  +  (let ((old-width (mezzano.gui.compositor:width (window app)))
  +        (old-height (mezzano.gui.compositor:height (window app)))
  +        (new-width (max 100 (mezzano.gui.compositor:width event)))
  +        (new-height (max 100 (mezzano.gui.compositor:height event))))
  +    (when (or (not (eql old-width new-width))
  +              (not (eql old-height new-height)))
  +      (let ((new-framebuffer (mezzano.gui:make-surface
  +                              new-width new-height)))
  +        (mezzano.gui.widgets:resize-frame (frame app) new-framebuffer)
  +        (mezzano.gui.compositor:resize-window
  +         (window app) new-framebuffer
  +         :origin (mezzano.gui.compositor:resize-origin event))))))
  +
  +(defmethod dispatch-event (app (event mezzano.gui.compositor:resize-event))
  +  (let* ((window (window app))
  +         (fb (mezzano.gui.compositor:window-buffer window))
  +         (frame (frame app))
  +         (new-width (mezzano.gui:surface-width fb))
  +         (new-height (mezzano.gui:surface-height fb)))
  +    (mezzano.gui.widgets:resize-text-widget
  +     app
  +     fb
  +     (nth-value 0 (mezzano.gui.widgets:frame-size frame))
  +     (nth-value 2 (mezzano.gui.widgets:frame-size frame))
  +     (- (mezzano.gui.compositor:width window)
  +        (nth-value 0 (mezzano.gui.widgets:frame-size frame))
  +        (nth-value 1 (mezzano.gui.widgets:frame-size frame)))
  +     (- (mezzano.gui.compositor:height window)
  +        (nth-value 2 (mezzano.gui.widgets:frame-size frame))
  +        (nth-value 3 (mezzano.gui.widgets:frame-size frame))))))
   
   (defun pump-event-loop (window)
     "Read & dispatch window events until there are no more waiting events."
  
positive.code:   ;; Eat unknown events.
    (:method (w e)))
  
  (defmethod dispatch-event (window (event mezzano.gui.compositor:window-activation-event))
    (setf (mezzano.gui.widgets:activep (frame window)) (mezzano.gui.compositor:state event))
    (mezzano.gui.widgets:draw-frame (frame window)))
  
negative.code:                                    :framebuffer framebuffer
                                     :title (string (or title initial-function "REPL"))
                                     :close-button-p t
                                     :resizablep t
                                     :damage-function (mezzano.gui.widgets:default-damage-function window)
                                     :set-cursor-function (mezzano.gui.widgets:default-cursor-function window)))
               (term (make-instance 'fancy-repl
                                    :fifo fifo
                                    :window window
  