@@ -214,6 +214,8 @@ void gd_egl_scanout_disable(DisplayChangeListener *dcl)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
+ vc->gfx.esurface, vc->gfx.ectx);
vc->gfx.w = 0;
vc->gfx.h = 0;
gtk_egl_set_scanout_mode(vc, false);
@@ -275,6 +275,7 @@ void gd_gl_area_scanout_disable(DisplayChangeListener *dcl)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
gtk_gl_area_set_scanout_mode(vc, false);
}
@@ -283,6 +284,7 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
+ gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
if (vc->gfx.guest_fb.dmabuf) {
graphic_hw_gl_block(vc->gfx.dcl.con, true);
vc->gfx.guest_fb.dmabuf->draw_submitted = true;
@@ -1367,6 +1367,7 @@ static gboolean gd_tab_window_close(GtkWidget *widget, GdkEvent *event,
VirtualConsole *vc = opaque;
GtkDisplayState *s = vc->s;
+ dpy_gl_scanout_disable(vc->gfx.dcl.con);
gtk_widget_set_sensitive(vc->menu_item, true);
gd_widget_reparent(vc->window, s->notebook, vc->tab_item);
gtk_notebook_set_tab_label_text(GTK_NOTEBOOK(s->notebook),
When a detached tab window is closed, the underlying (EGL) context is destroyed; therefore, disable the scanout which also destroys the underlying framebuffer (id) and other objects. Also add calls to make the context current in disable scanout and other missing places. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Dongwon Kim <dongwon.kim@intel.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> --- ui/gtk-egl.c | 2 ++ ui/gtk-gl-area.c | 2 ++ ui/gtk.c | 1 + 3 files changed, 5 insertions(+)