anchor.diff:    ;; This folds multiple redisplay events into a single screen update,
     ;; preventing other events from being held up by slow redisplays.
     (loop
  -       (multiple-value-bind (event validp)
  -           (mezzano.supervisor:fifo-pop *event-queue* nil)
  -         (when (not validp)
  -           (return))
  -         (sys.int::log-and-ignore-errors
  -          (process-event event))))
  -  (when *redisplay-pending*
  -    (recompose-windows (eql *redisplay-pending* :full))
  -    (setf *redisplay-pending* nil))
  -  ;; Block waiting for the next event.
  -  (sys.int::log-and-ignore-errors
  -   (process-event (mezzano.supervisor:fifo-pop *event-queue*))))
  -
  -(defun compositor-thread ()
  -  (loop (compositor-thread-body)))
  -
  -(defvar *compositor-update-interval* 1/60)
  -(defparameter *screensaver-spawn-function* nil)
  -(defparameter *screensaver-time* (* 1 60))
  -
  -(defun compositor-heartbeat-thread-body ()
  -  (sleep *compositor-update-interval*)
  +     (multiple-value-bind (event validp)
  +         (mezzano.sync:mailbox-receive *event-queue* :wait-p nil)
  +       (when (not validp)
  +         (return))
  +       (sys.int::log-and-ignore-errors
  +         (process-event event))))
  +  ;; FIXME: reimplement the screensaver stuff. tricky bit is not spawing the screen saver over and over.
  +  #+(or)
     (when *screensaver-spawn-function*
       (let ((old-idle *idle-time*))
         (incf *idle-time* *compositor-update-interval*)
  
positive.code:         *clip-rect-width* 0
          *clip-rect-height* 0))
  
  (defun compositor-thread-body ()
    (when (not (eql *main-screen* (mezzano.supervisor:current-framebuffer)))
      ;; Framebuffer changed. Rebuild the screen.
  
negative.code: 
  (defvar *redisplay-pending* nil)
  
  (defclass redisplay-event (event)
    ((%fullp :initarg :full :reader redisplay-event-fullp))
    (:default-initargs :full nil))
  
  (defmethod process-event ((event redisplay-event))
    (when (not (eql *redisplay-pending* :full))
      (setf *redisplay-pending* (if (redisplay-event-fullp event) :full t))))
  
  (defun force-redisplay (&optional full)
    (submit-compositor-event (make-instance 'redisplay-event :full full)))
  
  ;;;; Notifications.
  
  