diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm index 018cf5fc..e15bf0c0 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.mm +++ b/src/SFML/Window/OSX/WindowImplCocoa.mm @@ -107,6 +107,12 @@ WindowImplCocoa::~WindowImplCocoa() [m_delegate release]; + // Put the next window in front, if any. + NSArray* windows = [NSApp orderedWindows]; + if ([windows count] > 0) { + [[windows objectAtIndex:0] makeKeyAndOrderFront:nil]; + } + releasePool(); drainPool(); // Make sure everything was freed