diff options
author | Dudemanguy911 <random342@airmail.cc> | 2019-10-01 22:09:46 -0500 |
---|---|---|
committer | Dudemanguy911 <random342@airmail.cc> | 2019-10-02 22:43:13 +0000 |
commit | d823b3b39a0a63cc8341e76f434f7a1ac69dd57f (patch) | |
tree | 3d4744e4eebbc6607f19df520d5a7db8ad52ee69 | |
parent | 1c63869d0ae01fd8e720353719e4c8b8da12e0b5 (diff) | |
download | mpv-d823b3b39a0a63cc8341e76f434f7a1ac69dd57f.tar.bz2 mpv-d823b3b39a0a63cc8341e76f434f7a1ac69dd57f.tar.xz |
wayland: always create wl_output before rendering
I previously skipped creating the wl_output if the --fullscreen flag
with no --fsscreen_id was inputted, so the fullscreen video lands on the
correct output (where mpv was launched). This has breakage if someone
combines the --autofit flag (or other similar options with it). Instead,
just actually read xdg_shell spec and realize that you can pass NULL to
xdg_toplevel_set_fullscreen and let the compositor choose the output if
the user doesn't specify it. If this has issues, get a better
compositor.
-rw-r--r-- | video/out/wayland_common.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 7a893e18bb..a70377f3c6 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1213,12 +1213,7 @@ int vo_wayland_reconfig(struct vo *vo) MP_VERBOSE(wl, "Reconfiguring!\n"); - /* Surface enter events happen later but certain config options require the - * current_output to be created in order for the video to actually render. - * Only skip this if --fs is specified without a fsscreen_id so the video - * renders on the same screen and not the one with idx 0. */ - if ((!wl->current_output) && - !(vo->opts->fullscreen && (vo->opts->fsscreen_id < 0))) { + if (!wl->current_output) { int idx = 0; if (vo->opts->fullscreen && (vo->opts->fsscreen_id >= 0)) idx = vo->opts->fsscreen_id; @@ -1255,7 +1250,11 @@ int vo_wayland_reconfig(struct vo *vo) wl->geometry.x1 = mp_rect_w(wl->current_output->geometry)/wl->scaling; wl->geometry.y1 = mp_rect_h(wl->current_output->geometry)/wl->scaling; } else { - xdg_toplevel_set_fullscreen(wl->xdg_toplevel, wl_out); + if (vo->opts->fsscreen_id < 0) { + xdg_toplevel_set_fullscreen(wl->xdg_toplevel, NULL); + } else { + xdg_toplevel_set_fullscreen(wl->xdg_toplevel, wl_out); + } } } |