ui: associate GL context outside of display listener registration

Consoles can have an associated GL context, without listeners (they may
be added or removed later on).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Marc-André Lureau 2021-01-25 15:10:36 +04:00
parent 4f41814991
commit ac32b2fff1
5 changed files with 15 additions and 2 deletions

View file

@ -1465,8 +1465,11 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
assert(!dcl->ds);
if (dcl->ops->dpy_gl_ctx_create) {
qemu_console_set_display_gl_ctx(dcl->con, dcl);
if (dcl->con && dcl->con->gl &&
dcl->con->gl != dcl) {
error_report("Display %s is incompatible with the GL context",
dcl->ops->dpy_name);
exit(1);
}
if (dcl->con) {