diff options
author | Dudemanguy <random342@airmail.cc> | 2021-08-02 16:49:48 -0500 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-08-03 14:53:27 +0000 |
commit | 24357cb7b5a1a8ca4407c2e6d9316f07a7a5ef0d (patch) | |
tree | 521fbda73c54f995ecbbe04e4760f00aa5a80276 /video/out/wayland_common.h | |
parent | dd7a49eb71a65c488770458cbac3bc48cfee6b80 (diff) | |
download | mpv-24357cb7b5a1a8ca4407c2e6d9316f07a7a5ef0d.tar.bz2 mpv-24357cb7b5a1a8ca4407c2e6d9316f07a7a5ef0d.tar.xz |
wayland: cleanup handle_toplevel_config
The source of many geometry woes. There's some loosely related toplevel
things that should be cleaned up/fixed. First of all,
VO_EVENT_LIVE_RESIZING is actually completely useless. It might have
been useful sometime in the past, but there's no point. It doesn't
"speed up" resizing in any way and appears to be originally for cocoa.
Just remove it.
Way back in the day, toplevel_width/height was added as a workaround for
when we got uncoorperative (i.e. wrong) width/height coordinates from
the compositor in this event. Basically it could happen due to numerous
reasons but a lack of atomic commits was part of the reason and also
mpv's geometry handling then was a lot rougher. We *shouldn't* need this
workaround anymore. The width/height values are only used exactly when
we need them. If mpv sets geometry on its own, it should still be the
right dimensions.
Related to the above, mpv never actually propertly handled the case
where width or height was equal to 0. According to the xdg-shell spec,
"If the width or height arguments are zero, it means the client should
decided its own window dimension." An example of a compositor doing this
is weston. It's, unsurprisingly, broken. Getting out of fullscreen or a
maximized state does not restore the old window size like it should. The
right way to handle this is to just return near the end of the function
if we have a 0 for either argument and before any geometry is set
(wl->geometry's width or height can never be zero). Luckily, state
changes are already being detected so they just trigger the goto when
needed.
Finally, e2c24ad mistakenly removed the VO_EVENT_EXPOSE. There are edge
cases where this is needed and it's safer to just force a redraw here
when the window gets activated again. Just force wl->hidden to false
first and then trigger the expose.
Diffstat (limited to 'video/out/wayland_common.h')
-rw-r--r-- | video/out/wayland_common.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h index b77bab462b..23dfd81294 100644 --- a/video/out/wayland_common.h +++ b/video/out/wayland_common.h @@ -50,8 +50,6 @@ struct vo_wayland_state { int gcd; int reduced_height; int reduced_width; - int toplevel_width; - int toplevel_height; /* State */ bool activated; |