From 19af52af8b56ed7e2d10aa2ec6b253caef195dfd Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 17 Jun 2007 05:40:14 +0000 Subject: [PATCH] improve initial placement of frames that seem too large svn: r6682 --- collects/mred/private/wxtop.ss | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/collects/mred/private/wxtop.ss b/collects/mred/private/wxtop.ss index 14926763e5..0c44e06545 100644 --- a/collects/mred/private/wxtop.ss +++ b/collects/mred/private/wxtop.ss @@ -42,11 +42,13 @@ [yb (box 0)]) (wx:display-origin xb yb advisory?) (values (unbox xb) (unbox yb))))) - - (define-values (init-top-x init-top-y) + + (define-values (left-margin top-margin init-top-x init-top-y) (let-values ([(x y) (get-display-left-top-inset #f)] [(x2 y2) (get-display-left-top-inset #t)]) - (values (+ 1 (- x2 x)) + (values (- x2 x) + (- y2 y) + (+ 1 (- x2 x)) (+ 1 (- y2 y))))) (define top-x init-top-x) @@ -413,12 +415,12 @@ (let*-values ([(w) (get-width)] [(h) (get-height)] [(sw sh) (get-display-size)] - [(x x-reset?) (if (< (+ top-x w) sw) + [(x x-reset?) (if (< (+ top-x w) (+ sw left-margin)) (values top-x #f) - (values (max 0 (- sw w 10)) #t))] - [(y y-reset?) (if (< (+ top-y h) sh) + (values (max init-top-x (- sw w 10)) #t))] + [(y y-reset?) (if (< (+ top-y h) (+ sh top-margin)) (values top-y #f) - (values (max 0 (- sh h 20)) #t))]) + (values (max init-top-y (- sh h 20)) #t))]) (move x y) (set! top-x (if x-reset? init-top-x (+ top-x 10))) (set! top-y (if y-reset? init-top-y (+ top-y 20)))))))]