Fall back on ::GetMessagePos() if ::GetCursorPos() fails under MSW.

In some rare but reproducible cases GetCursorPos() can fail and return without
filling in the provided point. Fall back to GetMessagePos() if this happens:
this is not ideal but clearly better than using uninitialized position or hard
coding something like (0, 0).

Closes #13664.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-11-14 12:51:53 +00:00
parent 3e6807d701
commit d6c37f5bc4
6 changed files with 29 additions and 54 deletions

View File

@@ -113,7 +113,7 @@ bool wxCheckForInterrupt(wxWindow *wnd)
void wxGetMousePosition( int* x, int* y )
{
POINT pt;
GetCursorPos( & pt );
wxGetCursorPosMSW( & pt );
if ( x ) *x = pt.x;
if ( y ) *y = pt.y;
}