History

wayland: always recalculate scaling if wl->current_output is not set

If we lose the current output for any reason (unplug, turns off, etc.) and then later it comes back, mpv should always recalculate all the scaling stuff. The optimization to avoid needless scaling calculations didn't consider this case and would always exit since the scaling is the same. So just check wl->current_output's existence as well. Fixes #15361.

Dudemanguy committed 1 year ago

Commit c089aaa1 parent 2d813de1 file · +4 −2Browse files

Unified · Split

video/out/wayland_common.c+4−2
@@ -1016,7 +1016,9 @@ static void surface_handle_preferred_buffer_scale(void *data, · 1015 unmodified lines
1016{1016{
1017 struct vo_wayland_state *wl = data;1017 struct vo_wayland_state *wl = data;
1018 1018
1019 if (wl->fractional_scale_manager || wl->scaling == scale * WAYLAND_SCALE_FACTOR)1019 if (wl->fractional_scale_manager ||
1020 (wl->scaling == scale * WAYLAND_SCALE_FACTOR &&
1021 wl->current_output && wl->current_output->has_surface))
1020 return;1022 return;
1021 1023
1022 wl->pending_scaling = scale * WAYLAND_SCALE_FACTOR;1024 wl->pending_scaling = scale * WAYLAND_SCALE_FACTOR;
@@ -1248,7 +1250,7 @@ static void preferred_scale(void *data, · 225 unmodified lines
1248 uint32_t scale)1250 uint32_t scale)
1249{1251{
1250 struct vo_wayland_state *wl = data;1252 struct vo_wayland_state *wl = data;
1251 if (wl->scaling == scale)1253 if (wl->scaling == scale && wl->current_output && wl->current_output->has_surface)
1252 return;1254 return;
1253 1255
1254 wl->pending_scaling = scale;1256 wl->pending_scaling = scale;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t