From ce9534cdea764fcc674fce830742636dd81588ec Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Mon, 26 Nov 2012 14:01:33 +0000 Subject: [PATCH] Fixed: canBecomeKeyWindow response for auxiliary windows. Without this fix Cappuccino always returned YES for `canBecomeKeyWindow` for every window. But in Cocoa, only "standard" windows with a title bar and/or resizing return YES. With this fix Cappuccino better matches Cocoa's behaviour. --- AppKit/CPWindow/CPWindow.j | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/AppKit/CPWindow/CPWindow.j b/AppKit/CPWindow/CPWindow.j index 01bf60f10..c1e14a813 100644 --- a/AppKit/CPWindow/CPWindow.j +++ b/AppKit/CPWindow/CPWindow.j @@ -1856,7 +1856,9 @@ CPTexturedBackgroundWindowMask */ - (BOOL)canBecomeKeyWindow { - return YES; + // In Cocoa only resizable or titled windows return YES here by default. But the main browser window in Cappuccino + // doesn't have these masks even that it's both titled and resizable, so we return YES when isFullPlatformWindow too. + return (_styleMask & CPResizableWindowMask) || (_styleMask & CPResizableWindowMask) || [self isFullPlatformWindow]; } /*!