[7u4] Request for approval for 7124530 - What is background color of AWT component? (And foreground, for that matter)
Sergey Bylokhov
sergey.bylokhov at oracle.com
Mon Jan 23 11:16:27 PST 2012
Hello,
Note: that the fix just replace one constant to another. And if there is
a way to get this system background color in more appropriate way, we
can do it later.
If there is no other comments I request an approve for the fix again.
20.01.2012 17:21, Sergey Bylokhov wrote:
> 18.01.2012 0:29, Mike Swingler wrote:
>> On Jan 13, 2012, at 10:52 AM, Sergey Bylokhov wrote:
>>
>>> 13.01.2012 21:31, Mike Swingler пишет:
>>>> On Jan 13, 2012, at 6:27 AM, Sergey Bylokhov wrote:
>>>>
>>>>> 13.01.2012 6:30, Mike Swingler wrote:
>>>>>
>>>>>> On Jan 12, 2012, at 4:24 AM, Sergey Bylokhov wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>> This is a request to push the following changes to jdk7u-osx.
>>>>>>> The fix has been reviewed on macosx-port-dev mailing list by
>>>>>>> Alexander Potochkin.
>>>>>>>
>>>>>>> Bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7124530
>>>>>>> Webrev can be found at:
>>>>>>> http://cr.openjdk.java.net/~serb/7124530/webrev.00/
>>>>>>> Technical review:
>>>>>>> http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-January/002143.html
>>>>>> I don't understand this part:
>>>>>>
>>>>>> --- old/src/macosx/native/sun/awt/CSystemColors.m 2011-12-28
>>>>>> 19:02:19.913935900 +0400
>>>>>> +++ new/src/macosx/native/sun/awt/CSystemColors.m 2011-12-28
>>>>>> 19:02:19.557915600 +0400
>>>>>> @@ -81,7 +81,8 @@
>>>>>> sColors[java_awt_SystemColor_INACTIVE_CAPTION] =
>>>>>> [NSColor grayColor];
>>>>>> sColors[java_awt_SystemColor_INACTIVE_CAPTION_TEXT] =
>>>>>> [NSColor grayColor];
>>>>>> sColors[java_awt_SystemColor_INACTIVE_CAPTION_BORDER] =
>>>>>> [NSColor grayColor];
>>>>>> - sColors[java_awt_SystemColor_WINDOW] =
>>>>>> [NSColor grayColor];
>>>>>> + const CGFloat color = (CGFloat)0xEE/(CGFloat)0xFF;
>>>>>> + sColors[java_awt_SystemColor_WINDOW] = [NSColor
>>>>>> colorWithCalibratedRed:color green:color blue:color alpha:1.0f];
>>>>>> sColors[java_awt_SystemColor_WINDOW_BORDER] =
>>>>>> [NSColor windowFrameColor];
>>>>>> sColors[java_awt_SystemColor_WINDOW_TEXT] =
>>>>>> [NSColor windowFrameTextColor];
>>>>>> sColors[java_awt_SystemColor_MENU] =
>>>>>> [NSColor controlBackgroundColor];
>>>>>>
>>>>>> Why aren't you just using [NSColor windowBackgroundColor]?
>>>>> Only selectedControlColor and selectedTextBackgroundColor are
>>>>> supported.
>>>>> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DrawColor/Tasks/SystemColors.html#//apple_ref/doc/uid/20000790
>>>>>
>>>>> As I understand that`s why swing didn`t use this color. After the
>>>>> fix awt and swing use one color (before the fix this color was
>>>>> used by swing).
>>>>> If this color is wrong, now it`s possible to change it in one place.
>>>> I can assure you that the window background color reports the
>>>> correct RGB value, even when the background color has changed
>>>> between OS versions. You static constant will not.
>>>>
>>>> We use it today in Java SE 6.
>>> jdk6 on my system reports white color which is wrong. Can you please
>>> check it(testcase attached).
>> The test works fine in Java SE 6 with JFrames and other components.
>> The bug where you are getting white from a pure AWT Frame is a side
>> effect of something we call the "magic background color", which is
>> not applicable to Java 7.
> On jdk 6 it works with swing components, because they use
> com.apple.laf.AquaNativeResources$CColorPaintUIResource with
> RGB[r=238,g=238,b=238] instead of SystemColor.WINDOW with
> RGB[r=255,g=255,b=255]. I assume that SystemColor.WINDOW is not used
> in jdk 6.
>>
>> Does +[NSColor windowBackgroundColor] not give you the correct RGB
>> value?
> Yes. It return white color[r=255,g=255,b=255].
>>
>> Regards,
>> Mike Swingler
>> Apple Inc.
>>
>
>
--
Best regards, Sergey.
More information about the jdk7u-dev
mailing list