Ignore the next enter-notify after changing the workspace.

This commit is contained in:
mainzelm 2003-05-13 20:25:15 +00:00
parent 2928e57803
commit adc01826f2
3 changed files with 25 additions and 4 deletions

View File

@ -424,7 +424,12 @@
(window-exists? dpy (client:window client)) (window-exists? dpy (client:window client))
(not (eq? client (wm-current-client wm))) (not (eq? client (wm-current-client wm)))
(not (window-contains-focus? dpy (client:window client)))) (not (window-contains-focus? dpy (client:window client))))
(wm-select-client wm client (crossing-event-time xevent)))) (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)))))
((eq? (event-type button-press) type) ((eq? (event-type button-press) type)
(if (memq 'click (get-option-value (wm:options wm) 'focus-policy)) (if (memq 'click (get-option-value (wm:options wm) 'focus-policy))
@ -503,6 +508,19 @@
(get-transient-for (wm:dpy wm) (client:window c))))) (get-transient-for (wm:dpy wm) (client:window c)))))
(wm:clients wm))) (wm:clients wm)))
;; ignoring the next enter-notify
(define (ignore-next-enter-notify!)
(set! *ignore-next-enter-notify* #t))
(define (ignore-next-enter-notify?)
*ignore-next-enter-notify*)
(define *ignore-next-enter-notify* #f)
(define (accept-next-enter-notify!)
(set! *ignore-next-enter-notify* #f))
;; *** client names ************************************************** ;; *** client names **************************************************
(define *client-names* '()) ;; (window oname name) (define *client-names* '()) ;; (window oname name)

View File

@ -97,10 +97,11 @@
(manager-type :syntax) manager-types manager-type-name (manager-type :syntax) manager-types manager-type-name
create-wm destroy-wm create-wm destroy-wm
wm-clients wm-current-client wm-clients wm-current-client
wm-manage-window wm-unmanage-window wm-select-client wm-manage-window wm-unmanage-window wm-select-client
wm-configure-window wm-iconify-window wm-maximize-window wm-configure-window wm-iconify-window wm-maximize-window
ignore-next-enter-notify!
client? client:window client:client-window client? client:window client:client-window
client:data set-client:data! client:data set-client:data!
client-name find-window-by-name get-all-window-names client-name find-window-by-name get-all-window-names

View File

@ -119,8 +119,10 @@
(let ((i (car msg)) (let ((i (car msg))
(cs (wm-clients wm))) (cs (wm-clients wm)))
(if (< i (length cs)) (if (< i (length cs))
(wm-select-client wm (list-ref cs i) (begin
(second msg))))) (ignore-next-enter-notify!)
(wm-select-client wm (list-ref cs i)
(second msg))))))
(loop))))) (loop)))))
wm)) wm))