src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
Print this page
@@ -475,16 +475,18 @@
CWrapper.NSWindow.zoom(getNSWindowPtr());
} else {
deliverZoom(true);
this.normalBounds = peer.getBounds();
- long screen = CWrapper.NSWindow.screen(getNSWindowPtr());
- Rectangle toBounds = CWrapper.NSScreen.visibleFrame(screen).getBounds();
- // Flip the y coordinate
- Rectangle frame = CWrapper.NSScreen.frame(screen).getBounds();
- toBounds.y = frame.height - toBounds.y - toBounds.height;
- setBounds(toBounds.x, toBounds.y, toBounds.width, toBounds.height);
+
+ CGraphicsDevice device = ((CGraphicsDevice)getGraphicsDevice());
+ Insets i = device.getScreenInsets();
+ Rectangle toBounds = device.getDefaultConfiguration().getBounds();
+ setBounds(toBounds.x + i.left,
+ toBounds.y + i.top,
+ toBounds.width - i.left - i.right,
+ toBounds.height - i.top - i.bottom);
}
}
private void unmaximize() {
if (!isMaximized()) {
@@ -746,17 +748,11 @@
isFullScreenMode = true;
contentView.enterFullScreenMode();
// the move/size notification from the underlying system comes
// but it contains a bounds smaller than the whole screen
// and therefore we need to create the synthetic notifications
- Rectangle screenBounds;
- final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr());
- try {
- screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds();
- } finally {
- CWrapper.NSObject.release(screenPtr);
- }
+ Rectangle screenBounds = getGraphicsDevice().getDefaultConfiguration().getBounds();
peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width,
screenBounds.height);
}
@Override