racket/gui: double-check size on attmpt to set editor scroll

A scroll request could fail if a resize notification is still
in flight (i.e., queued but not yet executed), so double-check
the size on a scroll request.

Closes PR 13582
This commit is contained in:
Matthew Flatt 2013-03-31 06:38:38 -06:00
parent 0a482b6159
commit bfc9c41358

View File

@ -297,14 +297,17 @@
(lambda ()
(unless (and media
(send media get-printing))
(begin-refresh-sequence)
(let-boxes ([w 0]
[h 0])
(get-size w h)
(unless (and (= w lastwidth)
(= h lastheight))
(reset-size)))
(end-refresh-sequence))))))
(maybe-reset-size))))))
(define/private (maybe-reset-size)
(begin-refresh-sequence)
(let-boxes ([w 0]
[h 0])
(get-size w h)
(unless (and (= w lastwidth)
(= h lastheight))
(reset-size)))
(end-refresh-sequence))
(define/private (reset-size)
(reset-visual #f)
@ -934,6 +937,8 @@
(let ([savenoloop? noloop?])
(set! noloop? #t)
(maybe-reset-size)
(when (and (x . > . -1)
(not fake-x-scroll?))
(when (positive? scroll-width)