From 03e0b2b1ff867ac798304776ab7cc1f44335685f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 18 Jun 2002 00:40:19 +0000 Subject: [PATCH] removed SetFocus() call in WM_LBUTTONDOWN handler once again: it is *WRONG*, please let me know if there is any problem this is supposed to fix but don't put it back git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 24a3a73c68..d1638dcda5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2446,28 +2446,36 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam break; } - if (!processed) + if ( processed ) + break; + #endif // __WXMICROWIN__ - { - // VZ: why do we need it here? DefWindowProc() is supposed - // to do this for us anyhow - if ( message == WM_LBUTTONDOWN && AcceptsFocus() ) - SetFocus(); + // VZ: if you find a situation when this is needed, tell + // me about it, do *not* uncomment this code as it + // causes other strange problems +#if 0 + if ( message == WM_LBUTTONDOWN && AcceptsFocus() ) + SetFocus(); +#endif // 0 - int x = GET_X_LPARAM(lParam), - y = GET_Y_LPARAM(lParam); + int x = GET_X_LPARAM(lParam), + y = GET_Y_LPARAM(lParam); - // redirect the event to a static control if necessary - if (this == GetCapture()) - { - processed = HandleMouseEvent(message, x, y, wParam); - } - else - { - wxWindowMSW *win = FindWindowForMouseEvent(this, &x, &y); //TW:REQ:Univ - processed = win->HandleMouseEvent(message, x, y, wParam); - } + // redirect the event to a static control if necessary by + // finding one under mouse + wxWindowMSW *win; + if ( GetCapture() == this ) + { + // but don't do it if the mouse is captured by this window + // because then it should really get this event itself + win = this; } + else + { + win = FindWindowForMouseEvent(this, &x, &y); + } + + processed = win->HandleMouseEvent(message, x, y, wParam); } break; -- 2.47.2