mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 04:41:05 +08:00
Fix zombie windows in Mac OS when switching to/from fullscreen
This commit is contained in:
parent
7ff34cdc86
commit
86617c0550
@ -57,6 +57,18 @@
|
||||
////////////////////////////////////////////////////////////
|
||||
-(BOOL)canBecomeKeyWindow;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Allow fullscreen windows to become the main window
|
||||
///
|
||||
/// By default, fullscreen windows (using NSBorderlessWindowMask)
|
||||
/// cannot become the main window, so this method is changed to
|
||||
/// always return YES.
|
||||
///
|
||||
/// \return YES
|
||||
///
|
||||
////////////////////////////////////////////////////////////
|
||||
-(BOOL)canBecomeMainWindow;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// \brief Prevent system alert
|
||||
///
|
||||
|
@ -45,6 +45,13 @@
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(BOOL)canBecomeMainWindow
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
-(void)keyDown:(NSEvent*)theEvent
|
||||
{
|
||||
|
@ -154,7 +154,11 @@ WindowImplCocoa::~WindowImplCocoa()
|
||||
// Put the next window in front, if any.
|
||||
NSArray* windows = [NSApp orderedWindows];
|
||||
if ([windows count] > 0)
|
||||
[[windows objectAtIndex:0] makeKeyAndOrderFront:nil];
|
||||
{
|
||||
NSWindow *nextWindow = [windows objectAtIndex:0];
|
||||
if ([nextWindow isVisible])
|
||||
[nextWindow makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
drainThreadPool(); // Make sure everything was freed
|
||||
// This solve some issue when sf::Window::Create is called for the
|
||||
|
Loading…
Reference in New Issue
Block a user