Skip to content

Commit a039c8a

Browse files
gesellixPaul Hohensee
authored andcommitted
8214046: [macosx] Undecorated Frame does not Iconify when set to
Reviewed-by: phh, serb Backport-of: ab97f65242dad6ad1a7bfb8284954f202eb37369
1 parent 587090d commit a039c8a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

jdk/src/macosx/native/sun/awt/AWTWindow.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ + (NSUInteger) styleMaskForStyleBits:(jint)styleBits {
203203
if (IS(styleBits, DECORATED)) {
204204
type |= NSTitledWindowMask;
205205
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask;
206-
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
207206
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask;
208207
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSFullSizeContentViewWindowMask;
209208
} else {
210209
type |= NSBorderlessWindowMask;
211210
}
212211

212+
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
213213
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
214214
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
215215
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;

jdk/test/java/awt/Frame/NormalToIconified/NormalToIconifiedTest.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@
2323

2424
/*
2525
* @test
26-
* @bug 8171949
26+
* @bug 8171949 8214046
2727
* @summary Tests that bitwise mask is set and state listener is notified during state transition.
2828
* @author Dmitry Markov
2929
* @library ../../regtesthelpers
@@ -40,12 +40,19 @@
4040
import test.java.awt.regtesthelpers.Util;
4141

4242
public class NormalToIconifiedTest {
43-
private static final AtomicBoolean listenerNotified = new AtomicBoolean(false);
4443

4544
public static void main(String[] args) {
45+
test(false);
46+
test(true);
47+
}
48+
49+
private static void test(final boolean undecorated) {
50+
AtomicBoolean listenerNotified = new AtomicBoolean(false);
51+
4652
Robot robot = Util.createRobot();
4753

4854
Frame testFrame = new Frame("Test Frame");
55+
testFrame.setUndecorated(undecorated);
4956
testFrame.setSize(200, 200);
5057
testFrame.addWindowStateListener(new WindowStateListener() {
5158
@Override

0 commit comments

Comments
 (0)