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
10161016 {
10171017 struct vo_wayland_state *wl = data;
10181018
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))
10201022 return;
10211023
10221024 wl->pending_scaling = scale * WAYLAND_SCALE_FACTOR;
@@ -1248,7 +1250,7 @@ static void preferred_scale(void *data, · 225 unmodified lines
12481250 uint32_t scale)
12491251 {
12501252 struct vo_wayland_state *wl = data;
1251− if (wl->scaling == scale)
1253+ if (wl->scaling == scale && wl->current_output && wl->current_output->has_surface)
12521254 return;
12531255
12541256 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