diff --git a/src/share/classes/javax/swing/DefaultDesktopManager.java b/src/share/classes/javax/swing/DefaultDesktopManager.java
index 8ab24e56dd755345d7d01c176e035c969a567be0..df3d6eb2ab5d7c8ef90cfcea0c5ecf8991ac862a 100644
--- a/src/share/classes/javax/swing/DefaultDesktopManager.java
+++ b/src/share/classes/javax/swing/DefaultDesktopManager.java
@@ -174,6 +174,8 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
if(!wasIcon(f)) {
Rectangle r = getBoundsForIconOf(f);
desktopIcon.setBounds(r.x, r.y, r.width, r.height);
+ // we must validate the hierarchy to not break the hw/lw mixing
+ desktopIcon.revalidate();
setWasIcon(f, Boolean.TRUE);
}
@@ -453,11 +455,9 @@ public class DefaultDesktopManager implements DesktopManager, java.io.Serializab
/** This moves the JComponent
and repaints the damaged areas. */
public void setBoundsForFrame(JComponent f, int newX, int newY, int newWidth, int newHeight) {
- boolean didResize = (f.getWidth() != newWidth || f.getHeight() != newHeight);
f.setBounds(newX, newY, newWidth, newHeight);
- if(didResize) {
- f.validate();
- }
+ // we must validate the hierarchy to not break the hw/lw mixing
+ f.revalidate();
}
/** Convenience method to remove the desktopIcon of f is necessary. */
diff --git a/src/share/classes/javax/swing/JViewport.java b/src/share/classes/javax/swing/JViewport.java
index 80a124a41dc72afd57db85af1d6084d51982f577..85f39b373870dd47b586615ac6333e63b4664d6d 100644
--- a/src/share/classes/javax/swing/JViewport.java
+++ b/src/share/classes/javax/swing/JViewport.java
@@ -1111,6 +1111,8 @@ public class JViewport extends JComponent implements Accessible
view.setLocation(newX, newY);
repaintAll = false;
}
+ // we must validate the hierarchy to not break the hw/lw mixing
+ revalidate();
fireStateChanged();
}
}