Skip to content

Commit

Permalink
8316419: [macos] Setting X/Y makes Stage maximization not work before…
Browse files Browse the repository at this point in the history
… show

8255835: [macOS] Undecorated stage cannot be maximized
8305675: [macos] Stage set to iconified before being shown is displayed on screen

Reviewed-by: lkostyra, angorya
  • Loading branch information
beldenfox authored and Andy Goryachev committed Nov 1, 2023
1 parent 72c052e commit f41e3ec
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
16 changes: 16 additions & 0 deletions modules/javafx.graphics/src/main/native-glass/mac/GlassWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ - (void)sendEvent:(NSEvent *)event

@implementation GlassWindow_Normal
GLASS_NS_WINDOW_IMPLEMENTATION

-(NSRect)windowWillUseStandardFrame:(NSWindow*)window defaultFrame:(NSRect)newFrame
{
// For windows without titlebars the OS will suggest a frame that's the
// same size as the existing window, not the screen.
if (window.screen != nil && (window.styleMask & NSWindowStyleMaskTitled) == 0) {
return window.screen.visibleFrame;
}
return newFrame;
}

-(BOOL)isZoomed
{
// Ensure the window is not reported as maximized during initialization
return self.screen != nil && [super isZoomed];
}
@end

@implementation GlassWindow_Panel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ public static void teardown() {

@Test
public void testMaximize() throws Exception {
// temporary until JDK-8255835 is fixed
assumeTrue(!PlatformUtil.isMac());
Util.sleep(200);

boolean movedToTopCorner = stage.getY() != POS && stage.getX() != POS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ public void testFullScreenStage() throws InterruptedException {

@Test
public void testIconifiedStageBeforeShow() throws InterruptedException {
// Skip on Mac due to:
// - JDK-8305675
assumeTrue(!PlatformUtil.isMac());
// Skip on Linux due to:
// - JDK-8316423
assumeTrue(!PlatformUtil.isLinux());
Expand Down Expand Up @@ -245,9 +242,6 @@ public void testIconifiedStageBeforeShow() throws InterruptedException {

@Test
public void testMaximizedStageBeforeShow() throws InterruptedException {
// Skip on Mac due to:
// - JDK-8316419
assumeTrue(!PlatformUtil.isMac());
// Skip on Linux due to:
// - JDK-8316423
// - JDK-8316425
Expand Down

1 comment on commit f41e3ec

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.