Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-24 Thread Artem Ananiev
Hi, David, .03 looks fine. Thanks for investigation, addressing all our comments, and this cleanup in general. Artem On 10/24/2013 7:52 AM, David DeHaven wrote: Another option (I think would make everyone happy) would be to add a native method to LWCToolkit.{java,m} that implements

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-24 Thread David Holmes
David, In src/share/native/java/lang/java_props.h the new field should really also be in ifdef MACOSX. The change to System.c allays my concerns there. You can also consider the hotspot changes Reviewed. Thanks, David H. On 24/10/2013 1:52 PM, David DeHaven wrote: Another option (I

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-24 Thread David DeHaven
David, In src/share/native/java/lang/java_props.h the new field should really also be in ifdef MACOSX. It's inside the #ifdef MACOSX block that was already there (starts at line 94), that's why I moved it to the bottom. You can't see it in the xDIFFs, but it's visible in the side-by-side

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread Anthony Petrov
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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread Artem Ananiev
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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread Anthony Petrov
On 10/23/2013 07:11 PM, 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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread David DeHaven
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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread Anthony Petrov
On 10/23/2013 08:49 PM, David DeHaven wrote: 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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread David DeHaven
The only reason I left it in there was for the AWT_TOOLKIT environment variable support. Right now if you set AWT_TOOLKIT to HToolkit it will start in headless mode regardless of what isAquaSession() returns. If we don't care about that then I'll happily remove it (I'm asking because I

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread David Holmes
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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-23 Thread David DeHaven
Another option (I think would make everyone happy) would be to add a native method to LWCToolkit.{java,m} that implements isAquaSession and returns a boolean. Call this new method in the static initializer and use it's return value to set java.awt.headless before calling initIDs. This will

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Erik Joelsson
Still looks good to me. /Erik On 2013-10-22 05:34, David DeHaven wrote: Updated webrev for JDK (hotspot change is the same): http://cr.openjdk.java.net/~ddehaven/8025673/jdk.1/ Changes since last version: - Moved to jdk8/build/jdk to save someone a merge headache, moved changes to

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Artem Ananiev
Hi, David, thanks for additional cleanup. I have only one concern. Before the fix, we checked if there is an active Aqua session. When no session was found, we falled back to HToolkit. I think this logic should be preserved, but slightly corrected: fall back to HeadlessToolkit (with CToolkit

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David DeHaven
Oops, you're right, it definitely crashes. I'll put that code back and take Artem's suggestion. -DrD- Artem is correct. On Mac we can't start a GUI session via ssh, for example. Thus we choose the headless mode then. The isInAquaSession() is supposed to perform exactly this check. This

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Leonid Romanov
There was a discussion why we use HToolkit instead of HeadlessToolkit: http://mail.openjdk.java.net/pipermail/awt-dev/2012-July/003114.html So we might want to continue using it. Also, please be aware that there is HToolkit check in GraphicsToolkit.getHeadlessProperty() On Oct 22, 2013, at

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Anthony Petrov
We don't have to. IIRC, the choice of HToolkit on Mac was made by chance. Since we must load the lwawt lib in headless on Mac anyway, we may as well use the CToolkit (properly wrapped in the HeadlessToolkit). But there's no need to continue to use the HToolkit on Mac. -- best regards,

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Sergey Bylokhov
Hello. I suppose we should request from sqe team to run the jck tests in the true headless mode via ssh(w/o headless option and w/o access to Aqua session). On 22.10.2013 21:54, Anthony Petrov wrote: We don't have to. IIRC, the choice of HToolkit on Mac was made by chance. Since we must

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David DeHaven
[removing hotspot-dev and build-dev..] I can't look at the code at the moment as I'm focused on something else... Does the wrapping happen automagically at some point based on java.awt.headless? It doesn't look trivial to do this from within the scope of java_props_md.c, it seems the best I

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread Anthony Petrov
I think that triggering java.awt.headless=true is enough. The class instance wrapping will be done automatically in java.awt.Toolkit.getDefaultToolkit(). A reliable way to test it is, I guess, as follows: log out of your GUI session, ssh to the Mac box, and try running a headless app (e.g. a

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David DeHaven
You can also just ssh otheruser@localhost, the login session will have no Aqua session associated with the other user. That might even work with the current user... -DrD- I think that triggering java.awt.headless=true is enough. The class instance wrapping will be done automatically in

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David DeHaven
Ok, I tried: PreferredToolkit prefToolkit = getPreferredToolkit(); if (prefToolkit == HToolkit) { sprops.awt_headless = true; } after adding awt_headless to the props struct and it works OK. The only issue is that in a non-GUI login there's a big fat warning: 2013-10-22

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David DeHaven
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) - Replaced the toolkit selection code in java_props_macosx.[ch]. I could have just exposed

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-22 Thread David Holmes
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

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread Erik Joelsson
Hello David, From a build point of view, the changes look fine to me. /Erik On 2013-10-21 01:56, David DeHaven wrote: CCing: build-dev, macosx-port-dev, hotspot-dev Request for review of JDK-8025673: https://bugs.openjdk.java.net/browse/JDK-8025673 Proposed changes:

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread Artem Ananiev
Hi, David, the changes look fine to me. See more comments below. On 10/21/2013 3:56 AM, David DeHaven wrote: CCing: build-dev, macosx-port-dev, hotspot-dev Request for review of JDK-8025673: https://bugs.openjdk.java.net/browse/JDK-8025673 Proposed changes:

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread Magnus Ihse Bursie
I agree with Erik once more. /Magnus 21 okt 2013 kl. 10:31 skrev Erik Joelsson erik.joels...@oracle.com: Hello David, From a build point of view, the changes look fine to me. /Erik On 2013-10-21 01:56, David DeHaven wrote: CCing: build-dev, macosx-port-dev, hotspot-dev Request for

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread Anthony Petrov
This fix looks fine to me as well. -- best regards, Anthony On 10/20/2013 11:56 PM, David DeHaven wrote: CCing: build-dev, macosx-port-dev, hotspot-dev Request for review of JDK-8025673: https://bugs.openjdk.java.net/browse/JDK-8025673 Proposed changes:

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread David DeHaven
Thanks guys. Anthony, can you sponsor this for me? -DrD- This fix looks fine to me as well. -- best regards, Anthony On 10/20/2013 11:56 PM, David DeHaven wrote: CCing: build-dev, macosx-port-dev, hotspot-dev Request for review of JDK-8025673:

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread David DeHaven
I want to do one more iteration of this. Based on feedback it seems I can remove a bit more code from java_props_macosx.[ch] and make things a bit cleaner. -DrD- Thanks guys. Anthony, can you sponsor this for me? -DrD- This fix looks fine to me as well. -- best regards, Anthony

Re: AWT Dev RFR: 8025673: Disable X11 AWT toolkit

2013-10-21 Thread David DeHaven
Updated webrev for JDK (hotspot change is the same): http://cr.openjdk.java.net/~ddehaven/8025673/jdk.1/ Changes since last version: - Moved to jdk8/build/jdk to save someone a merge headache, moved changes to CompileNativeLibs.gmk to libs/Awt2dLibraries.gmk - Removed HToolkit option and