work around cocoa display-change issue

original commit: 47c032ff34a102e7bf1e909483a24c29c0399b2f
This commit is contained in:
Matthew Flatt 2010-10-26 16:15:53 -06:00
parent 04623979f5
commit 33dd9054d3

View File

@ -58,6 +58,16 @@
(tellv app setDelegate: app-delegate)
(tellv app activateIgnoringOtherApps: #:type _BOOL #t)
;; For some reason, nextEventMatchingMask:... gets stuck if the
;; display changes, and it doesn't even send the
;; `applicationDidChangeScreenParameters:' callback. Unstick
;; it by posting a dummy event, since we fortunately can receive
;; a callback via CGDisplayRegisterReconfigurationCallback().
(define-appserv CGDisplayRegisterReconfigurationCallback
(_fun (_fun #:atomic? #t -> _void) _pointer -> _int32))
(define (on-screen-changed) (post-dummy-event))
(CGDisplayRegisterReconfigurationCallback on-screen-changed #f)
;; ------------------------------------------------------------
;; Create an event to post when MzScheme has been sleeping but is
;; ready to wake up