]> khamidou — GitHub mirrors - electron.git/commit
mac: Always cancel application termination.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 14 Apr 2014 16:02:33 +0000 (00:02 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 14 Apr 2014 16:13:00 +0000 (00:13 +0800)
commitb994ae8174837b0accc3bc1d4655283eb461ec9a
tree921e6a5e6944ae58a0f5d86fdb9a671f81f526dd
parent6f4aed83f0625a97db19c4257e2aafc5db42348f
mac: Always cancel application termination.

OS X's application termination doesn't work very well with C++ message
loops. Especially when we return NSTerminateLater for shouldTerminate,
it would be impossible for the C++ message loop to quit, because unless
we explictly let NSApp terminate the application, the message loop would
think the application is not terminated and will run forever.

The fix is to simply ignore the Cocoa's application termination request
and let the C++ message loop deal with it compeletey. But we had the
side effect that atom-shell would always cancel OS X's shutdown request,
this is also the approach chosen by Chromium.

Fixes #229.
Fixes atom/atom#1864.
atom/browser/atom_application_delegate_mac.mm
atom/browser/browser.cc
atom/browser/browser.h
atom/browser/browser_linux.cc
atom/browser/browser_mac.mm
atom/browser/browser_win.cc