--- old/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2016-04-29 10:15:24.767591000 +0530 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2016-04-29 10:15:24.543478999 +0530 @@ -174,27 +174,24 @@ cachedFocusableWindow = isFocusableWindow(); - Font f = target.getFont(); - if (f == null) { - f = XWindow.getDefaultFont(); - target.setFont(f); - // we should not call setFont because it will call a repaint - // which the peer may not be ready to do yet. + if (!target.isFontSet()) { + target.setFont(XWindow.getDefaultFont()); + // we should not call setFont because it will call a repaint + // which the peer may not be ready to do yet. } - Color c = target.getBackground(); - if (c == null) { - Color background = SystemColor.window; - target.setBackground(background); - // we should not call setBackGround because it will call a repaint - // which the peer may not be ready to do yet. + if (!target.isBackgroundSet()) { + target.setBackground(SystemColor.window); + // we should not call setBackGround because it will call a repaint + // which the peer may not be ready to do yet. + } - c = target.getForeground(); - if (c == null) { - target.setForeground(SystemColor.windowText); - // we should not call setForeGround because it will call a repaint - // which the peer may not be ready to do yet. + if (!target.isForegroundSet()) { + target.setForeground(SystemColor.windowText); + // we should not call setForeGround because it will call a repaint + // which the peer may not be ready to do yet. } + alwaysOnTop = ((Window)target).isAlwaysOnTop() && ((Window)target).isAlwaysOnTopSupported(); GraphicsConfiguration gc = getGraphicsConfiguration();