From 0dea9d5c8533968295f5665bb6f73e52845bfaa5 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Wed, 22 Jul 2015 17:33:17 +0300 Subject: [PATCH] 8130776: Remove EmbeddedFrame.requestFocusToEmbedder() method Reviewed-by: serb, ant --- .../share/classes/sun/applet/AppletPanel.java | 7 +----- .../share/classes/sun/awt/EmbeddedFrame.java | 9 -------- .../sun/awt/windows/WEmbeddedFrame.java | 9 -------- .../sun/awt/windows/WEmbeddedFramePeer.java | 6 ----- .../native/libawt/windows/awt_Frame.cpp | 23 ------------------- 5 files changed, 1 insertion(+), 53 deletions(-) diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java index a262864b4cc..14023fcfa67 100644 --- a/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java +++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletPanel.java @@ -687,12 +687,7 @@ abstract class AppletPanel extends Panel implements AppletStub, Runnable { if (toFocus != null) { if (parent instanceof EmbeddedFrame) { - // JDK-8056915: Try to request focus to the embedder first and - // activate the embedded frame through it - if (!((EmbeddedFrame) parent).requestFocusToEmbedder()) { - // Otherwise activate the embedded frame directly - ((EmbeddedFrame) parent).synthesizeWindowActivation(true); - } + ((EmbeddedFrame) parent).synthesizeWindowActivation(true); } // EmbeddedFrame might have focus before the applet was added. // Thus after its activation the most recent focus owner will be diff --git a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java index d90132e35e9..affe2bcb8e7 100644 --- a/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java +++ b/jdk/src/java.desktop/share/classes/sun/awt/EmbeddedFrame.java @@ -356,15 +356,6 @@ public abstract class EmbeddedFrame extends Frame */ public void synthesizeWindowActivation(boolean doActivate) {} - /** - * Requests the focus to the embedder. - * - * @return {@code true} if focus request was successful, and {@code false} otherwise. - */ - public boolean requestFocusToEmbedder() { - return false; - } - /** * Moves this embedded frame to a new location. The top-left corner of * the new location is specified by the x and y diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java index 05769303cc9..a2cac44e4bb 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFrame.java @@ -251,15 +251,6 @@ public class WEmbeddedFrame extends EmbeddedFrame { } } - public boolean requestFocusToEmbedder() { - if (isEmbeddedInIE) { - final WEmbeddedFramePeer peer = AWTAccessor.getComponentAccessor() - .getPeer(this); - return peer.requestFocusToEmbedder(); - } - return false; - } - public void registerAccelerator(AWTKeyStroke stroke) {} public void unregisterAccelerator(AWTKeyStroke stroke) {} diff --git a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java index 4cc3a4d716b..c0ef8a78dde 100644 --- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java +++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/WEmbeddedFramePeer.java @@ -79,10 +79,4 @@ public class WEmbeddedFramePeer extends WFramePeer { return !Win32GraphicsEnvironment.isDWMCompositionEnabled(); } - /** - * Sets the focus to plugin control window, the parent of embedded frame. - * Eventually, it will synthesizeWindowActivation to activate the embedded frame, - * if plugin control window gets the focus. - */ - public native boolean requestFocusToEmbedder(); } diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp index 2c25e975d39..53f6a50149e 100644 --- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp +++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Frame.cpp @@ -1961,29 +1961,6 @@ Java_sun_awt_windows_WFramePeer_synthesizeWmActivate(JNIEnv *env, jobject self, CATCH_BAD_ALLOC; } -JNIEXPORT jboolean JNICALL -Java_sun_awt_windows_WEmbeddedFramePeer_requestFocusToEmbedder(JNIEnv *env, jobject self) -{ - jboolean result = JNI_FALSE; - - TRY; - - AwtFrame *frame = NULL; - - PDATA pData; - JNI_CHECK_PEER_GOTO(self, ret); - frame = (AwtFrame *)pData; - - // JDK-8056915: During initial applet activation, set focus to plugin control window - HWND hwndParent = ::GetParent(frame->GetHWnd()); - - result = SetFocusToPluginControl(hwndParent); - - CATCH_BAD_ALLOC_RET(JNI_FALSE); -ret: - return result; -} - } /* extern "C" */ static bool SetFocusToPluginControl(HWND hwndPlugin)