mirror of
https://github.com/mpv-player/mpv
synced 2025-03-11 08:37:59 +00:00
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.
This commit is contained in:
parent
ede608ed43
commit
3f594c2e84
@ -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;
|
||||
|
@ -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
|
||||
|
@ -629,6 +629,13 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
|
||||
mp_input_put_axis(self.vout->input_ctx, mpkey, delta);
|
||||
}
|
||||
|
||||
- (void)putCommand:(char*)cmd
|
||||
{
|
||||
mp_cmd_t *cmdt = mp_input_parse_cmd(self.vout->input_ctx, bstr0(cmd), "");
|
||||
mp_input_queue_cmd(self.vout->input_ctx, cmdt);
|
||||
ta_free(cmd);
|
||||
}
|
||||
|
||||
- (void)performAsyncResize:(NSSize)size {
|
||||
vo_cocoa_resize_redraw(self.vout, size.width, size.height);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user