fixed take-focus
This commit is contained in:
parent
42a49bfd15
commit
8b5667a188
|
@ -288,23 +288,12 @@
|
||||||
(wm-take-focus (intern-atom dpy "WM_TAKE_FOCUS" #f))
|
(wm-take-focus (intern-atom dpy "WM_TAKE_FOCUS" #f))
|
||||||
(wm-hints (get-wm-hints dpy window))
|
(wm-hints (get-wm-hints dpy window))
|
||||||
(t (and wm-hints (assq (wm-hint input?) wm-hints)))
|
(t (and wm-hints (assq (wm-hint input?) wm-hints)))
|
||||||
(input? (if t (cdr t) #t)))
|
(input? (if t (cdr t) #f)))
|
||||||
(let ((type (if (not (and protocols wm-take-focus
|
(if input?
|
||||||
(memq wm-take-focus protocols)))
|
(set-input-focus dpy window (revert-to parent) time))
|
||||||
(if input?
|
(if (and protocols wm-take-focus
|
||||||
'passive
|
(memq wm-take-focus protocols))
|
||||||
'no-input)
|
(send-protocol-message dpy window wm-take-focus time))))
|
||||||
(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)))))
|
|
||||||
|
|
||||||
(define (send-protocol-message dpy window atom time)
|
(define (send-protocol-message dpy window atom time)
|
||||||
(send-event dpy window #f (event-mask)
|
(send-event dpy window #f (event-mask)
|
||||||
|
|
Loading…
Reference in New Issue