fix editor-canvas%' internal on-size' handling

The `on-size' method is called in atomic mode,
and we can't call into the editor's sizing functions
in atomic mode.

Watch out for refresh and/or window-sizing problems.
This commit is contained in:
Matthew Flatt 2012-08-28 17:21:45 -06:00
parent b61f3f751c
commit dba3c14746

View File

@ -292,16 +292,19 @@
(define/override (on-size) (define/override (on-size)
(unless noloop? (unless noloop?
(unless (and media (queue-window-callback
(send media get-printing)) this
(begin-refresh-sequence) (lambda ()
(let-boxes ([w 0] (unless (and media
[h 0]) (send media get-printing))
(get-size w h) (begin-refresh-sequence)
(unless (and (= w lastwidth) (let-boxes ([w 0]
(= h lastheight)) [h 0])
(reset-size))) (get-size w h)
(end-refresh-sequence)))) (unless (and (= w lastwidth)
(= h lastheight))
(reset-size)))
(end-refresh-sequence))))))
(define/private (reset-size) (define/private (reset-size)
(reset-visual #f) (reset-visual #f)