anchor.diff:    (setf (window-event-mask *root*) '(:substructure-notify))
   
     (unwind-protect
  -       (loop do
  -         (event-case (*display* :discard-p t)
  -                     (:key-press (code state)
  -                                 (when (eql (key-press code state) 'quit)
  -                                   (loop-finish)))
  -                     (:button-press (code state child) (button-press code state child))
  -                     (:motion-notify (event-window root-x root-y time)
  -                                     (motion-notify event-window root-x root-y time))
  -                     (:button-release () (ungrab-pointer *display*))
  -                     (:configure-request
  -                      (window x y width height)
  -                      (setf (drawable-x window) x (drawable-y window) y
  -                            (drawable-width window) width (drawable-height window) height))
  -                     (:map-notify (window override-redirect-p)
  -                                  (unless override-redirect-p
  -                                    (focus (plus window))))
  -                     (:unmap-notify (window) (focus (minus window)))))
  -    (ungrab-button *root* (code *move*) :modifiers (state *move*))
  -    (ungrab-button *root* (code *resize*) :modifiers (state *resize*))
  -    (ungrab-button *root* (code *close*) :modifiers (state *close*))
  +       (do () ((eql (process-event *display* :handler *handlers* :discard-p t) 'quit)))
  +    (dolist (b (list *move* *resize* *close*))
  +      (ungrab-button *root* (code b) :modifiers (state b)))
       (ungrab-key *root* (code *prefix*) :modifiers (state *prefix*))
       (close-display *display*)))
   
  
positive.code: (defvar last-resize nil)
  (defvar waiting-shortcut nil)
  
  (defun key-press (code state)
    (unless (is-modifier code)
      (cond (waiting-shortcut
             (let ((entry (assoc-if
                           #'(lambda (sc) (sc= sc state code)) *shortcuts*)))
               (when entry
                 (let ((fn (cdr entry)))
                   (cond ((functionp fn) (funcall fn))
                         ((eq fn 'quit) fn)))))
             (ungrab-keyboard *display*)
             (setf waiting-shortcut nil))
            ((sc= *prefix* state code)
             (grab-keyboard *root*)
             (setf waiting-shortcut t)))))
  
  (defun button-press (code state child)
    (when (and child (eql (window-override-redirect child) :off))
      (cond ((sc= *close* state code)
             (send-message child :WM_PROTOCOLS
  
negative.code:                    (drawable-height event-window) new-h))
             (setf last-resize time)))))
  
  (defhandler :button-release () (ungrab-pointer *display*))
  
  (defhandler :map-notify (window override-redirect-p)
    (unless override-redirect-p
      (focus (plus window))))
  
  (defhandler :unmap-notify (window) (focus (minus window)))
  (defhandler :configure-notify (window width height x y)
    (format t "~Ax~A+~A+~A~%" width height x y))
  
  ;;; Main
  (defun main ()
    ;; Grab prefix and mouse buttons on root
  