1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-13 10:26:09 +00:00

cocoa_common: fix problems with alt-tab window changes

Fix alt tabbing to another window in the same workspace. The player
window stayed on top because of a missing call to orderBack:.

Fix alt tabbing to the player window from a different workspace. The
window didn't get activated. Turns out that you must call
makeKeyAndOrderFront: before setLevel: or setPresentationOptions: or
the window will not properly ask for focus.
This commit is contained in:
Stefano Pigozzi 2012-04-22 23:18:55 +02:00 committed by Uoti Urpala
parent 3862d469ae
commit 4251af8d5d

View File

@ -568,18 +568,19 @@ void create_menu()
- (void) applicationWillBecomeActive:(NSNotification *)aNotification
{
if (vo_fs) {
[s->window makeKeyAndOrderFront:s->window];
[s->window setLevel:s->fullscreen_window_level];
[NSApp setPresentationOptions:NSApplicationPresentationHideDock|NSApplicationPresentationHideMenuBar];
[s->window makeKeyAndOrderFront:nil];
[NSApp activateIgnoringOtherApps: YES];
[NSApp setPresentationOptions:NSApplicationPresentationHideDock|
NSApplicationPresentationHideMenuBar];
}
}
- (void) applicationWillResignActive:(NSNotification *)aNotification
{
if (vo_fs) {
[s->window setLevel:s->windowed_window_level];
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
[s->window setLevel:s->windowed_window_level];
[s->window orderBack:s->window];
}
}