jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java
changeset 29260 77797a65dc63
parent 28231 b608ffcaed74
child 29922 7b9c1e1532cf
equal deleted inserted replaced
29259:57e6ba59a1b3 29260:77797a65dc63
     1 /*
     1 /*
     2  * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1995, 2015, 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
   684             }
   684             }
   685         }
   685         }
   686 
   686 
   687         if (toFocus != null) {
   687         if (toFocus != null) {
   688             if (parent instanceof EmbeddedFrame) {
   688             if (parent instanceof EmbeddedFrame) {
   689                 ((EmbeddedFrame)parent).synthesizeWindowActivation(true);
   689                 // JDK-8056915: Try to request focus to the embedder first and
       
   690                 // activate the embedded frame through it
       
   691                 if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) {
       
   692                     // Otherwise activate the embedded frame directly
       
   693                     ((EmbeddedFrame) parent).synthesizeWindowActivation(true);
       
   694                 }
   690             }
   695             }
   691             // EmbeddedFrame might have focus before the applet was added.
   696             // EmbeddedFrame might have focus before the applet was added.
   692             // Thus after its activation the most recent focus owner will be
   697             // Thus after its activation the most recent focus owner will be
   693             // restored. We need the applet's initial focusabled component to
   698             // restored. We need the applet's initial focusabled component to
   694             // be focused here.
   699             // be focused here.