src/java.desktop/macosx/classes/sun/lwawt/LWWindowPeer.java

Print this page

        

*** 170,180 **** warningWindow = warn; } @Override void initializeImpl() { ! super.initializeImpl(); if (getTarget() instanceof Frame) { setTitle(((Frame) getTarget()).getTitle()); setState(((Frame) getTarget()).getExtendedState()); --- 170,187 ---- warningWindow = warn; } @Override void initializeImpl() { ! Window target = getTarget(); ! setBackground(target.getBackground()); ! setForeground(target.getForeground()); ! setFont(target.getFont()); ! if (!isMaximized() || getTarget().isVisible()) { ! setBounds(target.getBounds()); ! } ! setEnabled(target.isEnabled()); if (getTarget() instanceof Frame) { setTitle(((Frame) getTarget()).getTitle()); setState(((Frame) getTarget()).getExtendedState());
*** 325,334 **** --- 332,347 ---- } // Native system could constraint bounds, so the peer wold be updated in the callback platformWindow.setBounds(newBounds.x, newBounds.y, newBounds.width, newBounds.height); } + public boolean isMaximized() { + Window win = getTarget(); + return win instanceof Frame + && ((Frame) win).getExtendedState() == Frame.MAXIMIZED_BOTH; + } + public Rectangle constrainBounds(Rectangle bounds) { return constrainBounds(bounds.x, bounds.y, bounds.width, bounds.height); } public Rectangle constrainBounds(int x, int y, int w, int h) {