X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c34cd96a337d3ffb75cd39e5d3f620b9a24a2acb..60d66be369d360e1528e4dd4bb65a909a8c6ac9a:/src/osx/cocoa/nonownedwnd.mm?ds=sidebyside diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 6ae40522fe..030b1e6a23 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -145,6 +145,8 @@ bool shouldHandleSelector(SEL selector) // wx native implementation // +static NSResponder* s_nextFirstResponder = NULL; + @interface wxNSWindow : NSWindow { } @@ -152,6 +154,7 @@ bool shouldHandleSelector(SEL selector) - (void) sendEvent:(NSEvent *)event; - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; - (void)noResponderFor: (SEL) selector; +- (BOOL)makeFirstResponder:(NSResponder *)aResponder; @end @implementation wxNSWindow @@ -206,6 +209,14 @@ bool shouldHandleSelector(SEL selector) return YES; } +- (BOOL)makeFirstResponder:(NSResponder *)aResponder +{ + s_nextFirstResponder = aResponder; + BOOL retval = [super makeFirstResponder:aResponder]; + s_nextFirstResponder = nil; + return retval; +} + @end @interface wxNSPanel : NSPanel @@ -215,6 +226,7 @@ bool shouldHandleSelector(SEL selector) - (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen; - (void)noResponderFor: (SEL) selector; - (void)sendEvent:(NSEvent *)event; +- (BOOL)makeFirstResponder:(NSResponder *)aResponder; @end @implementation wxNSPanel @@ -265,6 +277,14 @@ bool shouldHandleSelector(SEL selector) } } +- (BOOL)makeFirstResponder:(NSResponder *)aResponder +{ + s_nextFirstResponder = aResponder; + BOOL retval = [super makeFirstResponder:aResponder]; + s_nextFirstResponder = nil; + return retval; +} + @end @@ -1041,6 +1061,12 @@ void wxNonOwnedWindowCocoaImpl::RestoreWindowLevel() [m_macWindow setLevel:m_macWindowLevel]; } +WX_NSResponder wxNonOwnedWindowCocoaImpl::GetNextFirstResponder() +{ + return s_nextFirstResponder; +} + + // // //