don't set focus to the window when it is clicked if the event has been processed by the user code (this is consistent with how the standard controls already behave)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2498,19 +2498,23 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
||||
// this should never happen
|
||||
wxCHECK_MSG( win, 0,
|
||||
_T("FindWindowForMouseEvent() returned NULL") );
|
||||
}
|
||||
|
||||
processed = win->HandleMouseEvent(message, x, y, wParam);
|
||||
|
||||
// if the app didn't eat the event, handle it in the default
|
||||
// way, that is by giving this window the focus
|
||||
if ( !processed )
|
||||
{
|
||||
// for the standard classes their WndProc sets the focus to
|
||||
// them anyhow and doing it from here results in some weird
|
||||
// problems, but for our windows we want them to acquire
|
||||
// focus when clicked
|
||||
// problems, so don't do it for them (unnecessary anyhow)
|
||||
if ( !win->IsOfStandardClass() )
|
||||
{
|
||||
if ( message == WM_LBUTTONDOWN && win->AcceptsFocus() )
|
||||
win->SetFocus();
|
||||
}
|
||||
}
|
||||
|
||||
processed = win->HandleMouseEvent(message, x, y, wParam);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user