diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-01 18:05:30 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-01 18:05:30 +0100 |
commit | 586c9e71554914daf7f60c4610c4ef4e85c274eb (patch) | |
tree | 6a3ff2b90f1a970e0e37d50b2222b3c8588e3201 | |
parent | 1c0920a8dd73105874a6aadcd35bec5814123709 (diff) |
cocoa: allow to black out other display when going fs
fixes #1302
-rw-r--r-- | DOCS/man/options.rst | 4 | ||||
-rw-r--r-- | options/options.c | 1 | ||||
-rw-r--r-- | options/options.h | 1 | ||||
-rw-r--r-- | video/out/cocoa/events_view.m | 2 | ||||
-rw-r--r-- | video/out/cocoa/mpvadapter.h | 1 | ||||
-rw-r--r-- | video/out/cocoa_common.m | 5 |
6 files changed, 13 insertions, 1 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index f3665df971..ad5babb1f4 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -1478,6 +1478,10 @@ Window See also ``--screen``. +``--fs-black-out-screens`` + + OS X only. Black out other displays when going fullscreen. + ``--keep-open`` Do not terminate when playing or seeking beyond the end of the file, and there is not next file to be played (and ``--loop`` is not used). diff --git a/options/options.c b/options/options.c index 3327b206e1..57cf20afa8 100644 --- a/options/options.c +++ b/options/options.c @@ -455,6 +455,7 @@ const m_option_t mp_opts[] = { OPT_CHOICE_OR_INT("fs-screen", vo.fsscreen_id, 0, 0, 32, ({"all", -2}, {"current", -1})), + OPT_FLAG("fs-black-out-screens", vo.fs_black_out_screens, 0), OPT_INTRANGE("brightness", gamma_brightness, 0, -100, 100), OPT_INTRANGE("saturation", gamma_saturation, 0, -100, 100), OPT_INTRANGE("contrast", gamma_contrast, 0, -100, 100), diff --git a/options/options.h b/options/options.h index dadcb0800a..c73764ceba 100644 --- a/options/options.h +++ b/options/options.h @@ -12,6 +12,7 @@ typedef struct mp_vo_opts { int fullscreen; int screen_id; int fsscreen_id; + int fs_black_out_screens; char *winname; int x11_netwm; int native_keyrepeat; diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m index c3e626b0fe..8e96ac1244 100644 --- a/video/out/cocoa/events_view.m +++ b/video/out/cocoa/events_view.m @@ -67,7 +67,7 @@ popts |= NSApplicationPresentationAutoHideDock; NSDictionary *fsopts = @{ - NSFullScreenModeAllScreens : @NO, + NSFullScreenModeAllScreens : @([self.adapter fsModeAllScreens]), NSFullScreenModeApplicationPresentationOptions : @(popts) }; diff --git a/video/out/cocoa/mpvadapter.h b/video/out/cocoa/mpvadapter.h index 8829abd096..f54c26593f 100644 --- a/video/out/cocoa/mpvadapter.h +++ b/video/out/cocoa/mpvadapter.h @@ -33,5 +33,6 @@ - (BOOL)keyboardEnabled; - (BOOL)mouseEnabled; - (NSScreen *)fsScreen; +- (BOOL)fsModeAllScreens; @property(nonatomic, assign) struct vo *vout; @end diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 4ac6433f84..83c006d86f 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -795,6 +795,11 @@ void *vo_cocoa_cgl_pixel_format(struct vo *vo) return s->fs_screen; } +- (BOOL)fsModeAllScreens +{ + return self.vout->opts->fs_black_out_screens; +} + - (void)handleFilesArray:(NSArray *)files { [[EventsResponder sharedInstance] handleFilesArray:files]; |