From: Vadim Zeitlin Date: Tue, 19 Oct 2004 18:09:13 +0000 (+0000) Subject: don't set focus to the window when it is clicked if the event has been processed... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9f01184787f1791cc224adce6c55519db8fa76c2 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 --- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index bcad284c87..9caa2feab5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -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;