Skip to content

Commit

Permalink
Set macos options before AWT loads so it gets set correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotjarnit committed Nov 22, 2023
1 parent df71664 commit da2a7cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/main/java/dev/elliotjarnit/elliotengine/ElliotEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public void run() {
if (!isSetup) {
this.optionSetup();

// Mac OS X specific options
if (this.getPlatform() == ElliotEngine.Platform.MAC) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("apple.awt.application.name", this.getOption(ElliotEngine.Options.NAME));
}

// Setup renderer
renderer = new RenderingEngine(this);
// Setup window
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public void setup() {
Container pane = window.getContentPane();
pane.setLayout(new BorderLayout());
pane.add(renderingEngine, BorderLayout.CENTER);

if (this.engine.getPlatform() == ElliotEngine.Platform.MAC) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("apple.awt.application.name", this.engine.getOption(ElliotEngine.Options.NAME));
}
}

public void start() {
Expand Down

0 comments on commit da2a7cf

Please sign in to comment.