]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/NSWindow.mm
fix for bug 1371386, with some minor mods and cleanup
[wxWidgets.git] / src / cocoa / NSWindow.mm
index c2df1cd5e6c26408ac33de7c4a5223814855dd95..ebb81b92b07337cd41527d3f6f7aa89f4d21f01e 100644 (file)
@@ -193,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;