]> git.saurik.com Git - wxWidgets.git/commitdiff
don't set focus to the window when it is clicked if the event has been processed...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Oct 2004 18:09:13 +0000 (18:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 19 Oct 2004 18:09:13 +0000 (18:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index bcad284c8734905d84222a46727a2c045c8d16c9..9caa2feab588eef115926b3ab341c52719287970 100644 (file)
@@ -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;