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.
This commit is contained in:
Dudemanguy 2020-02-12 19:20:03 -06:00
parent 5bf433b16f
commit 374c6aff7b
1 changed files with 7 additions and 5 deletions

View File

@ -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");
@ -1283,19 +1281,23 @@ int vo_wayland_reconfig(struct vo *vo)
if (wl->vo_opts->fullscreen && (wl->vo_opts->fsscreen_id >= 0))
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);
}
}