From 4251af8d5ddfd664edda2f5ec4869f228c2ee7a5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 22 Apr 2012 23:18:55 +0200 Subject: 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. --- libvo/cocoa_common.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m index 5cc29cc78b..c3578d27c1 100644 --- a/libvo/cocoa_common.m +++ b/libvo/cocoa_common.m @@ -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]; } } -- cgit v1.2.3