- fixed some problems with floatnums

- changed take-focus to assume #t for the wm-hint if it is not available
This commit is contained in:
frese 2003-12-07 16:10:29 +00:00
parent 3ff3bcd364
commit 609cb1b61f
1 changed files with 10 additions and 4 deletions

View File

@ -22,6 +22,12 @@
(not (member e list1)))
list2))
(define (floor* x)
(let ((y (floor x)))
(if (inexact? y)
(inexact->exact y)
y)))
;; *** cml utilities *************************************************
(define select* select)
@ -329,7 +335,7 @@
(wm-take-focus (intern-atom dpy "WM_TAKE_FOCUS" #f))
(wm-hints (get-wm-hints dpy window))
(t (and wm-hints (assq (wm-hint input?) wm-hints)))
(input? (if t (cdr t) #f)))
(input? (if t (cdr t) #t)))
(if (and input? (window-viewable? dpy window))
(set-input-focus dpy window (revert-to parent) time))
(if (and protocols wm-take-focus
@ -394,8 +400,8 @@
(define (text-center-pos rect font-struct str)
(let* ((cs (text-extents font-struct str))
(tw (char-struct:width cs)))
(cons (floor (/ (- (rectangle:width rect) tw) 2))
(+ (floor (/ (rectangle:height rect) 2))
(cons (floor* (/ (- (rectangle:width rect) tw) 2))
(+ (floor* (/ (rectangle:height rect) 2))
(font-struct:descent font-struct)))))
;; maximize-window moves and resizes the window fill as much space of
@ -525,7 +531,7 @@
height-inc))))))
;; result ********************************************************
(cons width height)))
(cons (floor* width) (floor* height))))
(define (minimal-size/hints dpy window default-width default-height)
(let ((hints (get-wm-normal-hints dpy window)) ;; or group-leader?