diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-22 08:43:02 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-11-22 08:43:02 +0100 |
commit | 3f594c2e848f21329c0548e27544ef3827e06a56 (patch) | |
tree | 5d07f14ba2b45afad4246fbb5e2d60474be1cfbc /video/out/cocoa | |
parent | ede608ed4365eb43d8630b9a9a9b6c642af279ce (diff) | |
download | mpv-3f594c2e848f21329c0548e27544ef3827e06a56.tar.bz2 mpv-3f594c2e848f21329c0548e27544ef3827e06a56.tar.xz |
cocoa: use window-scale to support video scaling functionality
In the cocoa backend you can use cmd+0/1/2 to scale the window. This commit
makes it use the new window-scale functionality.
Diffstat (limited to 'video/out/cocoa')
-rw-r--r-- | video/out/cocoa/mpvadapter.h | 1 | ||||
-rw-r--r-- | video/out/cocoa/window.m | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/video/out/cocoa/mpvadapter.h b/video/out/cocoa/mpvadapter.h index eafeefce9f..b1a13d5ace 100644 --- a/video/out/cocoa/mpvadapter.h +++ b/video/out/cocoa/mpvadapter.h @@ -23,6 +23,7 @@ - (void)signalMouseMovement:(NSPoint)point; - (void)putKey:(int)mpkey withModifiers:(int)modifiers; - (void)putAxis:(int)mpkey delta:(float)delta; +- (void)putCommand:(char*)cmd; - (void)performAsyncResize:(NSSize)size; - (BOOL)isInFullScreenMode; diff --git a/video/out/cocoa/window.m b/video/out/cocoa/window.m index 97f5af1dd9..b259af134e 100644 --- a/video/out/cocoa/window.m +++ b/video/out/cocoa/window.m @@ -97,12 +97,8 @@ - (void)mulSize:(float)multiplier { - if (![self.adapter isInFullScreenMode]) { - NSSize size = [self.adapter videoSize]; - size.width *= multiplier; - size.height *= multiplier; - [self setCenteredContentSize:size]; - } + char *cmd = ta_asprintf(NULL, "set window-scale %f", multiplier); + [self.adapter putCommand:cmd]; } - (int)titleHeight |