From 55f2b524e7683e7e7fc331186d949be9ec72362d Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Mon, 28 Aug 2017 11:56:51 +0900 Subject: [PATCH] Close window in order from newer one on macOS A parent window is not closed if a child modal window still exists. So a child window should be closed before parent window closed. --- atom/browser/window_list.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/atom/browser/window_list.cc b/atom/browser/window_list.cc index 374389e0a7..2ab0b24cf5 100644 --- a/atom/browser/window_list.cc +++ b/atom/browser/window_list.cc @@ -81,6 +81,9 @@ void WindowList::RemoveObserver(WindowListObserver* observer) { // static void WindowList::CloseAllWindows() { WindowVector windows = GetInstance()->windows_; +#if defined(OS_MACOSX) + std::reverse(windows.begin(), windows.end()); +#endif for (const auto& window : windows) if (!window->IsClosed()) window->Close();