diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2016-07-29 23:02:32 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-30 15:32:57 +0200 |
commit | 2f986a598039b23862eaa870076c0c8fc2e9f86a (patch) | |
tree | 60f919011b9d4a97189517dbcfecf578ea230319 /video/out | |
parent | 27b59e19407d3c8b6e99dc49a3fe29a2c5e8233c (diff) | |
download | mpv-2f986a598039b23862eaa870076c0c8fc2e9f86a.tar.bz2 mpv-2f986a598039b23862eaa870076c0c8fc2e9f86a.tar.xz |
wayland_common: prevent black bars on most non-native aspect ratios
ssurface_handle_configure()'s width and height are just hints given by
the compositor, the application's free to not respect those strictly and
to compensate for e.g. aspect ratio.
This prevents crazy scenarios in which pictures with portrait aspect
ratios have a huge black area to make them 16:9 or whatever the
compositor feels like.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/wayland_common.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index e04acc13ff..76cc387cf7 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -141,6 +141,9 @@ static void ssurface_handle_configure(void *data, int32_t height) { struct vo_wayland_state *wl = data; + float win_aspect = wl->window.aspect; + if (!wl->window.is_fullscreen) + width = win_aspect * height; schedule_resize(wl, edges, width, height); } |