From 7684ebc68b222899254c00fc10c2207d0b3975b1 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 7 Jun 2022 10:37:37 -0500 Subject: 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). --- video/out/opengl/context_wayland.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'video/out') 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); -- cgit v1.2.3