clearified client creation process

This commit is contained in:
frese 2003-04-22 15:43:57 +00:00
parent d158788001
commit de88cf5fb6
3 changed files with 38 additions and 18 deletions

View File

@ -43,6 +43,15 @@
((deinit-client)
(deinit-client wm (second msg)))
((configure-window)
(let ((window (second msg))
(changes (third msg)))
;; TODO: exact sizes ?!
(configure-window dpy window
(append (make-window-change-alist
(border-width 0))
changes))))
((draw-client-window)
(draw-client-window wm (second msg) gc))
((fit-client)
@ -57,8 +66,7 @@
(let* ((client (second msg))
(dpy (wm:dpy wm))
(window (client:window client))
(state (if (and (window-exists? dpy window)
(window-contains-focus? dpy window))
(state (if (window-contains-focus? dpy window)
'focused
'normal))
(titlebar (car (client:data client)))
@ -71,7 +79,6 @@
(define (init-client wm client maybe-rect)
(let ((dpy (wm:dpy wm)))
(set-window-border-width! dpy (client:window client) 0)
(let* ((r (initial-client-rect wm (client:window client) maybe-rect))
(channel (make-channel))
(titlebar (create-client-titlebar channel wm client))

View File

@ -121,14 +121,18 @@
(set-wm-state! (root-wm:dpy root-wm) window (wm-state normal) none)
(wm-manage-window (root-wm:current-manager root-wm) window))
(define (root-wm-configure-window root-wm window changes)
(wm-configure-window (root-wm:current-manager root-wm) window changes))
(define (handle-xevent root-wm exit xevent)
(let ((type (any-event-type xevent))
(dpy (root-wm:dpy root-wm)))
(cond
((configure-request-event? xevent)
;; TODO: maybe let it configure by the future manager...
(configure-window dpy (configure-request-event-window xevent)
(configure-request-event-window-change-alist xevent)))
(root-wm-configure-window
root-wm
(configure-request-event-window xevent)
(configure-request-event-window-change-alist xevent)))
((map-request-event? xevent)
(root-wm-manage-window root-wm (map-request-event-window xevent)))
((and (unmap-event? xevent) (not (unmap-event-from-configure? xevent)))

View File

@ -60,6 +60,15 @@
(init-client wm data (second msg) (third msg)))
((deinit-client)
(deinit-client wm data (second msg)))
((configure-window)
(let ((window (second msg))
(changes (third msg)))
;; TODO: exact sizes ?!
(configure-window dpy window
(append (make-window-change-alist
(border-width 0))
changes))))
((draw-client-window) #f)
@ -80,16 +89,17 @@
((update-client-state)
(let* ((client (second msg))
(dpy (wm:dpy wm))
(window (client:window client))
(state (if (window-contains-focus? dpy window)
'focused
(if (window-viewable? dpy window)
'active
'normal)))
(titlebar (assq/false client (data:titlebars data)))
(name (client-name dpy client)))
(set-titlebar-state! titlebar state)
(set-titlebar-title! titlebar name)))
(window (client:window client)))
(if (window-exists? dpy (client:window client))
(let ((state (if (window-contains-focus? dpy window)
'focused
(if (window-viewable? dpy window)
'active
'normal)))
(titlebar (assq/false client (data:titlebars data)))
(name (client-name dpy client)))
(set-titlebar-state! titlebar state)
(set-titlebar-title! titlebar name)))))
((select-next) (select-next-client wm (second msg)))
((select-previous) (select-previous-client wm (second msg)))
@ -133,7 +143,6 @@
;; TODO: transients!
(let ((dpy (wm:dpy wm))
(options (wm:options wm)))
(set-window-border-width! dpy (client:window client) 0)
(let* ((channel (make-channel))
(titlebar (create-client-titlebar channel wm client)))
(set-data:titlebars! data (append (data:titlebars data)
@ -141,7 +150,7 @@
(fit-titlebars wm data)
(update-titlebars wm data)
(fit-client-window wm client)
(fit-client wm client)
;;(fit-client wm client)
(install-dragging-control channel dpy
(titlebar:window titlebar)