Skip to content

Commit

Permalink
8214046: [macosx] Undecorated Frame does not Iconify when set to
Browse files Browse the repository at this point in the history
Reviewed-by: phh, serb
Backport-of: ab97f65242dad6ad1a7bfb8284954f202eb37369
  • Loading branch information
gesellix authored and Paul Hohensee committed Aug 7, 2023
1 parent 587090d commit a039c8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jdk/src/macosx/native/sun/awt/AWTWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ + (NSUInteger) styleMaskForStyleBits:(jint)styleBits {
if (IS(styleBits, DECORATED)) {
type |= NSTitledWindowMask;
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask;
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask;
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSFullSizeContentViewWindowMask;
} else {
type |= NSBorderlessWindowMask;
}

if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,7 +23,7 @@

/*
* @test
* @bug 8171949
* @bug 8171949 8214046
* @summary Tests that bitwise mask is set and state listener is notified during state transition.
* @author Dmitry Markov
* @library ../../regtesthelpers
Expand All @@ -40,12 +40,19 @@
import test.java.awt.regtesthelpers.Util;

public class NormalToIconifiedTest {
private static final AtomicBoolean listenerNotified = new AtomicBoolean(false);

public static void main(String[] args) {
test(false);
test(true);
}

private static void test(final boolean undecorated) {
AtomicBoolean listenerNotified = new AtomicBoolean(false);

Robot robot = Util.createRobot();

Frame testFrame = new Frame("Test Frame");
testFrame.setUndecorated(undecorated);
testFrame.setSize(200, 200);
testFrame.addWindowStateListener(new WindowStateListener() {
@Override
Expand Down

1 comment on commit a039c8a

@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.