Mercurial > hg > icedtea-web
changeset 1496:5290684409aa
Made headless detection softer
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Thu, 24 May 2018 17:55:31 +0200 |
parents | b64b383a4561 |
children | 0b0da6841278 |
files | netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Mon May 14 17:11:41 2018 +0200 +++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java Thu May 24 17:55:31 2018 +0200 @@ -19,6 +19,9 @@ import static net.sourceforge.jnlp.runtime.Translator.R; import java.awt.EventQueue; +import java.awt.GraphicsEnvironment; +import static java.awt.GraphicsEnvironment.isHeadless; +import java.awt.HeadlessException; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -741,8 +744,10 @@ } if (!headless) { try { - new JWindow().getOwner(); - } catch (Exception ex) { + if (GraphicsEnvironment.isHeadless()) { + throw new HeadlessException(); + } + } catch (HeadlessException ex) { headless = true; OutputController.getLogger().log(ex); OutputController.getLogger().log(OutputController.Level.MESSAGE_ALL, Translator.R("HEADLESS_MISSCONFIGURED"));