cibikle / LaSSI

LaSSI (the Last Starship Save Inspector) is a free, open source, cross-platform, fan-made tool for inspecting and editing save files for "The Last Starship" by Introversion Software (https://www.introversion.co.uk/introversion/). Cross-platform UI made possible by Eto (https://github.com/picoe/Eto)
GNU Affero General Public License v3.0
3 stars 3 forks source link

Quit causes double-close #101

Closed cibikle closed 7 months ago

cibikle commented 7 months ago

Since the Closing event calls ReadyForQuit() and the Quit command handler calls ReadyForQuit(), ReadyForQuit() gets called twice. I'm not sure which of the many directions I can go in is the correct one. Short answer: backtrack on Closable. Longer answer: on Windows, don't call ReadyForQuit() from the Quit command handler. Longer still answer: detect how we're closing and branch accordingly.

cibikle commented 7 months ago

Went with a variation on the second answer: if (platform is Mac && ReadyForQuit()) || platform is not Mac, quit.