From 2e4986548d1db4ed12a7fa65006f7ce256068ecc Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Wed, 10 Jun 2009 06:52:52 +0000 Subject: [PATCH] allow mouse events being sent to parents, see #10876 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/cocoa/window.mm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index 713fce435b..7fd8287b82 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -848,8 +848,12 @@ void wxWidgetCocoaImpl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd) { if ( !DoHandleMouseEvent(event) ) { - wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; - superimpl(slf, (SEL)_cmd, event); + // for plain NSView mouse events would propagate to parents otherwise + if (!m_wxPeer->MacIsUserPane()) + { + wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; + superimpl(slf, (SEL)_cmd, event); + } } } @@ -866,8 +870,8 @@ void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd) { if (m_lastKeyDownEvent && !DoHandleCharEvent(m_lastKeyDownEvent, text) ) { - wxOSX_TextEventHandlerPtr superimpl = (wxOSX_TextEventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; - superimpl(slf, (SEL)_cmd, text); + wxOSX_TextEventHandlerPtr superimpl = (wxOSX_TextEventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; + superimpl(slf, (SEL)_cmd, text); } m_lastKeyDownEvent = NULL; }