implemented focus-policy click (click-to-focus)
This commit is contained in:
parent
6aeb922953
commit
fd4522df8e
|
@ -315,6 +315,11 @@
|
|||
(client (make-client window client-window in-channel #f #f)))
|
||||
(define-cursor dpy client-window
|
||||
(get-option-value (wm:options wm) 'client-cursor))
|
||||
(if (memq 'click (get-option-value (wm:options wm) 'focus-policy))
|
||||
;; Note: won't work recursively (manager in manager)
|
||||
(grab-button dpy (button button1) (state-set) client-window
|
||||
#t (event-mask button-press button-release)
|
||||
(grab-mode sync) (grab-mode async) none none))
|
||||
(reparent-window dpy window client-window 0 0)
|
||||
(create-client-handler wm client)
|
||||
client))
|
||||
|
@ -420,9 +425,16 @@
|
|||
(not (window-contains-focus? dpy (client:window client))))
|
||||
(wm-select-client wm client (crossing-event-time xevent))))
|
||||
|
||||
;; ((eq? (event-type button-press) type)
|
||||
;; (if (memq 'click (get-option-value (wm:options wm) 'focus-policy))
|
||||
;; (wm-select-client wm client (button-event-time xevent))))
|
||||
((eq? (event-type button-press) type)
|
||||
(if (memq 'click (get-option-value (wm:options wm) 'focus-policy))
|
||||
(begin
|
||||
(wm-select-client wm client (button-event-time xevent))
|
||||
(if (not (eq? (button-event-subwindow xevent)
|
||||
(client:client-window client)))
|
||||
(allow-events dpy (event-mode replay-pointer)
|
||||
(button-event-time xevent))
|
||||
(allow-events dpy (event-mode async-pointer)
|
||||
(button-event-time xevent))))))
|
||||
|
||||
((destroy-window-event? xevent)
|
||||
(exit 'destroy)))))
|
||||
|
|
Loading…
Reference in New Issue