Skip to content

Commit cd2862c

Browse files
hansonrhansonr
authored andcommitted
Identification of an independent frame, relative to embedding
1 parent acfa7ee commit cd2862c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSFrameUI.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package swingjs.plaf;
22

33
import java.awt.Color;
4+
import java.awt.Component;
45
import java.awt.Desktop;
56
import java.awt.Dimension;
67
import java.awt.Insets;
8+
import java.awt.JSComponent;
79
import java.awt.Rectangle;
810
import java.awt.Toolkit;
911
import java.awt.event.ComponentEvent;
@@ -185,9 +187,13 @@ public DOMNode updateDOMNode() {
185187

186188
@Override
187189
protected boolean isFrameIndependent() {
188-
if (isInternalFrame && frame.parent != null && frame.parent.getUIClassID() != "DesktopPaneUI")
190+
JSComponent c = frame.parent;
191+
if (isInternalFrame && (c == null || c != null
192+
&& c.getUIClassID() != "DesktopPaneUI"))
189193
return false;
190-
return (!isInternalFrame || embeddingNode == null || !doEmbed);
194+
boolean is = (isInternalFrame ? c == null
195+
|| c.getWidth() == 0 : !doEmbed);
196+
return is;
191197
}
192198

193199

0 commit comments

Comments
 (0)