avoid calling the show method for tooltips unless the frame is shown.

please include in 5.2
This commit is contained in:
Robby Findler 2011-10-08 16:49:25 -05:00
parent 79dd7df945
commit 5db48b3e73
2 changed files with 15 additions and 9 deletions

View File

@ -1048,13 +1048,17 @@ If the namespace does not, they are colored the unbound color.
;; and on-paint gets called each time the cursor blinks...) ;; and on-paint gets called each time the cursor blinks...)
(cond (cond
[(not eles) [(not eles)
(when tooltip-frame (send tooltip-frame show #f)) (when tooltip-frame
(when (send tooltip-frame is-shown?)
(send tooltip-frame show #f)))
(set! tooltips-in-sync-with-cursor-eles? #t)] (set! tooltips-in-sync-with-cursor-eles? #t)]
[else [else
(define tooltip-infos (filter tooltip-info? eles)) (define tooltip-infos (filter tooltip-info? eles))
(cond (cond
[(null? tooltip-infos) [(null? tooltip-infos)
(when tooltip-frame (send tooltip-frame show #f)) (when tooltip-frame
(when (send tooltip-frame is-shown?)
(send tooltip-frame show #f)))
(set! tooltips-in-sync-with-cursor-eles? #t)] (set! tooltips-in-sync-with-cursor-eles? #t)]
[else [else
(unless tooltip-frame (set! tooltip-frame (new tooltip-frame%))) (unless tooltip-frame (set! tooltip-frame (new tooltip-frame%)))

View File

@ -6,14 +6,16 @@
(define tooltip-frame% (define tooltip-frame%
(class frame% (class frame%
(inherit show reflow-container move get-width get-height) (inherit show reflow-container move get-width get-height is-shown?)
(define/override (on-subwindow-event r evt) (define/override (on-subwindow-event r evt)
(cond (and (is-shown?)
[(or (send evt entering?) (cond
(send evt button-down?)) [(or (send evt entering?)
(show #f) (send evt button-down?))
#t] (show #f)
[else #f])) #t]
[else #f])))
(define/public (set-tooltip ls) (define/public (set-tooltip ls)
(send yellow-message set-lab ls)) (send yellow-message set-lab ls))