diff options
author | Dudemanguy <random342@airmail.cc> | 2020-02-12 12:26:24 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-02-13 20:28:59 +0000 |
commit | 83efdb5a01971bb93a4707dfcc1d2af3a48b2a4f (patch) | |
tree | 45d64974aced628a664af6ce58808f5b95076662 /video/out/wayland_common.h | |
parent | cc52a0340195b6062dbe7ec2c90c717d34101996 (diff) | |
download | mpv-83efdb5a01971bb93a4707dfcc1d2af3a48b2a4f.tar.bz2 mpv-83efdb5a01971bb93a4707dfcc1d2af3a48b2a4f.tar.xz |
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.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r-- | video/out/wayland_common.h | 4 |
1 files changed, 3 insertions, 1 deletions
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; |