Skip to content

Commit

Permalink
Fix AWT returned headless mode
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Aug 8, 2020
1 parent 8f7b179 commit f8a73da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/java/awt/GraphicsEnvironment.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ public boolean isHeadlessInstance() {
* keyboard, or mouse, false otherwise.
*/
public static boolean isHeadless() {
return "true".equals(System.getProperty("java.awt.headless"));
return false;

// Disable headless...
// "true".equals(System.getProperty("java.awt.headless"));
}

/**
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/java/awt/HeadlessToolkit.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,17 @@ protected void init() {
try {
ComponentInternals.setComponentInternals(new ComponentInternalsImpl());
// ???AWT: new EventQueue(this); // create the system EventQueue
// ???AWT: dispatcher = new Dispatcher(this);
// ???AWT:
dispatcher = new Dispatcher(this);
desktopProperties = new HashMap<String, Object>();
// ???AWT: desktopPropsSupport = new PropertyChangeSupport(this);
// ???AWT: awtEventsManager = new AWTEventsManager();
// ???AWT:
awtEventsManager = new AWTEventsManager();
// ???AWT: dispatchThread = new HeadlessEventDispatchThread(this,
// dispatcher);
// ???AWT: dtk = DTK.getDTK();
dispatchThread.start();

// dispatchThread.start();
} finally {
unlockAWT();
}
Expand Down

0 comments on commit f8a73da

Please sign in to comment.