SFML community forums

Help => Window => Topic started by: Acrobat on January 13, 2013, 01:50:16 pm

Title: Closing window via Dock do not send closing Event (MacOnly)
Post by: Acrobat on January 13, 2013, 01:50:16 pm
MacOS only
Then you close your window with right click on application in doc - Quit, there is no event sf::Event::Closed generated, so you can't correctly save your game, and release resources.

Solution is to set application delegete, and override
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
to return  NSTerminateCancel and add close event to queue.

Discuss.
Title: Re: Closing window via Dock do not send closing Event (MacOnly)
Post by: Acrobat on January 13, 2013, 01:52:42 pm
more info : http://developer.apple.com/library/Mac/#documentation/Cocoa/Reference/NSApplicationDelegate_Protocol/Reference/Reference.html
Title: Re: Closing window via Dock do not send closing Event (MacOnly)
Post by: Hiura on January 14, 2013, 01:27:38 pm
Ok, now I understand what you meant in your MP.  :)

I've added this task under https://github.com/SFML/SFML/issues/11