- changed init-client and initial-client-rect, so that only windows

that don't want decorations are placed outside the manager (little
  hack for full-screen-mode)
This commit is contained in:
frese 2004-02-09 17:31:27 +00:00
parent 76a07d54c6
commit ace0a03116
1 changed files with 17 additions and 14 deletions

View File

@ -73,7 +73,6 @@
(changes (third msg))
(client? (client-of-window wm window)))
(if (window-exists? dpy window) (begin
(mdisplay "move-wm: root-configure: " client? window changes "\n")
(let* ((r (window-rectangle dpy window))
(dx (cond
((assq (window-change x) changes) =>
@ -128,13 +127,6 @@
(if client?
(let* ((cw (client:client-window client?))
(cr (window-rectangle dpy cw)))
(mdisplay "configuring client-window: " cw
(append (make-window-change-alist
(border-width 0)
(x (+ (rectangle:x cr) dx))
(y (+ (rectangle:y cr) dy)))
changes) "\n")
(configure-window
dpy cw
(append (make-window-change-alist
@ -226,6 +218,15 @@
(define (set-client-data:icon! client icon)
(set-car! (cddr (client:data client)) icon))
(define (window-wants-decoration? dpy window)
(cond
((get-motif-wm-hints dpy window) =>
(lambda (hints)
(mdisplay (motif-wm-hints:decorations hints) "\n")
(or (not (motif-wm-hints:decorations hints))
(not (null? (enum-set->list (motif-wm-hints:decorations hints)))))))
(else #t)))
(define (init-client wm client maybe-rect)
(let ((dpy (wm:dpy wm)))
(let* ((r (initial-client-rect wm client maybe-rect))
@ -235,11 +236,14 @@
(options (wm:options wm)))
(set-client:data! client (make-client-data titlebar resizer #f))
(set-titlebar-title! titlebar (client-name dpy client))
(let ((bw (get-option-value options 'border-width))
(th (get-option-value options 'titlebar-height)))
(let* ((bw (get-option-value options 'border-width))
(th (get-option-value options 'titlebar-height))
(x.y (if (window-wants-decoration? dpy (client:window client))
(cons (rectangle:x r) (rectangle:y r))
(cons (- (rectangle:x r) bw)
(- (rectangle:y r) (+ bw th))))))
(move-resize-window dpy (client:client-window client)
(- (rectangle:x r) bw)
(- (rectangle:y r) (+ bw th))
(car x.y) (cdr x.y)
(+ (rectangle:width r) (* 2 bw))
(+ (rectangle:height r) (* 2 bw) th)))
(fit-client-windows wm client)
@ -397,8 +401,7 @@
(let* ((bw (get-option-value options 'border-width))
(th (get-option-value options 'titlebar-height))
(x.y (find-free-position wm client w.h '(0 . 0))))
(cons (+ (car x.y) bw)
(+ (cdr x.y) (+ bw th)))))
x.y))
(x.y (desired-position/hints dpy win maybe-x.y)))
(make-rectangle (car x.y) (cdr x.y)
(car w.h) (cdr w.h))))