From 2f986a598039b23862eaa870076c0c8fc2e9f86a Mon Sep 17 00:00:00 2001 From: Rostislav Pehlivanov Date: Fri, 29 Jul 2016 23:02:32 +0100 Subject: 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. --- video/out/wayland_common.c | 3 +++ 1 file changed, 3 insertions(+) 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); } -- cgit v1.2.3