wayland: remove some unneeded lines from reconfig

Just a couple of small changes. First, the obvious one is to remove the
bogus wl->window_size = wl->vdparams; line in the configure conditional.
The reconfig always unconditionally sets the window_size here so there's
no need to duplicate it. The more important change is to remove the
usage of set_surface_scaling. This function is just to handle when
scaling changes and for setting the initial scale, it was called in the
reconfig. This, however, causes some weird issues in the latest
sway/wlroots where it can try to divide a buffer by an inappropriate
scale factor. This is possibly due to some weird ordering of events and
only occured in opengl for some reason.

Luckily, it turns it out it's not neccessary to set the scaling here at
all. The surface enter event is already setup to handle scale changes.
On an HIDPI display, mpv will initially assume a scale of 1 but the
surface actually enters the wl_output, it will automatically readjust
and resize itself to the appropriate scale value. This works on the
initial launch of the mpv window as well, so there's no need to special
case this in the reconfig event. This has the nice bonus of avoiding
that sway/wlroots issue as well since the buffer_scale is set much
later. Fixes #10263.
This commit is contained in:
Dudemanguy 2022-06-06 15:13:07 -05:00
parent 969bdf5f41
commit cd3b4edea0
1 changed files with 0 additions and 2 deletions

View File

@ -1924,7 +1924,6 @@ int vo_wayland_reconfig(struct vo *vo)
wl->current_output = find_output(wl);
if (!wl->current_output)
return false;
set_surface_scaling(wl);
wl_surface_commit(wl->surface);
configure = true;
}
@ -1946,7 +1945,6 @@ int vo_wayland_reconfig(struct vo *vo)
do_minimize(wl);
if (configure) {
wl->window_size = wl->vdparams;
wl->geometry = wl->window_size;
wl_display_roundtrip(wl->display);
wl->pending_vo_events |= VO_EVENT_DPI;