summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2020-02-12 19:20:03 -0600
committerDudemanguy <random342@airmail.cc>2020-02-13 16:01:59 +0000
commit374c6aff7b1a005d78f31d00fc12e714976fb7bb (patch)
tree27b35ee3d6a61a9f56a183e4e299dd9a6c6fa0f5 /video/out/wayland_common.c
parent5bf433b16f35234a04b8350634c471912fa80343 (diff)
downloadmpv-374c6aff7b1a005d78f31d00fc12e714976fb7bb.tar.bz2
mpv-374c6aff7b1a005d78f31d00fc12e714976fb7bb.tar.xz
wayland: fix autofit and rotating issues
Fixes #7441. Just set screenrc to be equal to current_output's geometry. Also remove some pointless/extra variables and print a warning/fallback to screen 0 if a bad id is passed to --fs-screen.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index d42758a7bc..fc165ea7ce 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -1272,8 +1272,6 @@ static struct vo_wayland_output *find_output(struct vo_wayland_state *wl, int in
int vo_wayland_reconfig(struct vo *vo)
{
- struct wl_output *wl_out = NULL;
- struct mp_rect screenrc = { 0 };
struct vo_wayland_state *wl = vo->wl;
MP_VERBOSE(wl, "Reconfiguring!\n");
@@ -1284,18 +1282,22 @@ int vo_wayland_reconfig(struct vo *vo)
idx = wl->vo_opts->fsscreen_id;
struct vo_wayland_output *out = find_output(wl, idx);
if (!out) {
+ MP_WARN(wl, "Screen index %i not found/unavailable! Falling back to screen 0!\n", idx);
+ out = find_output(wl, 0);
+ }
+ if (!out) {
MP_ERR(wl, "Screen index %i not found/unavailable!\n", idx);
+ return false;
} else {
- wl_out = out->output;
wl->current_output = out;
if (!wl->vo_opts->hidpi_window_scale)
out->scale = 1;
wl->scaling = out->scale;
- screenrc = wl->current_output->geometry;
}
}
struct vo_win_geometry geo;
+ struct mp_rect screenrc = wl->current_output->geometry;
vo_calc_window_geometry(vo, &screenrc, &geo);
vo_apply_window_geometry(vo, &geo);
@@ -1320,7 +1322,7 @@ int vo_wayland_reconfig(struct vo *vo)
if (wl->vo_opts->fsscreen_id < 0) {
xdg_toplevel_set_fullscreen(wl->xdg_toplevel, NULL);
} else {
- xdg_toplevel_set_fullscreen(wl->xdg_toplevel, wl_out);
+ xdg_toplevel_set_fullscreen(wl->xdg_toplevel, wl->current_output->output);
}
}