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

@@ -2083,6 +2083,9 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
vc->gfx.kbd = qkbd_state_init(con);
vc->gfx.dcl.con = con;
if (display_opengl) {
qemu_console_set_display_gl_ctx(con, &vc->gfx.dcl);
}
register_displaychangelistener(&vc->gfx.dcl);
gd_connect_vc_gfx_signals(vc);