holochain / launcher

Desktop launcher to install and use Holochain apps locally (Electron version)
58 stars 2 forks source link

fix window open behavior on Windows, add frame on Linux #178

Closed matthme closed 1 month ago

matthme commented 1 month ago

This PR addresses https://github.com/holochain/launcher/issues/170

The problem was that by re-adding the window frame on Windows, the window could be closed for good (i.e. not just hidden) and then when trying to re-open it via the systray, the corresponding BrowserWindow object would not exist anymore.

This PR solves that problem in that it intercepts the 'close' event of the main window and only actually closes it if either launcher has not fully launched yet (e.g. still on the password screen), in which case it will also close the settings window to get the 'window-all-closed' event triggered and quit the app fully, or the app is quitting. Otherwise, the window will only be hidden instead of closed.