mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
6825362: Avoid calling peer.setZOrder on Window instances
Reviewed-by: anthony
This commit is contained in:
parent
76fedc71ad
commit
fbea8d87f4
4 changed files with 13 additions and 43 deletions
|
@ -6666,7 +6666,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
|
|
||||||
|
|
||||||
// Update stacking order
|
// Update stacking order
|
||||||
peer.setZOrder(getHWPeerAboveMe());
|
updateZOrder();
|
||||||
|
|
||||||
if (!isAddNotifyComplete) {
|
if (!isAddNotifyComplete) {
|
||||||
mixOnShowing();
|
mixOnShowing();
|
||||||
|
@ -9838,4 +9838,11 @@ public abstract class Component implements ImageObserver, MenuContainer,
|
||||||
|
|
||||||
return doesClassImplement(obj.getClass(), interfaceName);
|
return doesClassImplement(obj.getClass(), interfaceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that the method is overriden in the Window class,
|
||||||
|
// a window doesn't need to be updated in the Z-order.
|
||||||
|
void updateZOrder() {
|
||||||
|
peer.setZOrder(getHWPeerAboveMe());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -840,7 +840,7 @@ public class Container extends Component {
|
||||||
// Native container changed - need to reparent native widgets
|
// Native container changed - need to reparent native widgets
|
||||||
newNativeContainer.reparentChild(comp);
|
newNativeContainer.reparentChild(comp);
|
||||||
}
|
}
|
||||||
comp.peer.setZOrder(comp.getHWPeerAboveMe());
|
comp.updateZOrder();
|
||||||
|
|
||||||
if (!comp.isLightweight() && isLightweight()) {
|
if (!comp.isLightweight() && isLightweight()) {
|
||||||
// If component is heavyweight and one of the containers is lightweight
|
// If component is heavyweight and one of the containers is lightweight
|
||||||
|
|
|
@ -3674,6 +3674,10 @@ public class Window extends Container implements Accessible {
|
||||||
}); // WindowAccessor
|
}); // WindowAccessor
|
||||||
} // static
|
} // static
|
||||||
|
|
||||||
|
// a window doesn't need to be updated in the Z-order.
|
||||||
|
@Override
|
||||||
|
void updateZOrder() {}
|
||||||
|
|
||||||
} // class Window
|
} // class Window
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,45 +99,4 @@ class WPanelPeer extends WCanvasPeer implements PanelPeer {
|
||||||
public Insets insets() {
|
public Insets insets() {
|
||||||
return getInsets();
|
return getInsets();
|
||||||
}
|
}
|
||||||
|
|
||||||
private native void pRestack(Object[] peers);
|
|
||||||
private void restack(Container cont, Vector peers) {
|
|
||||||
for (int i = 0; i < cont.getComponentCount(); i++) {
|
|
||||||
Component comp = cont.getComponent(i);
|
|
||||||
if (!comp.isLightweight()) {
|
|
||||||
ComponentPeer peer = comp.getPeer();
|
|
||||||
if (peer != null && (peer instanceof WComponentPeer))
|
|
||||||
{
|
|
||||||
peers.add(peer);
|
|
||||||
} else {
|
|
||||||
if (log.isLoggable(Level.FINE)) {
|
|
||||||
log.log(Level.FINE,
|
|
||||||
"peer of a {0} is null or not a WComponentPeer: {1}.",
|
|
||||||
new Object[]{comp, peer});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (comp.isLightweight() && comp instanceof Container) {
|
|
||||||
restack((Container)comp, peers);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see java.awt.peer.ContainerPeer#restack
|
|
||||||
*/
|
|
||||||
public void restack() {
|
|
||||||
Vector peers = new Vector();
|
|
||||||
peers.add(this);
|
|
||||||
Container cont = (Container)target;
|
|
||||||
restack(cont, peers);
|
|
||||||
pRestack(peers.toArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @see java.awt.peer.ContainerPeer#isRestackSupported
|
|
||||||
*/
|
|
||||||
public boolean isRestackSupported() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue