added a manager-focused message

added a beep if a manager is not closed because it still has clients
This commit is contained in:
frese 2003-04-22 21:42:13 +00:00
parent d2cb491315
commit 0c58224573
1 changed files with 5 additions and 9 deletions

View File

@ -127,21 +127,17 @@
(type (property:type p))) (type (property:type p)))
(if (equal? type (intern-atom dpy "WM_PROTOCOLS" #f)) (if (equal? type (intern-atom dpy "WM_PROTOCOLS" #f))
(let ((name (car (property:data p))) (let ((name (car (property:data p)))
(time (cadr (property:data p))) (time (cadr (property:data p))))
(client (wm:current-client wm)))
(if (equal? name (intern-atom dpy "WM_TAKE_FOCUS" #f)) (if (equal? name (intern-atom dpy "WM_TAKE_FOCUS" #f))
(begin (begin
(set-input-focus dpy main-window (revert-to parent) time) (set-input-focus dpy main-window (revert-to parent) time)
(if (and client (eq? (manager-type split) (send internal-out-channel
(wm:type wm))) (list 'manager-focused time))))
(handle-external-message wm exit
(list 'select-client client
time)))
))
(if (equal? name (intern-atom dpy "WM_DELETE_WINDOW" #f)) (if (equal? name (intern-atom dpy "WM_DELETE_WINDOW" #f))
(if (null? (wm:clients wm)) (if (null? (wm:clients wm))
;; (destroy-wm wm) would dead-lock ;; (destroy-wm wm) would dead-lock
(handle-external-message wm exit '(destroy-manager)))) (handle-external-message wm exit '(destroy-manager))
(bell dpy 100)))
)))) ))))
((destroy-window-event? xevent) ((destroy-window-event? xevent)
(exit 'destroy)) (exit 'destroy))