--- orig/user.lisp +++ mod/user.lisp @@ -98,7 +98,9 @@ (car window-list) ;; Otherwise, focus the next one in the list. (cadr wins))) - (frame-raise-window screen (window-frame screen nw) nw))) + ;; If there are no windows in the frame, there is no window to focus. + (when nw + (frame-raise-window screen (window-frame screen nw) nw)))) (defun delete-current-window (screen) "Send a delete event to the current window." @@ -199,7 +201,9 @@ ;; update the current frame and sync it's windows (setf (screen-current-frame screen) l) (sync-frame-windows screen l) - (frame-raise-window screen l (frame-window (frame-data screen l)))))) + (let ((window (frame-window (frame-data screen l)))) + (when window + (frame-raise-window screen l window)))))) (defun focus-frame-sibling (screen) (let* ((sib (sibling (screen-frame-tree screen)