X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTApplication.java;h=8071ae8edc2a5a0f5762dcdd2d2871db960dbe54;hb=30bd4abd2a85c162bdf0a1cc687b366345182bc1;hp=88b329f6f62158668562b821be59d235b67725c5;hpb=1ac2ccb131cfab3a72dad856c67e2f4fd87aa143;p=nikiroo-utils.git diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 88b329f..8071ae8 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -312,12 +312,26 @@ public class TApplication { public TApplication(final InputStream input, final OutputStream output) throws UnsupportedEncodingException { - if (System.getProperty("jexer.AWT", "false").equals("true")) { + // AWT is the default backend on Windows unless explicitly overridden + // by jexer.AWT. + boolean useAWT = false; + if (System.getProperty("os.name").startsWith("Windows")) { + useAWT = true; + } + if (System.getProperty("jexer.AWT") != null) { + if (System.getProperty("jexer.AWT", "false").equals("true")) { + useAWT = true; + } else { + useAWT = false; + } + } + + + if (useAWT) { backend = new AWTBackend(); } else { backend = new ECMA48Backend(input, output); } - theme = new ColorTheme(); desktopBottom = getScreen().getHeight() - 1; fillEventQueue = new ArrayList();