equal
deleted
inserted
replaced
477 CWrapper.NSWindow.zoom(getNSWindowPtr()); |
477 CWrapper.NSWindow.zoom(getNSWindowPtr()); |
478 } else { |
478 } else { |
479 deliverZoom(true); |
479 deliverZoom(true); |
480 |
480 |
481 this.normalBounds = peer.getBounds(); |
481 this.normalBounds = peer.getBounds(); |
482 long screen = CWrapper.NSWindow.screen(getNSWindowPtr()); |
482 |
483 Rectangle toBounds = CWrapper.NSScreen.visibleFrame(screen).getBounds(); |
483 GraphicsConfiguration config = getPeer().getGraphicsConfiguration(); |
484 // Flip the y coordinate |
484 Insets i = ((CGraphicsDevice)config.getDevice()).getScreenInsets(); |
485 Rectangle frame = CWrapper.NSScreen.frame(screen).getBounds(); |
485 Rectangle toBounds = config.getBounds(); |
486 toBounds.y = frame.height - toBounds.y - toBounds.height; |
486 setBounds(toBounds.x + i.left, |
487 setBounds(toBounds.x, toBounds.y, toBounds.width, toBounds.height); |
487 toBounds.y + i.top, |
|
488 toBounds.width - i.left - i.right, |
|
489 toBounds.height - i.top - i.bottom); |
488 } |
490 } |
489 } |
491 } |
490 |
492 |
491 private void unmaximize() { |
493 private void unmaximize() { |
492 if (!isMaximized()) { |
494 if (!isMaximized()) { |
749 isFullScreenMode = true; |
751 isFullScreenMode = true; |
750 contentView.enterFullScreenMode(); |
752 contentView.enterFullScreenMode(); |
751 // the move/size notification from the underlying system comes |
753 // the move/size notification from the underlying system comes |
752 // but it contains a bounds smaller than the whole screen |
754 // but it contains a bounds smaller than the whole screen |
753 // and therefore we need to create the synthetic notifications |
755 // and therefore we need to create the synthetic notifications |
754 Rectangle screenBounds; |
756 Rectangle screenBounds = getPeer().getGraphicsConfiguration().getBounds(); |
755 final long screenPtr = CWrapper.NSWindow.screen(getNSWindowPtr()); |
|
756 try { |
|
757 screenBounds = CWrapper.NSScreen.frame(screenPtr).getBounds(); |
|
758 } finally { |
|
759 CWrapper.NSObject.release(screenPtr); |
|
760 } |
|
761 peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width, |
757 peer.notifyReshape(screenBounds.x, screenBounds.y, screenBounds.width, |
762 screenBounds.height); |
758 screenBounds.height); |
763 } |
759 } |
764 |
760 |
765 @Override |
761 @Override |