Merge pull request #2256 from Dogild/PlatformWindowKey

Fixed: CPWindow doesn't take the event when moving from another platformWindow
This commit is contained in:
Antoine Mercadal committed 2014-11-07 16:26:15 -08:00
commit d8718cc20f
1 file changed
+7 -1
+7 -1
View File
@@ -1846,6 +1846,12 @@ CPTexturedBackgroundWindowMask
if (_leftMouseDownView !== _firstResponder && [_leftMouseDownView acceptsFirstResponder])
[self makeFirstResponder:_leftMouseDownView];
var keyWindow = [CPApp keyWindow];
// This is only when we move from a platform to another one
if ([keyWindow platformWindow] != [self platformWindow])
[self makeKeyAndOrderFront:self];
[CPApp activateIgnoringOtherApps:YES];
var theWindow = [anEvent window],
@@ -2477,7 +2483,7 @@ CPTexturedBackgroundWindowMask
if (currentWindow === self || currentWindow === menuWindow)
continue;
if ([currentWindow isVisible] && [currentWindow canBecomeKeyWindow])
if ([currentWindow isVisible] && [currentWindow canBecomeKeyWindow] && [currentWindow platformWindow] == [keyWindow platformWindow])
{
[currentWindow makeKeyWindow];
break;