<Swing Dev> RFR JDK-8240995:[macos] Unified toolbar is broken in JDK 11

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Sun Mar 22 04:07:54 UTC 2020


I knew that NSTexturedBackgroundMask is replaced with NSWindowStyleMaskTexturedBackground and I tried that but it did not work. But it seems we used to get an warning when it was deprecated "

WARNING: Textured window <AtomNSWindow: 0x7fe3687673e0> is getting an implicitly transparent titlebar. This will break when linking against newer SDKs. Use NSWindow's -titlebarAppearsTransparent=YES instead."
So, I set that property instead. It was also mentioned in 

https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc <https://developer.apple.com/documentation/appkit/nswindow/1419167-titlebarappearstransparent?language=objc>
to set "tilebarAppearsTransparent" this property to YES when NSFullSizeContentViewWindowMask <https://developer.apple.com/documentation/appkit/nsfullsizecontentviewwindowmask?language=objc> is also set, so I used that. 

And if you see the output after my fix, it is showing brushMetalLook output correctly, 

Also NSWindow.h that my 10.14.6 has does not say “textured background should no longer be used”. I am attaching the file

static const NSWindowStyleMask NSTexturedBackgroundWindowMask NS_DEPRECATED_WITH_REPLACEMENT_MAC("NSWindowStyleMaskTexturedBackground", 10.0, 10.12) = NSWindowStyleMaskTexturedBackground;

Regards
Prasanta

> On 22-Mar-2020, at 4:17 AM, Sergey Bylokhov <Sergey.Bylokhov at oracle.com> wrote:
> 
> Hi, Prasanta.
> 
>> Issue is because of the fact that with migration to new SDK by JDK-8205424, the flags used to specify textured background for NSWindow is deprecated and we did not update the code with new flag.>> Fix is to use new flags as specified by apple doc
> Are you sure that the new flag is a replacement of "NSTexturedBackgroundWindowMask"?
> I think that this new flag is a replacement of "NSFullSizeContentViewWindowMask" which is
> also used in the AWTWindow:
> 
> 209         if (IS(styleBits, FULL_WINDOW_CONTENT))  type |= NSFullSizeContentViewWindowMask;
> 
> I guess the old property "NSTexturedBackgroundWindowMask" should be replaced by the
> "NSWindowStyleMaskTexturedBackground" but it is also deprecated since 10.14:
> 
> ============================================
> http://codeworkshop.net/objc-diff/sdkdiffs/macos/10.14/AppKit.html
> 
> Modified NSWindowStyleMaskTexturedBackground
> 	Availability	Deprecation Message
> From	Available	none
> To	Deprecated	Textured window style should no longer be used
> ============================================
> 
> So it looks like we already do our best, and should recommend everybody to not use the "Textured window style".
> 
> -- 
> Best regards, Sergey.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200322/bc901b2b/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NSWindow.h
Type: application/octet-stream
Size: 70698 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200322/bc901b2b/NSWindow-0001.h>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/swing-dev/attachments/20200322/bc901b2b/attachment-0003.htm>


More information about the swing-dev mailing list