summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-06-07 10:37:37 -0500
committerDudemanguy <random342@airmail.cc>2022-06-07 17:13:45 +0000
commit7684ebc68b222899254c00fc10c2207d0b3975b1 (patch)
treeb0b9583829656ae191cd3ce0456a78d1105acadb /video/out
parenta18b614a4ae4b8fa811c9ea44b5de12c80ce2365 (diff)
downloadmpv-7684ebc68b222899254c00fc10c2207d0b3975b1.tar.bz2
mpv-7684ebc68b222899254c00fc10c2207d0b3975b1.tar.xz
wayland_gl: use wl->scaling when creating egl_window
This was actually always bugged, but we just got lucky that compositors ignored it. The egl window was created only using wl->geometry's coordinates but those do not include the scale factor. So technically, the initial window creation always had the wrong size (off by whatever the scaling factor is). The resize call later fixes it because that correctly uses wl->scaling so in practice nothing bad was seen. wlroots's master branch has started sending an error in this case however and this is what trips it. Fix it correctly by using the scale factor. This is what cd3b4edea06dec659d9676f2649cc1b1be2e8565 tried to fix (but was incorrect).
Diffstat (limited to 'video/out')
-rw-r--r--video/out/opengl/context_wayland.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c
index 98d702c386..bf9d90d0e3 100644
--- a/video/out/opengl/context_wayland.c
+++ b/video/out/opengl/context_wayland.c
@@ -123,8 +123,9 @@ static void egl_create_window(struct ra_ctx *ctx)
struct priv *p = ctx->priv;
struct vo_wayland_state *wl = ctx->vo->wl;
- p->egl_window = wl_egl_window_create(wl->surface, mp_rect_w(wl->geometry),
- mp_rect_h(wl->geometry));
+ p->egl_window = wl_egl_window_create(wl->surface,
+ mp_rect_w(wl->geometry) * wl->scaling,
+ mp_rect_h(wl->geometry) * wl->scaling);
p->egl_surface = mpegl_create_window_surface(
p->egl_display, p->egl_config, p->egl_window);