summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-01-26 13:17:39 -0600
committerDudemanguy <random342@airmail.cc>2023-01-30 03:59:40 +0000
commitadc04dbba042a4119a5ec59adf4d839dbf33128f (patch)
treedabf7e6f00c0a05bdacdb09ab170b353981f2328 /video/out
parente6a42f7afce21b55dae6a387d8b56e7e0af8b20d (diff)
downloadmpv-adc04dbba042a4119a5ec59adf4d839dbf33128f.tar.bz2
mpv-adc04dbba042a4119a5ec59adf4d839dbf33128f.tar.xz
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.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/wayland_common.c8
1 files 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)