cocoa: another screen-change workaround
This commit is contained in:
parent
05cfffdf9e
commit
4891b87ea1
|
@ -49,7 +49,12 @@
|
||||||
[-a _BOOL (application: [_id theApplication] openFile: [_NSString filename])
|
[-a _BOOL (application: [_id theApplication] openFile: [_NSString filename])
|
||||||
(queue-file-event (string->path filename))]
|
(queue-file-event (string->path filename))]
|
||||||
[-a _void (applicationDidChangeScreenParameters: notification)
|
[-a _void (applicationDidChangeScreenParameters: notification)
|
||||||
;; Need to reset blit windows, since OS may move them incorrectly
|
;; Screen changes sometimes make the event loop get stuck;
|
||||||
|
;; hack: schedule a wake-up call in 5 seconds
|
||||||
|
(let ([priviledged-custodian ((get-ffi-obj 'scheme_make_custodian #f (_fun _pointer -> _scheme)) #f)])
|
||||||
|
(parameterize ([current-custodian priviledged-custodian])
|
||||||
|
(thread (lambda () (sleep 5.0)))))
|
||||||
|
;; FIXME: Also need to reset blit windows, since OS may move them incorrectly
|
||||||
(void)])
|
(void)])
|
||||||
|
|
||||||
(tellv app finishLaunching)
|
(tellv app finishLaunching)
|
||||||
|
@ -77,9 +82,12 @@
|
||||||
;; `applicationDidChangeScreenParameters:' callback. Unstick
|
;; `applicationDidChangeScreenParameters:' callback. Unstick
|
||||||
;; it by posting a dummy event, since we fortunately can receive
|
;; it by posting a dummy event, since we fortunately can receive
|
||||||
;; a callback via CGDisplayRegisterReconfigurationCallback().
|
;; a callback via CGDisplayRegisterReconfigurationCallback().
|
||||||
|
;; This seems to unstick things enough that `applicationDidChangeScreenParameters:'
|
||||||
|
;; is called, but sometimes the event loop gets stuck after
|
||||||
|
;; that, so there's an additional hack above.
|
||||||
(define-appserv CGDisplayRegisterReconfigurationCallback
|
(define-appserv CGDisplayRegisterReconfigurationCallback
|
||||||
(_fun (_fun #:atomic? #t -> _void) _pointer -> _int32))
|
(_fun (_fun #:atomic? #t -> _void) _pointer -> _int32))
|
||||||
(define (on-screen-changed) (post-dummy-event))
|
(define (on-screen-changed) (printf "CG\n") (post-dummy-event))
|
||||||
(void
|
(void
|
||||||
(CGDisplayRegisterReconfigurationCallback on-screen-changed #f))
|
(CGDisplayRegisterReconfigurationCallback on-screen-changed #f))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user