Call OnUnload when closing a window
Mac: Don’t trigger Closing/Closed events when hiding the main form