Skip to content

Commit

Permalink
Fix run menu not getting initialized if GLFW cannot be initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
bwRavencl committed Jan 2, 2025
1 parent 1590094 commit 951e79a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/de/bwravencl/controllerbuddy/gui/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.EnumSet;
Expand Down Expand Up @@ -981,7 +982,7 @@ public void windowOpened(final WindowEvent e) {
quit();
}

initGui();
initGui(Collections.emptyList());
initProfile(cmdProfilePath, true);

return;
Expand Down Expand Up @@ -1030,9 +1031,7 @@ public void windowOpened(final WindowEvent e) {
}
});

initGui();

optionalPresentControllers.ifPresent(presentControllers -> onControllersChanged(presentControllers, true));
initGui(optionalPresentControllers.orElse(Collections.emptyList()));

// noinspection resource
taskRunner.run((Runnable) () -> GLFW.glfwSetJoystickCallback((jid, event) -> {
Expand Down Expand Up @@ -1825,9 +1824,10 @@ private boolean handleUnsavedChanges() {
};
}

private void initGui() {
private void initGui(final List<ControllerInfo> presentControllers) {
newProfile(false);
updateTheme();
onControllersChanged(presentControllers, true);
}

private void initOpenVrOverlay() {
Expand Down

0 comments on commit 951e79a

Please sign in to comment.