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.
This commit is contained in:
Shohei YOSHIDA 2017-08-28 11:56:51 +09:00
parent 87d4666648
commit 55f2b524e7

View file

@ -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();