summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-14 00:12:18 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-05-14 00:16:57 +0200
commit647291bab27e8851824aa93414c8ff09ca45c17b (patch)
tree436209dd30569b239fcbba410a50e1d4476f8a80 /video
parent4931085a1ba0017dd848b8086c0d89e7abbe10d7 (diff)
downloadmpv-647291bab27e8851824aa93414c8ff09ca45c17b.tar.bz2
mpv-647291bab27e8851824aa93414c8ff09ca45c17b.tar.xz
cocoa_common: order front window only when invisible [2]
Followup to 8df7127. This refines the condition for front ordering the condition to account for minimized or hidden state where the window should go to the front only as a consequnce of user interaction.
Diffstat (limited to 'video')
-rw-r--r--video/out/cocoa_common.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m
index 0d85daec60..894c6eed22 100644
--- a/video/out/cocoa_common.m
+++ b/video/out/cocoa_common.m
@@ -168,6 +168,7 @@ struct vo_cocoa_state {
int display_cursor;
int cursor_timer;
int vo_cursor_autohide_delay;
+ int last_hidden_config;
bool did_resize;
bool did_async_resize;
@@ -200,6 +201,7 @@ static struct vo_cocoa_state *vo_cocoa_init_state(struct vo *vo)
.out_fs_resize = NO,
.display_cursor = 1,
.vo_cursor_autohide_delay = vo->opts->cursor_autohide_delay,
+ .last_hidden_config = -1,
.power_mgmt_assertion = kIOPMNullAssertionID,
.accumulated_scroll = 0,
.lock = [[NSLock alloc] init],
@@ -529,7 +531,9 @@ int vo_cocoa_config_window(struct vo *vo, uint32_t d_width,
if (flags & VOFLAG_HIDDEN) {
[s->window orderOut:nil];
- } else if (![s->window isVisible]) {
+ s->last_hidden_config = vo->config_count;
+ } else if (![s->window isVisible] &&
+ s->last_hidden_config == vo->config_count) {
[s->window makeKeyAndOrderFront:nil];
[NSApp activateIgnoringOtherApps:YES];
}