<Swing Dev> RFR JDK-8239312 [macos] javax/swing/JFrame/NSTexturedJFrame/NSTexturedJFrame.java

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Mar 23 18:14:52 UTC 2020


On 3/23/20 2:52 am, Prasanta Sadhukhan wrote:
> 
> On 23-Mar-20 2:52 PM, Sergey Bylokhov wrote:
>> On 3/22/20 11:51 pm, Ajit Ghaisas wrote:
>>> Instead of ignoring it on all versions of osx, can we configure it NOT to run on osx 10.14 onwards?
>>
>> I think that the problem is not directly related to the OS where
>> we run the test, but to the SDK which we use to build jdk.
>>
>> Does the current test works fine on 10.13?
>>
> Yes, it was already mentioned in the JBS.

Actually that was a surprise to me and I decided to check it deeper.

Are you sure that the failure of the test is related to the reported bug? I cannot
check macOS 10.13, but on macOS 10.14+ the reason of the failure is that the gradient
background(dark appearance) of the frame when these options are specified are
different(the test expected it to be the same). However the test confirms that the
colors are still different when these property set/unset. The test cannot check the case
from the bug becaouse it uses undecorated window. Looks like it is a separate testbug.


I also modified the SwingSet2 to use "apple.awt.brushMetalLook" and confirm that the
unified toolbar works -> the gradient is applied, the toolbar is transparent. The only
problem I see is that the title of frame is visible.

Using the SwingSet2 I also confirm that
"apple.awt.transparentTitleBar=true" + "apple.awt.fullWindowContent=true" are not a
proper replacement of "apple.awt.brushMetalLook". The "apple.awt.fullWindowContent"
cause "wrong" frame layout, because the NSView occupy the whole frame, and content
appears under the title buttons. Also gradient is not applied.

So the conclusion:
  - The NSTexturedJFrame test has a bug and it should be fixed. The expectation that
    the gradient will be the same all the time is incorrect.
  - The "textured background" still works, it uses gradient color. The toolbar
    and frame content are transparent.
  - The bug reported here about visible title of the frame is not a bug in the jdk, but
    a behavior change in macOS sdk, it could be fixed by using "apple.awt.transparentTitleBar=true"
    in the application.


-- 
Best regards, Sergey.


More information about the swing-dev mailing list