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:
@@ -3645,7 +3645,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
case NM_RCLICK:
|
||||
{
|
||||
TV_HITTESTINFO tvhti;
|
||||
::GetCursorPos(&tvhti.pt);
|
||||
wxGetCursorPosMSW(&tvhti.pt);
|
||||
::ScreenToClient(GetHwnd(), &tvhti.pt);
|
||||
if ( TreeView_HitTest(GetHwnd(), &tvhti) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user