]> git.saurik.com Git - wxWidgets.git/commitdiff
don't give focus to the window if it ate the left mouse click
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Oct 2004 21:26:01 +0000 (21:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 23 Oct 2004 21:26:01 +0000 (21:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/toplevel.cpp

index d41ae760f042f007907aef794a75fc58b2647a84..c4914ac596a486242fbf70985ac4ee284af73bd2 100644 (file)
@@ -521,15 +521,6 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
                 cursorPoint += cursorTarget->GetPosition() ;
         }
 
-        // update focus
-
-        if ( wxevent.GetEventType() == wxEVT_LEFT_DOWN )
-        {
-            // set focus to this window
-            if (currentMouseWindow->AcceptsFocus() && wxWindow::FindFocus()!=currentMouseWindow)
-                currentMouseWindow->SetFocus();
-        }
-
         // make tooltips current
         
     #if wxUSE_TOOLTIPS
@@ -542,6 +533,15 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             result = noErr;
         else
         {
+            // if the user code did _not_ handle the event, then perform the
+            // default processing
+            if ( wxevent.GetEventType() == wxEVT_LEFT_DOWN )
+            {
+                // ... that is set focus to this window
+                if (currentMouseWindow->AcceptsFocus() && wxWindow::FindFocus()!=currentMouseWindow)
+                    currentMouseWindow->SetFocus();
+            }
+
             ControlPartCode dummyPart ;
             // if built-in find control is finding the wrong control (ie static box instead of overlaid
             // button, we cannot let the standard handler do its job, but must handle manually