From adc04dbba042a4119a5ec59adf4d839dbf33128f Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Thu, 26 Jan 2023 13:17:39 -0600 Subject: [PATCH] wayland: handle runtime hidpi-window-scale changes correctly Semi-regression although this option never really did what the manual said until recently. In the past, this option also controlled whether or not mpv set the wayland buffer_scale to the value of the wl_output or force it 1. This had varying effects depending on the exact compositor configuration. That logic has now all been removed and this option now only controls whether or not to scale the window with the hidpi scale factor we get from the compositor. i.e. it actually does what the manual says now. --- video/out/wayland_common.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 97e920080f..59ce2e940b 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1698,11 +1698,7 @@ static void set_surface_scaling(struct vo_wayland_state *wl) // dmabuf_wayland is always wl->scaling = 1 bool dmabuf_wayland = !strcmp(wl->vo->driver->name, "dmabuf-wayland"); double old_scale = wl->scaling; - if (wl->vo_opts->hidpi_window_scale && !dmabuf_wayland) { - wl->scaling = wl->current_output->scale; - } else { - wl->scaling = 1; - } + wl->scaling = !dmabuf_wayland ? wl->current_output->scale : 1; rescale_geometry(wl, old_scale); wl_surface_set_buffer_scale(wl->surface, wl->scaling); @@ -1921,7 +1917,7 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) if (opt == &opts->fullscreen) toggle_fullscreen(wl); if (opt == &opts->hidpi_window_scale) - set_surface_scaling(wl); + set_geometry(wl, true); if (opt == &opts->window_maximized) toggle_maximized(wl); if (opt == &opts->window_minimized)