From d1dc1303c296ae86fea307134185e6a8f2e8d47b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 15 Jan 2011 14:38:39 -0700 Subject: [PATCH] win32: allow GetCursorPos to fail in case the current desktop isn't the input desktop --- collects/mred/private/wx/win32/window.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/collects/mred/private/wx/win32/window.rkt b/collects/mred/private/wx/win32/window.rkt index d25adf54dc..6099f48385 100644 --- a/collects/mred/private/wx/win32/window.rkt +++ b/collects/mred/private/wx/win32/window.rkt @@ -127,8 +127,7 @@ (define-user32 TrackMouseEvent (_wfun _TRACKMOUSEEVENT-pointer -> (r : _BOOL) -> (unless r (failed 'TrackMouseEvent)))) -(define-user32 GetCursorPos (_wfun _POINT-pointer -> (r : _BOOL) - -> (unless r (failed 'GetCursorPos)))) +(define-user32 GetCursorPos (_wfun _POINT-pointer -> _BOOL)) (defclass window% object% (init-field parent hwnd) @@ -526,8 +525,8 @@ (do-mouse w msg #f 'motion wParam lParam)] [(= msg WM_MOUSELEAVE) (let ([p (make-POINT 0 0)]) - (GetCursorPos p) - (let ([f (location->window (POINT-x p) (POINT-y p))]) + (let ([f (and (GetCursorPos p) + (location->window (POINT-x p) (POINT-y p)))]) (unless (and (eq? f (get-top-frame)) (send f in-content? p)) (do-mouse w msg #f 'leave wParam lParam))))