]> git.saurik.com Git - wxWidgets.git/commitdiff
removed SetFocus() call in WM_LBUTTONDOWN handler once again: it is *WRONG*, please...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Jun 2002 00:40:19 +0000 (00:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 18 Jun 2002 00:40:19 +0000 (00:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15871 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 24a3a73c68b23e797378fbf34a43c24c6e80b0b3..d1638dcda51053e6bb621cf8918cb694b5b6a487 100644 (file)
@@ -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;