mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 01:47:38 +00:00
opengl/context_wayland: Fix crash on configure before initial reconfig
If the compositor sends a configure event before the surface is initially mapped, resize gets called before the egl_window gets created, resulting in a crash in wl_egl_window_resize. This was fixed back in618361c697
, but was reintroduced when the wayland code was rewritten in68f9ee7e0b
.
This commit is contained in:
parent
e2976e662d
commit
13e14d95e1
@ -45,7 +45,9 @@ static void resize(struct ra_ctx *ctx)
|
||||
const int32_t height = wl->scaling*mp_rect_h(wl->geometry);
|
||||
|
||||
wl_surface_set_buffer_scale(wl->surface, wl->scaling);
|
||||
wl_egl_window_resize(p->egl_window, width, height, 0, 0);
|
||||
|
||||
if (p->egl_window)
|
||||
wl_egl_window_resize(p->egl_window, width, height, 0, 0);
|
||||
|
||||
wl->vo->dwidth = width;
|
||||
wl->vo->dheight = height;
|
||||
|
Loading…
Reference in New Issue
Block a user