Cocoa: avoid over-eager refresh on OS X 10.11

A relatively late correction to refresh handling for El Capitan
(commit 9bf18505d5) causes a canvas to be refreshed too often
in some cases. Delay the refresh to restore the old timing
without the old bug.
This commit is contained in:
Matthew Flatt 2015-11-23 20:45:25 -07:00
parent facc07e123
commit 3873064c80
2 changed files with 7 additions and 4 deletions

View File

@ -430,7 +430,10 @@
(tellv cocoa enableFlushWindow)
(when (version-10.11-or-later?)
(tellv cocoa setAutodisplay: #:type _BOOL #t)
(tellv cocoa displayIfNeeded))))
(queue-window-refresh-event
this
(lambda ()
(tellv cocoa displayIfNeeded))))))
(define/public (force-window-focus)
(let ([next (get-app-front-window)])

View File

@ -306,14 +306,14 @@
(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))
(begin-refresh-sequence)
(reset-size)
(end-refresh-sequence))))
(define/private (reset-size)
(reset-visual #f)