1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 10:32:15 +00:00

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.
This commit is contained in:
Rostislav Pehlivanov 2016-07-29 23:02:32 +01:00 committed by wm4
parent 27b59e1940
commit 2f986a5980

View File

@ -141,6 +141,9 @@ static void ssurface_handle_configure(void *data,
int32_t height) int32_t height)
{ {
struct vo_wayland_state *wl = data; 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); schedule_resize(wl, edges, width, height);
} }