handler close event on mac
support enable and disable menubar on mac