jdk/src/macosx/native/sun/awt/AWTWindow.m
changeset 17684 fc7f8dbe87b4
parent 15505 f31ab5cb8bb9
child 17904 0be4c7d2e53b
equal deleted inserted replaced
17683:1b4209f788d2 17684:fc7f8dbe87b4
     1 /*
     1 /*
     2  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   534 
   534 
   535 
   535 
   536 - (void) windowDidBecomeKey: (NSNotification *) notification {
   536 - (void) windowDidBecomeKey: (NSNotification *) notification {
   537 AWT_ASSERT_APPKIT_THREAD;
   537 AWT_ASSERT_APPKIT_THREAD;
   538     [AWTToolkit eventCountPlusPlus];
   538     [AWTToolkit eventCountPlusPlus];
   539     [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
       
   540     AWTWindow *opposite = [AWTWindow lastKeyWindow];
   539     AWTWindow *opposite = [AWTWindow lastKeyWindow];
       
   540     if (!IS(self.styleBits, IS_DIALOG)) {
       
   541         [CMenuBar activate:self.javaMenuBar modallyDisabled:NO];
       
   542     } else if (IS(self.styleBits, IS_MODAL)) {
       
   543         [CMenuBar activate:opposite->javaMenuBar modallyDisabled:YES];        
       
   544     }
   541     [AWTWindow setLastKeyWindow:nil];
   545     [AWTWindow setLastKeyWindow:nil];
   542 
   546 
   543     [self _deliverWindowFocusEvent:YES oppositeWindow: opposite];
   547     [self _deliverWindowFocusEvent:YES oppositeWindow: opposite];
   544 }
   548 }
   545 
   549