From 41e6c922a58dd97a5c43855a58c3e879074ffc0f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 26 May 2013 22:03:16 +0200 Subject: macosx_application: fix menu 'ghosting' This fixes a bug that caused the application to never leave it's frontmost position. The idea is stolen from @donmelton who used it in MPlayerShell. Thanks! --- osdep/macosx_application.m | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'osdep/macosx_application.m') diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 77c7779d49..e57b6545b0 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -276,6 +276,13 @@ void init_cocoa_application(void) [NSApp setDelegate:app]; [app initialize_menu]; [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular]; + + atexit_b(^{ + // Because activation policy has just been set to behave like a real + // application, that policy must be reset on exit to prevent, among + // other things, the menubar created here from remaining on screen. + [NSApp setActivationPolicy:NSApplicationActivationPolicyProhibited]; + }); } void terminate_cocoa_application(void) -- cgit v1.2.3