diff --git a/src/utils.scm b/src/utils.scm index b70e359..1758a77 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -295,8 +295,11 @@ (window-path dpy p))))) (define (window-viewable? dpy window) - (eq? (window-attribute:map-state (get-window-attributes dpy window)) - (map-state is-viewable))) + (and window + (let ((attrs (get-window-attributes dpy window))) + (and attrs + (eq? (window-attribute:map-state attrs) + (map-state is-viewable)))))) (define (window-mapped? dpy window) (and window