mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 01:52:19 +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:
parent
27b59e1940
commit
2f986a5980
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user