]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/window.cpp
added wxShutdown (patch 547443)
[wxWidgets.git] / src / mac / carbon / window.cpp
index 9d9fdb5cc6e1a2208b6bf25cb708a92df80dd327..e6b1ba5c7c6113f7002a79c448e23989ac9fb78c 100644 (file)
@@ -1386,6 +1386,7 @@ bool wxWindowMac::MacGetWindowFromPoint( const wxPoint &screenpoint , wxWindowMa
 }
 
 extern int wxBusyCursorCount ;
+static wxWindow *gs_lastWhich = NULL;
 
 bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
 {
@@ -1438,6 +1439,23 @@ bool wxWindowMac::MacDispatchMouseEvent(wxMouseEvent& event)
         wxToolTip::RelayEvent( this , event);
 #endif // wxUSE_TOOLTIPS
 
+    if (gs_lastWhich != this)
+    {
+        gs_lastWhich = this;
+        
+        // Double clicks must always occur on the same window
+        if (event.GetEventType() == wxEVT_LEFT_DCLICK)
+            event.SetEventType( wxEVT_LEFT_DOWN );
+        if (event.GetEventType() == wxEVT_RIGHT_DCLICK)
+            event.SetEventType( wxEVT_RIGHT_DOWN );
+            
+        // Same for mouse up events
+        if (event.GetEventType() == wxEVT_LEFT_UP)
+            return TRUE;
+        if (event.GetEventType() == wxEVT_RIGHT_UP)
+            return TRUE;
+    }
+
     GetEventHandler()->ProcessEvent( event ) ;
 
     return TRUE;