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 cd3b4edea0 tried to
fix (but was incorrect).
This commit is contained in:
Dudemanguy 2022-06-07 10:37:37 -05:00
parent a18b614a4a
commit 7684ebc68b
1 changed files with 3 additions and 2 deletions

View File

@ -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);