Form doesn't close when closing application and form does not have focus (Cocoa)
- Lazarus/FPC Version: Lazarus 2.3.0 (rev main-2_3-2069-g4aa7b5b3) FPC 3.2.2 x86_64-darwin-cocoa
- Operating System: macOS Monterey 12.6
- CPU / Bitness: Intel 64 bit
Note:
Seen this in several Lazarus versions, several different macOS versions, several FPC versions, on both Intel and Apple Silicon.
What happens
When closing an application, the form and application do not close until they have focus.
What did you expect
Form and application to close right away.
Applications developed with other tools (eg. XCode etc), and Windows and Linux applications, close right away.
Only macOS applications build with lazarus have this form dangling effect, until the form gets focus again.
Temporary work around
Add "Self.Show;" to the "FormClose" event.
See this Lazarus forum thread.
Steps to reproduce
- Create a new blank application in Lazarus.
- Run it (I ran it without debugger).
- Now bring another application to the front (focus).
- In the dock, right click the newly created Lazarus application icon and select "Quit".
- Nothing happens.
- Move the mouse over the form, nothing happens.
- Click the form: the form and application now terminate.