8211703: JInternalFrame : java.lang.AssertionError: cannot find the internal frame
Reviewed-by: prr, serb
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Tue May 21 14:41:43 2019 +0530
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Thu May 23 10:50:47 2019 +0530
@@ -1471,7 +1471,14 @@
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;
}
--- a/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java Tue May 21 14:41:43 2019 +0530
+++ b/test/jdk/sanity/client/SwingSet/src/InternalFrameDemoTest.java Thu May 23 10:50:47 2019 +0530
@@ -64,6 +64,7 @@
/*
* @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