From 95a8b77a948f58735eeb1cf41ae4263deb6096e9 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 30 Aug 2004 07:40:19 +0000 Subject: [PATCH] correcting a source for double event delivery git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/app.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index f1c05f9aec..2b2c0b892c 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -520,7 +520,17 @@ pascal OSStatus wxMacAppEventHandler( EventHandlerCallRef handler , EventRef eve result = wxMacAppMenuEventHandler( handler , event , data ) ; break ; case kEventClassMouse : - result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ; + { + wxMacCarbonEvent cEvent( event ) ; + + WindowRef window ; + Point screenMouseLocation = cEvent.GetParameter(kEventParamMouseLocation) ; + short windowPart = ::FindWindow(screenMouseLocation, &window); + // only send this event in case it had not already been sent to a tlw, as we get + // double events otherwise (in case event.skip) was called + if ( window == NULL ) + result = wxMacTopLevelMouseEventHandler( handler , event , NULL ) ; + } break ; case kEventClassAppleEvent : { -- 2.45.2