From: Stefan Csomor Date: Thu, 11 Sep 2003 18:03:59 +0000 (+0000) Subject: mouse event handling extended X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/672456655288ae8bfd67ab7047adffef6b959d77 mouse event handling extended git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index f5598a3c9f..a78d68ecf0 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -242,7 +242,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event return result ; } -static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; @@ -267,7 +267,10 @@ static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef WindowRef window ; short windowPart = ::FindWindow(point, &window); - if ( IsWindowActive(window) && windowPart == inContent ) + // either we really are active or we are capturing mouse events + + if ( (IsWindowActive(window) && windowPart == inContent) || + (wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) ) { switch ( GetEventKind( event ) ) { diff --git a/src/mac/toplevel.cpp b/src/mac/toplevel.cpp index f5598a3c9f..a78d68ecf0 100644 --- a/src/mac/toplevel.cpp +++ b/src/mac/toplevel.cpp @@ -242,7 +242,7 @@ static pascal OSStatus KeyboardEventHandler( EventHandlerCallRef handler , Event return result ; } -static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) { OSStatus result = eventNotHandledErr ; @@ -267,7 +267,10 @@ static pascal OSStatus MouseEventHandler( EventHandlerCallRef handler , EventRef WindowRef window ; short windowPart = ::FindWindow(point, &window); - if ( IsWindowActive(window) && windowPart == inContent ) + // either we really are active or we are capturing mouse events + + if ( (IsWindowActive(window) && windowPart == inContent) || + (wxTheApp->s_captureWindow && wxTheApp->s_captureWindow->MacGetTopLevelWindow() == toplevelWindow) ) { switch ( GetEventKind( event ) ) {