From d823b3b39a0a63cc8341e76f434f7a1ac69dd57f Mon Sep 17 00:00:00 2001 From: Dudemanguy911 Date: Tue, 1 Oct 2019 22:09:46 -0500 Subject: [PATCH] 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. --- video/out/wayland_common.c | 13 ++++++------- 1 file 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); + } } }