mirror of https://github.com/mpv-player/mpv
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:
parent
a18b614a4a
commit
7684ebc68b
|
@ -123,8 +123,9 @@ static void egl_create_window(struct ra_ctx *ctx)
|
||||||
struct priv *p = ctx->priv;
|
struct priv *p = ctx->priv;
|
||||||
struct vo_wayland_state *wl = ctx->vo->wl;
|
struct vo_wayland_state *wl = ctx->vo->wl;
|
||||||
|
|
||||||
p->egl_window = wl_egl_window_create(wl->surface, mp_rect_w(wl->geometry),
|
p->egl_window = wl_egl_window_create(wl->surface,
|
||||||
mp_rect_h(wl->geometry));
|
mp_rect_w(wl->geometry) * wl->scaling,
|
||||||
|
mp_rect_h(wl->geometry) * wl->scaling);
|
||||||
|
|
||||||
p->egl_surface = mpegl_create_window_surface(
|
p->egl_surface = mpegl_create_window_surface(
|
||||||
p->egl_display, p->egl_config, p->egl_window);
|
p->egl_display, p->egl_config, p->egl_window);
|
||||||
|
|
Loading…
Reference in New Issue