From 8b5667a1889d519fd4e8ede7af123ace662be97e Mon Sep 17 00:00:00 2001 From: frese Date: Wed, 16 Apr 2003 15:02:41 +0000 Subject: [PATCH] fixed take-focus --- src/utils.scm | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/src/utils.scm b/src/utils.scm index fa1d5c2..6100dcd 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -288,23 +288,12 @@ (wm-take-focus (intern-atom dpy "WM_TAKE_FOCUS" #f)) (wm-hints (get-wm-hints dpy window)) (t (and wm-hints (assq (wm-hint input?) wm-hints))) - (input? (if t (cdr t) #t))) - (let ((type (if (not (and protocols wm-take-focus - (memq wm-take-focus protocols))) - (if input? - 'passive - 'no-input) - (if input? - 'locally-active - 'globally-active)))) - ;; we use passive as the default (with no hints at all) - (case type - ((passive) - (set-input-focus dpy window (revert-to parent) time)) ;; ?? - ((globally-active) #t) - ((locally-active) - (send-protocol-message dpy window wm-take-focus time)) - ((no-focus) #f))))) + (input? (if t (cdr t) #f))) + (if input? + (set-input-focus dpy window (revert-to parent) time)) + (if (and protocols wm-take-focus + (memq wm-take-focus protocols)) + (send-protocol-message dpy window wm-take-focus time)))) (define (send-protocol-message dpy window atom time) (send-event dpy window #f (event-mask)