better support for avoiding window overlap with the Mac dock
svn: r3070 original commit: 67b5c30218c3428f6b57575a99fa85ad68eb08d6
This commit is contained in:
parent
b5529b001e
commit
aa1e17c346
|
@ -31,14 +31,21 @@
|
|||
(wx:display-size xb yb (if full-screen? 1 0))
|
||||
(values (unbox xb) (unbox yb)))))
|
||||
|
||||
(define (get-display-left-top-inset)
|
||||
(define get-display-left-top-inset
|
||||
(opt-lambda ([advisory? #f])
|
||||
(let ([xb (box 0)]
|
||||
[yb (box 0)])
|
||||
(wx:display-origin xb yb)
|
||||
(values (unbox xb) (unbox yb))))
|
||||
(wx:display-origin xb yb advisory?)
|
||||
(values (unbox xb) (unbox yb)))))
|
||||
|
||||
(define top-x 1)
|
||||
(define top-y 1)
|
||||
(define-values (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))
|
||||
(+ 1 (- y2 y)))))
|
||||
|
||||
(define top-x init-top-x)
|
||||
(define top-y init-top-y)
|
||||
(define top-level-windows (make-hash-table 'weak))
|
||||
|
||||
;; make-top-container%: adds the necessary functionality to wx:frame% and
|
||||
|
@ -340,8 +347,8 @@
|
|||
(values top-y #f)
|
||||
(values (max 0 (- sh h 20)) #t))])
|
||||
(move x y)
|
||||
(set! top-x (if x-reset? 0 (+ top-x 10)))
|
||||
(set! top-y (if y-reset? 0 (+ top-y 20)))))
|
||||
(set! top-x (if x-reset? init-top-x (+ top-x 10)))
|
||||
(set! top-y (if y-reset? init-top-y (+ top-y 20)))))
|
||||
(if on?
|
||||
(hash-table-put! top-level-windows this #t)
|
||||
(hash-table-remove! top-level-windows this))
|
||||
|
|
Loading…
Reference in New Issue
Block a user