summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-29 23:02:32 +0100
committerwm4 <wm4@nowhere>2016-07-30 15:32:57 +0200
commit2f986a598039b23862eaa870076c0c8fc2e9f86a (patch)
tree60f919011b9d4a97189517dbcfecf578ea230319 /video/out/wayland_common.c
parent27b59e19407d3c8b6e99dc49a3fe29a2c5e8233c (diff)
downloadmpv-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/wayland_common.c')
-rw-r--r--video/out/wayland_common.c3
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);
}