mozilla / positron

a experimental, Electron-compatible runtime on top of Gecko
Other
569 stars 64 forks source link

"hello world" app doesn't quit when I close its window #29

Closed mykmelez closed 8 years ago

mykmelez commented 8 years ago

When I close the BrowserWindow in the "hello world" app, the devtools window also closes, but the app doesn't quit. On Mac, that's expected, because the main script leaves the app running on Mac after all windows have closed; but I see this on Linux too (Ubuntu 14.04).

disquisitioner commented 8 years ago

Happens on Windows too, BTW.

mykmelez commented 8 years ago

@jryans I think this is a regression from integrating DevTools.

jryans commented 8 years ago

Hmm, what about the call to Services.startup.enterLastWindowClosingSurvivalArea();? Wouldn't that trigger this behavior on all OSes @mykmelez?

mykmelez commented 8 years ago

Hmm, what about the call to Services.startup.enterLastWindowClosingSurvivalArea();? Wouldn't that trigger this behavior on all OSes @mykmelez?

That prevents Gecko from quitting the app, but the app itself should still do it on window-all-closed:

https://github.com/mozilla/positron/blob/master/positron/test/hello-world/main.js#L11-L18

mykmelez commented 8 years ago

This comment could be relevant:

https://github.com/mozilla/positron/blob/709d3de2c721c3773505dd2b67b7da2dd9fdf661/positron/modules/atom_browser_window.js#L74-L76

jryans commented 8 years ago

I'll take a look at this.

jryans commented 8 years ago

Hmm, I commented out the OS check in main.js to try on OS X. In that case, the app does quit after closing the app window.

I'll try setting up my VM for builds on other OSes.

jryans commented 8 years ago

Hmm, looking at the timing of events, on Mac we get domwindowclosed for DevTools first, then the app window. On Linux, the app window event comes first, quit is called, then DevTools window closes after. So, it seems the quit call is getting aborted somehow. I'll look more tomorrow.