diff options
author | Dudemanguy <random342@airmail.cc> | 2020-08-18 12:55:01 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-08-20 01:34:45 +0000 |
commit | db0f9fab67af4776ec82dd491413fe642fb2670a (patch) | |
tree | ac02168707ae8df43d7372df93142ed08ff85543 /video/out/wayland_common.h | |
parent | ffa9aaa2e458dcac3658a16c4d1fb14755de0ebd (diff) | |
download | mpv-db0f9fab67af4776ec82dd491413fe642fb2670a.tar.bz2 mpv-db0f9fab67af4776ec82dd491413fe642fb2670a.tar.xz |
wayland: refactor geometry/window handling
The original goal was to simplify all this logic to make it less fragile
and breaky. Unfortunately, that didn't exactly happen and things might
actually be more complicated in some ways (well in other ways it's
simplier). There's a lot of negotiation back and forth between the
client and the compositor regarding sizes. The client (aka mpv) can do a
resize on its own. But also the compositor can request its own resize
(which we should be nice and listen to of course). The older method had
a lot of breakfalls/edgecases that were gradually patched up as time
went on, but that approach is really fragile. This refactor should,
hopefully, be on a more solid foundation.
Don't call any of the xdg toplevel state changing functions
(fullscreen, maximized, etc.) directly. Use the toggle wrapper
functions. These signal that the state was changed which is later
handled in the toplevel listener.
Introduce a new vdparams variable that stores the actual dimensions of
the video. This does create some new (but neccesary) complexity.
wl->vdparams stores what the actual dimensions of the video are
(according to mpv). wl->window_size stores the last size of the window
(so it includes any manual resizes for instance). wl->geometry is the
actual size of the output that gets displayed on the screen.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r-- | video/out/wayland_common.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index 895db3393d..7748627b29 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -70,12 +70,13 @@ struct vo_wayland_state { /* State */ struct mp_rect geometry; struct mp_rect window_size; + struct mp_rect vdparams; int gcd; int reduced_width; int reduced_height; - bool configured; bool frame_wait; - bool state_changed; + bool state_change; + bool toplevel_configured; int wakeup_pipe[2]; int pending_vo_events; int mouse_x; |