ItsSim / fsolauncher

Official FreeSO Launcher made with Electron
https://beta.freeso.org
Mozilla Public License 2.0
13 stars 9 forks source link

[Bug] Theme gets every launch on Linux #87

Closed dark-steveneq closed 2 months ago

dark-steveneq commented 2 months ago

Describe the bug Every time the launcher is opened, the theme gets changed back to the default "Open Beta" one and only on Linux

Launcher version 1.12.1

To reproduce Steps to reproduce the behavior:

  1. Open launcher
  2. Change theme to something else
  3. Close launcher

Expected behavior The theme would be the one set in step 3

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context I managed to nail the issue down to somewhere around preserve() method of FSOLauncher. main.js successfully reads and passes everything to the FSOLauncher constructor but when the preserve() function is called the theme gets reset and the FSOLauncher.ini gets overwritten.

ItsSim commented 2 months ago

Maybe there's a different behavior with the native theme event handler on Linux and causes it to get overwritten: https://github.com/ItsSim/fsolauncher/blob/2d0fa0da14d7f80094bd607861b86772881c4695/app/fsolauncher/events.js#L42

Only thing that comes to mind because the code is identical for every platform. Not sure, I'll look into it when I can.

dark-steveneq commented 2 months ago

Wow, spot on! Commenting out that exact line doesn't reset it now. I'll write a fix and make a PR.

dark-steveneq commented 2 months ago

Closing issue since merged