only set cursor immediately in SetCursor() if the mouse is currently inside the window or we capture it (fixes the problem introduced in rev 1.675 while still correcting the original bug that change was done to fix)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2007-01-12 01:28:14 +00:00
parent 21de14b331
commit a8b2285edf

View File

@ -803,7 +803,30 @@ bool wxWindowMSW::SetCursor(const wxCursor& cursor)
// don't "overwrite" busy cursor
if ( m_cursor.Ok() && !wxIsBusy() )
{
::SetCursor(GetHcursorOf(m_cursor));
// normally we should change the cursor only if it's over this window
// but we should do it always if we capture the mouse currently
bool set = HasCapture();
if ( !set )
{
HWND hWnd = GetHwnd();
POINT point;
#ifdef __WXWINCE__
::GetCursorPosWinCE(&point);
#else
::GetCursorPos(&point);
#endif
RECT rect = wxGetWindowRect(hWnd);
set = ::PtInRect(&rect, point) != 0;
}
if ( set )
{
::SetCursor(GetHcursorOf(m_cursor));
}
//else: will be set later when the mouse enters this window
}
return true;