From 1f138e1009246b2305d586fb0d8fabb3a0625803 Mon Sep 17 00:00:00 2001 From: Prasanta Sadhukhan Date: Thu, 23 May 2019 10:50:47 +0530 Subject: [PATCH] 8211703: JInternalFrame : java.lang.AssertionError: cannot find the internal frame Reviewed-by: prr, serb --- .../classes/com/sun/java/swing/plaf/gtk/Metacity.java | 9 ++++++++- .../client/SwingSet/src/InternalFrameDemoTest.java | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java index 78a3daa880e..4e943c0473c 100644 --- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java +++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java @@ -1471,7 +1471,14 @@ class Metacity implements SynthConstants { JComponent comp = context.getComponent(); JComponent titlePane = findChild(comp, "InternalFrame.northPane"); - JInternalFrame jif = findInternalFrame(comp); + JInternalFrame jif; + if (comp instanceof JButton) { + JComponent bTitlePane = (JComponent)comp.getParent(); + Container titlePaneParent = bTitlePane.getParent(); + jif = findInternalFrame(titlePaneParent); + } else { + jif = findInternalFrame(comp); + } if (jif == null) { return; } diff --git a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java index d640421a8e4..ad40edf3514 100644 --- a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java +++ b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java @@ -64,6 +64,7 @@ import com.sun.swingset3.demos.internalframe.InternalFrameDemo; /* * @test + * @bug 8211703 * @key headful * @summary Verifies SwingSet3 InternalFrameDemo page by checking the different * actions on the parent frame, internal frame and creating internal frame