X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e6857fac2a88987fff1c63c8885252f679ac6ce..f6ba47d9973bbb113257401b6eeb82b23da7acc4:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 9d9fdb5cc6..e6b1ba5c7c 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -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;