summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2024-02-24 18:39:22 -0600
committerDudemanguy <random342@airmail.cc>2024-02-27 22:18:12 +0000
commit7b03a2ff17d0be9673eac718fef65daac0c63b38 (patch)
treef6711aa716fdd36028ed8a8971d9cf6898b4109e /video/out/wayland_common.c
parent505a08a37fc30fb1b2d06ecacb358927dd9ad8cf (diff)
downloadmpv-7b03a2ff17d0be9673eac718fef65daac0c63b38.tar.bz2
mpv-7b03a2ff17d0be9673eac718fef65daac0c63b38.tar.xz
wayland: fix check for set_surface_scaling
We don't want to use this if we have fractional scaling or version 6 of the wl_surface interface which has a preferred buffer scale event which is superior to this. We were checking in the important place (surface entrance events) but not technically in the output. So just move the conditional to set_surface_scaling itself. Also through the VO_EVENT_DPI in there for convenience.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index e6b38f868b..82eb5c9fa3 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -873,7 +873,6 @@ static void output_handle_done(void *data, struct wl_output *wl_output)
spawn_cursor(wl);
set_geometry(wl, false);
prepare_resize(wl, 0, 0);
- wl->pending_vo_events |= VO_EVENT_DPI;
}
wl->pending_vo_events |= VO_EVENT_WIN_STATE;
@@ -933,13 +932,10 @@ static void surface_handle_enter(void *data, struct wl_surface *wl_surface,
wl->current_output->has_surface = true;
bool force_resize = false;
- if (!wl->fractional_scale_manager && wl_surface_get_version(wl_surface) < 6 &&
- wl->scaling != wl->current_output->scale)
- {
+ if (wl->scaling != wl->current_output->scale) {
set_surface_scaling(wl);
spawn_cursor(wl);
force_resize = true;
- wl->pending_vo_events |= VO_EVENT_DPI;
}
if (!mp_rect_equals(&old_output_geometry, &wl->current_output->geometry)) {
@@ -2061,12 +2057,13 @@ static int set_screensaver_inhibitor(struct vo_wayland_state *wl, int state)
static void set_surface_scaling(struct vo_wayland_state *wl)
{
- if (wl->fractional_scale_manager)
+ if (wl->fractional_scale_manager || wl_surface_get_version(wl->surface) >= 6)
return;
double old_scale = wl->scaling;
wl->scaling = wl->current_output->scale;
rescale_geometry(wl, old_scale);
+ wl->pending_vo_events |= VO_EVENT_DPI;
}
static void set_window_bounds(struct vo_wayland_state *wl)