fixed take-focus

This commit is contained in:
frese 2003-04-16 15:02:41 +00:00
parent 42a49bfd15
commit 8b5667a188
1 changed files with 6 additions and 17 deletions

View File

@ -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)))
(input? (if t (cdr t) #f)))
(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)))))
(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)