From cd3b4edea06dec659d9676f2649cc1b1be2e8565 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 6 Jun 2022 15:13:07 -0500 Subject: 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. --- video/out/wayland_common.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'video/out') diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 1c8d2097c8..ac975982a7 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -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; -- cgit v1.2.3