mirror of
https://github.com/mpv-player/mpv
synced 2024-12-24 15:52:25 +00:00
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!
This commit is contained in:
parent
953b0eca3b
commit
41e6c922a5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user