diff --git a/src/button.scm b/src/button.scm index 6d4163a..2a43c09 100644 --- a/src/button.scm +++ b/src/button.scm @@ -40,11 +40,11 @@ (let loop ((state 'up)) (let ((e (receive event-channel))) (cond - ((expose-event? e) + ((and (expose-event? e) (window-exists? dpy window)) (draw-button button gc state) (loop state)) ((destroy-window-event? e) 'destroyed) - ((button-event? e) + ((and (button-event? e) (window-exists? dpy window)) (if (eq? (event-type button-press) (button-event-type e)) (begin