8281555: [macos] Get rid of deprecated Style Masks constants
Reviewed-by: serb, aivanov
This commit is contained in:
parent
8819f45357
commit
f82866bc79
src/java.desktop/macosx/native
libawt_lwawt
libsplashscreen
test/jdk/javax/swing/JFrame/NSTexturedJFrame
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2022, 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
|
||||
@ -213,20 +213,20 @@ AWT_NS_WINDOW_IMPLEMENTATION
|
||||
NSUInteger type = 0;
|
||||
if (IS(styleBits, DECORATED)) {
|
||||
type |= NSTitledWindowMask;
|
||||
if (IS(styleBits, CLOSEABLE)) type |= NSClosableWindowMask;
|
||||
if (IS(styleBits, RESIZABLE)) type |= NSResizableWindowMask;
|
||||
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSFullSizeContentViewWindowMask;
|
||||
if (IS(styleBits, CLOSEABLE)) type |= NSWindowStyleMaskClosable;
|
||||
if (IS(styleBits, RESIZABLE)) type |= NSWindowStyleMaskResizable;
|
||||
if (IS(styleBits, FULL_WINDOW_CONTENT)) type |= NSWindowStyleMaskFullSizeContentView;
|
||||
} else {
|
||||
type |= NSBorderlessWindowMask;
|
||||
type |= NSWindowStyleMaskBorderless;
|
||||
}
|
||||
|
||||
if (IS(styleBits, MINIMIZABLE)) type |= NSMiniaturizableWindowMask;
|
||||
if (IS(styleBits, TEXTURED)) type |= NSTexturedBackgroundWindowMask;
|
||||
if (IS(styleBits, UNIFIED)) type |= NSUnifiedTitleAndToolbarWindowMask;
|
||||
if (IS(styleBits, UTILITY)) type |= NSUtilityWindowMask;
|
||||
if (IS(styleBits, HUD)) type |= NSHUDWindowMask;
|
||||
if (IS(styleBits, MINIMIZABLE)) type |= NSWindowStyleMaskMiniaturizable;
|
||||
if (IS(styleBits, TEXTURED)) type |= NSWindowStyleMaskTexturedBackground;
|
||||
if (IS(styleBits, UNIFIED)) type |= NSWindowStyleMaskUnifiedTitleAndToolbar;
|
||||
if (IS(styleBits, UTILITY)) type |= NSWindowStyleMaskUtilityWindow;
|
||||
if (IS(styleBits, HUD)) type |= NSWindowStyleMaskHUDWindow;
|
||||
if (IS(styleBits, SHEET)) type |= NSWindowStyleMaskDocModalWindow;
|
||||
if (IS(styleBits, NONACTIVATING)) type |= NSNonactivatingPanelMask;
|
||||
if (IS(styleBits, NONACTIVATING)) type |= NSWindowStyleMaskNonactivatingPanel;
|
||||
|
||||
return type;
|
||||
}
|
||||
@ -269,7 +269,7 @@ AWT_NS_WINDOW_IMPLEMENTATION
|
||||
|
||||
if (IS(mask, FULLSCREENABLE) && [self.nsWindow respondsToSelector:@selector(toggleFullScreen:)]) {
|
||||
if (IS(bits, FULLSCREENABLE)) {
|
||||
[self.nsWindow setCollectionBehavior:(1 << 7) /*NSWindowCollectionBehaviorFullScreenPrimary*/];
|
||||
[self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
} else {
|
||||
[self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorDefault];
|
||||
}
|
||||
@ -343,7 +343,7 @@ AWT_ASSERT_APPKIT_THREAD;
|
||||
[self setPropertiesForStyleBits:styleBits mask:MASK(_METHOD_PROP_BITMASK)];
|
||||
|
||||
if (IS(self.styleBits, IS_POPUP)) {
|
||||
[self.nsWindow setCollectionBehavior:(1 << 8) /*NSWindowCollectionBehaviorFullScreenAuxiliary*/];
|
||||
[self.nsWindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
|
||||
}
|
||||
|
||||
if (IS(bits, SHEET) && owner != nil) {
|
||||
@ -1690,7 +1690,7 @@ JNI_COCOA_ENTER(env);
|
||||
if (CGDisplayCapture(aID) == kCGErrorSuccess) {
|
||||
// remove window decoration
|
||||
NSUInteger styleMask = [AWTWindow styleMaskForStyleBits:window.styleBits];
|
||||
[nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSBorderlessWindowMask];
|
||||
[nsWindow setStyleMask:(styleMask & ~NSTitledWindowMask) | NSWindowStyleMaskBorderless];
|
||||
|
||||
int shieldLevel = CGShieldingWindowLevel();
|
||||
window.preFullScreenLevel = [nsWindow level];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2022, 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
|
||||
@ -1140,7 +1140,7 @@ static NSObject *sAttributeNamesLOCK = nil;
|
||||
|
||||
- (BOOL)accessibilityIsSizeAttributeSettable
|
||||
{
|
||||
// SIZE is settable in windows if [self styleMask] & NSResizableWindowMask - but windows are heavyweight so we're ok here
|
||||
// SIZE is settable in windows if [self styleMask] & NSWindowStyleMaskResizable - but windows are heavyweight so we're ok here
|
||||
// SIZE is settable in columns if [[self tableValue] allowsColumnResizing - haven't dealt with columns yet
|
||||
return NO;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2022, 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
|
||||
@ -166,7 +166,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
|
||||
NSWindow *window =
|
||||
[[NSWindow alloc]
|
||||
initWithContentRect: contentRect
|
||||
styleMask: NSBorderlessWindowMask
|
||||
styleMask: NSWindowStyleMaskBorderless
|
||||
backing: NSBackingStoreBuffered
|
||||
defer: false];
|
||||
if (window == nil) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2022, 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
|
||||
@ -434,7 +434,7 @@ SplashScreenThread(void *param) {
|
||||
|
||||
splash->window = (void*) [[NSWindow alloc]
|
||||
initWithContentRect: NSMakeRect(splash->x, splash->y, splash->width, splash->height)
|
||||
styleMask: NSBorderlessWindowMask
|
||||
styleMask: NSWindowStyleMaskBorderless
|
||||
backing: NSBackingStoreBuffered
|
||||
defer: NO
|
||||
screen: SplashNSScreen()];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2022, 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
|
||||
@ -36,7 +36,7 @@ import jdk.test.lib.Platform;
|
||||
* @key headful
|
||||
* @bug 7124513
|
||||
* @requires (os.family == "mac")
|
||||
* @summary We should support NSTexturedBackgroundWindowMask style on OSX.
|
||||
* @summary We should support NSWindowStyleMaskTexturedBackground style on OSX.
|
||||
* @library /test/lib
|
||||
* /lib/client
|
||||
* @build ExtendedRobot jdk.test.lib.Platform
|
||||
|
Loading…
x
Reference in New Issue
Block a user