From 83efdb5a01971bb93a4707dfcc1d2af3a48b2a4f Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 12 Feb 2020 12:26:24 -0600 Subject: wayland: make resizing better Resizing the window while preserving the aspect ratio actually kind of sucked. The window size could make big dramatic changes which was pretty unintuitive with respect to where the mouse was actually located. Instead, let's just do some math to ensure that the window size is always contained inside the width/height reported by handle_toplevel_config while preserving the aspect ratio. Fixes #7426. --- video/out/wayland_common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video/out/wayland_common.h') diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index 86ead415f9..0c27472e3f 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -70,7 +70,9 @@ struct vo_wayland_state { /* State */ struct mp_rect geometry; struct mp_rect window_size; - float aspect_ratio; + int gcd; + int reduced_width; + int reduced_height; bool configured; bool frame_wait; bool hidden; -- cgit v1.2.3