racket/gui cocoa: remove warp-pointer delay

Change suggested by Philipp Dikmann.
This commit is contained in:
Matthew Flatt 2013-11-07 14:59:23 -07:00
parent 9b04d516ba
commit 73d6f4f807
2 changed files with 8 additions and 1 deletions

View File

@ -453,6 +453,7 @@
(define _CGError _int32)
(define-appserv CGWarpMouseCursorPosition (_fun _NSPoint -> _CGError))
(define-appserv CGAssociateMouseAndMouseCursorPosition (_fun _BOOL -> _CGError))
(define window%
(class object%
@ -895,7 +896,8 @@
(define xb (box x))
(define yb (box y))
(client-to-screen xb yb)
(void (CGWarpMouseCursorPosition (make-NSPoint (unbox xb) (unbox yb)))))
(void (CGWarpMouseCursorPosition (make-NSPoint (unbox xb) (unbox yb))))
(void (CGAssociateMouseAndMouseCursorPosition #t)))
(define/private (create-compose-window)
(unless compose-cocoa

View File

@ -2480,6 +2480,11 @@
(make-object button%
"Make Blue Editor" edp
(lambda (b e) (editor-frame null "blue")))
(new horizontal-panel% [parent edp])
(make-object button%
"Warp Pointer" edp
(lambda (b e)
(send selector warp-pointer 5 5)))
(define (choose-next radios)
(let loop ([l radios])