Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222819

Remove setting of headless property on MacOS from launcher code.


    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 13
    • Fix Version/s: 13
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:


      There is a variable awt_headless in the native system props
      structure used to populate system properties.

      This was added relatively recently in bringing in the MacOS port.
      Specifically it was added by this fix :
      Reviewed here : https://mail.openjdk.java.net/pipermail/awt-dev/2013-October/006114.html
      Where since the fix was removing some macos specific code to select the toolkit class, it probably
      didn't unreasonable to be setting this property as a better alternative
      I think this email https://mail.openjdk.java.net/pipermail/awt-dev/2013-October/006132.html
      started the discussion that lead to the result and conclusion we needed to use the
      IsInAquaSession check to make sure we don't try to launch in headful mode if we can't.

      Since then we've had another fix :
      which copied the isInAquaSession() code into the desktop module.

      I think it should be possible to figure out entirely in the desktop module
      code if we want to default to a headless session, as we already do for X11.

      See java/awt/GraphicsEnvironment.java's getHeadlessProperty() method.
      Is it as simple as calling isInAquaSession() for the macos case there ?

      Then that launcher code can be removed.

      Can getHeadlessProperty() be refactored so we don't have all the platform knowledge there?
      Since you don't want to instantiate the platform classes of GE
      we'd have to create some small helper class per-platform to give the answer.
      It might not have been worth it before, but maybe is if we want to call MacOS native
      code on MacOS ..


          Issue Links



              • Assignee:
                prr Philip Race
                prr Philip Race
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: