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)
(unless noloop?
(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))))
(queue-window-callback
this
(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))))))
(define/private (reset-size)
(reset-visual #f)