diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2012-04-22 23:18:55 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2012-04-26 21:03:10 +0300 |
commit | 4251af8d5ddfd664edda2f5ec4869f228c2ee7a5 (patch) | |
tree | f43747699f8f41454846db49e2bc443fd8236862 /libvo/cocoa_common.m | |
parent | 3862d469ae7f22d10f1d51d7056c75782fec2283 (diff) | |
download | mpv-4251af8d5ddfd664edda2f5ec4869f228c2ee7a5.tar.bz2 mpv-4251af8d5ddfd664edda2f5ec4869f228c2ee7a5.tar.xz |
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.
Diffstat (limited to 'libvo/cocoa_common.m')
-rw-r--r-- | libvo/cocoa_common.m | 9 |
1 files 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]; } } |