Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Closing window via Dock do not send closing Event (MacOnly)  (Read 1830 times)

0 Members and 1 Guest are viewing this topic.

Acrobat

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Closing window via Dock do not send closing Event (MacOnly)
« 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.
« Last Edit: January 13, 2013, 01:57:27 pm by Acrobat »


Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Closing window via Dock do not send closing Event (MacOnly)
« Reply #2 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
SFML / OS X developer

 

anything