<AWT Dev> RFR: 8025673: Disable X11 AWT toolkit

David Holmes david.holmes at oracle.com
Wed Oct 23 19:01:56 PDT 2013


On 24/10/2013 1:11 AM, Artem Ananiev wrote:
>
> On 10/23/2013 4:34 PM, Anthony Petrov wrote:
>> On 10/23/2013 08:52 AM, David Holmes wrote:
>>> On 23/10/2013 2:10 PM, David DeHaven wrote:
>>>>
>>>> Updated webrev:
>>>>
>>>> http://cr.openjdk.java.net/~ddehaven/8025673/jdk.2/
>>>>
>>>> Summary of changes since last:
>>>> - Added awt_headless to java_props_t (set to NULL by default which
>>>> does not set the property)
>>>
>>> Not sure about this part. We already force this property to be set in
>>> Embedded without needing any changes in the code you have modified and
>>> I'm not sure if your changes will break what we already do. Why do you
>>> need to do it?
>>>
>>> I'm getting concerned about this change touching stuff outside of OSX.
>>
>> I think I agree with David. E.g. I'm not sure I like changing
>> j/l/System.c for this fix.
>>
>> Given the time constraints, perhaps going with HToolkit would be a good
>> enough solution for now?
>>
>> Artem, what's your opinion?
>
> I'm personally fine with the current version. The fix is now Mac OS X
> specific, as sprops.awt_headless is only set within #ifdef MACOSX,

Are we looking at the same code? This change in System.c:

  209     if (sprops->awt_headless) {
  210         PUTPROP(props, "java.awt.headless", sprops->awt_headless);
  211     }

is not in any ifdef.

http://cr.openjdk.java.net/~ddehaven/8025673/jdk.2/src/share/native/java/lang/System.c.frames.html

David H.
--------

  it
> won't have any impact on other platforms. At the same time it enables
> headless functionality on Mac OS X, while HToolkit doesn't.
>
> Note that it can be improved further. As it stands now, the only purpose
> of getPreferredToolkit() is to check if Aqua session is active. The
> toolkit we use is always CToolkit, regardless of what this method
> returns, so the method can be removed, and isInAquaSession() can be
> called instead. Leaving this further cleanup up to David D., though.
>
> Thanks,
>
> Artem
>
>> --
>> best regards,
>> Anthony
>>
>>>
>>> David
>>>
>>>> - Replaced the toolkit selection code in java_props_macosx.[ch]. I
>>>> could have just exposed isAquaSession but I wanted to preserve the
>>>> AWT_TOOLKIT environment variable support (no idea if it's actually
>>>> used or not...).
>>>> - Modified WrappedToolkitTest.sh to check that it's wrapping
>>>> LWCToolkit in HeadlessToolkit and now all five awt/Toolkit/Headless
>>>> jtreg tests pass.
>>>>
>>>> No build system or hotspot changes since the last patch.
>>>>
>>>> -DrD-
>>>>


More information about the awt-dev mailing list