diff --git a/src/manager.scm b/src/manager.scm index 56066f3..fc5f9cc 100644 --- a/src/manager.scm +++ b/src/manager.scm @@ -420,16 +420,20 @@ ;; ((circulate-event? xevent) ;; (send internal-out-channel (list 'update-client-state client))) ((eq? (event-type enter-notify) type) + (let ((lazy-wm-select-client + (lambda () + (if (and (not (eq? client (wm-current-client wm))) + (not (window-contains-focus? dpy (client:window client)))) + (wm-select-client wm client (crossing-event-time xevent)))))) + (if (and (memq 'enter (get-option-value (wm:options wm) 'focus-policy)) - (window-exists? dpy (client:window client)) - (not (eq? client (wm-current-client wm))) - (not (window-contains-focus? dpy (client:window client)))) + (window-exists? dpy (client:window client))) (if (ignore-next-enter-notify?) (begin (accept-next-enter-notify!) (if (not (wm-current-client wm)) - (wm-select-client wm client (crossing-event-time xevent)))) - (wm-select-client wm client (crossing-event-time xevent))))) + (lazy-wm-select-client))) + (lazy-wm-select-client))))) ((eq? (event-type button-press) type) (if (memq 'click (get-option-value (wm:options wm) 'focus-policy))