From 609cb1b61f371bef4ebb2d15884ad6589642c3be Mon Sep 17 00:00:00 2001 From: frese Date: Sun, 7 Dec 2003 16:10:29 +0000 Subject: [PATCH] - fixed some problems with floatnums - changed take-focus to assume #t for the wm-hint if it is not available --- src/utils.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/utils.scm b/src/utils.scm index 1758a77..09e84e8 100644 --- a/src/utils.scm +++ b/src/utils.scm @@ -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?