8214046: [macosx] Undecorated Frame does not Iconify when set to
Reviewed-by: dmarkov
This commit is contained in:
parent
fe21ff6906
commit
4ee5f65691
@ -205,13 +205,13 @@ AWT_NS_WINDOW_IMPLEMENTATION
|
|||||||
if (IS(styleBits, DECORATED)) {
|
if (IS(styleBits, DECORATED)) {
|
||||||
type |= NSTitledWindowMask;
|
type |= NSTitledWindowMask;
|
||||||
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask;
|
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask;
|
||||||
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
|
|
||||||
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask;
|
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask;
|
||||||
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSFullSizeContentViewWindowMask;
|
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSFullSizeContentViewWindowMask;
|
||||||
} else {
|
} else {
|
||||||
type |= NSBorderlessWindowMask;
|
type |= NSBorderlessWindowMask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
|
||||||
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
|
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
|
||||||
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
|
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
|
||||||
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
|
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2016, 2017, 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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -24,7 +24,7 @@
|
|||||||
/**
|
/**
|
||||||
* @test
|
* @test
|
||||||
* @key headful
|
* @key headful
|
||||||
* @bug 8171949
|
* @bug 8171949 8214046
|
||||||
* @summary Tests that bitwise mask is set and state listener is notified during state transition.
|
* @summary Tests that bitwise mask is set and state listener is notified during state transition.
|
||||||
* @author Dmitry Markov
|
* @author Dmitry Markov
|
||||||
* @library ../../regtesthelpers
|
* @library ../../regtesthelpers
|
||||||
@ -41,12 +41,18 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||||||
import test.java.awt.regtesthelpers.Util;
|
import test.java.awt.regtesthelpers.Util;
|
||||||
|
|
||||||
public class NormalToIconifiedTest {
|
public class NormalToIconifiedTest {
|
||||||
private static final AtomicBoolean listenerNotified = new AtomicBoolean(false);
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
Robot robot = Util.createRobot();
|
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");
|
Frame testFrame = new Frame("Test Frame");
|
||||||
|
testFrame.setUndecorated(undecorated);
|
||||||
testFrame.setSize(200, 200);
|
testFrame.setSize(200, 200);
|
||||||
testFrame.addWindowStateListener(new WindowStateListener() {
|
testFrame.addWindowStateListener(new WindowStateListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -58,14 +64,11 @@ public class NormalToIconifiedTest {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
testFrame.setVisible(true);
|
testFrame.setVisible(true);
|
||||||
|
|
||||||
Frame mainFrame = new Frame("Main Frame");
|
Frame mainFrame = new Frame("Main Frame");
|
||||||
mainFrame.setSize(200, 200);
|
mainFrame.setSize(200, 200);
|
||||||
mainFrame.setLocationRelativeTo(null);
|
mainFrame.setLocationRelativeTo(null);
|
||||||
mainFrame.setVisible(true);
|
mainFrame.setVisible(true);
|
||||||
|
|
||||||
Util.waitForIdle(robot);
|
Util.waitForIdle(robot);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Util.clickOnComp(mainFrame, robot);
|
Util.clickOnComp(mainFrame, robot);
|
||||||
Util.waitForIdle(robot);
|
Util.waitForIdle(robot);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user