X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7dd8b1ea102a9c25be25ef6ef33630afed1dbc7c..4e115ed2c71e11ea37c83ed44f3553523ec16560:/src/cocoa/NSWindow.mm diff --git a/src/cocoa/NSWindow.mm b/src/cocoa/NSWindow.mm index 1f8663740c..ebb81b92b0 100644 --- a/src/cocoa/NSWindow.mm +++ b/src/cocoa/NSWindow.mm @@ -6,7 +6,7 @@ // Created: 2003/03/16 // RCS-ID: $Id: // Copyright: (c) 2003 David Elliott -// Licence: wxWindows license +// Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -149,7 +149,8 @@ WX_IMPLEMENT_OBJC_INTERFACE_HASHMAP(NSWindow) -wxCocoaNSWindow::wxCocoaNSWindow() +wxCocoaNSWindow::wxCocoaNSWindow(wxTopLevelWindowCocoa *tlw) +: m_wxTopLevelWindowCocoa(tlw) { m_cocoaDelegate = [[wxNSWindowDelegate alloc] init]; [m_cocoaDelegate setWxCocoaInterface: this]; @@ -192,12 +193,22 @@ wxMenuBar* wxCocoaNSWindow::GetAppMenuBar(wxCocoaNSWindow *win) { } +- (BOOL)canBecomeKeyWindow; - (BOOL)canBecomeMainWindow; @end // wxPoserNSwindow WX_IMPLEMENT_POSER(wxPoserNSWindow); @implementation wxPoserNSWindow : NSWindow +- (BOOL)canBecomeKeyWindow +{ + bool canBecome = false; + wxCocoaNSWindow *tlw = wxCocoaNSWindow::GetFromCocoa(self); + if(!tlw || !tlw->Cocoa_canBecomeKeyWindow(canBecome)) + canBecome = [super canBecomeKeyWindow]; + return canBecome; +} + - (BOOL)canBecomeMainWindow { bool canBecome = false;