mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
ui/gtk: force realization of drawing area
Fixes the GL context creation from a widget that isn't yet realized (in a hidden tab for example). Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1727 Signed-off-by: Marc-André Lureau <[email protected]> Reviewed-by: Antonio Caggiano <[email protected]> Message-Id: <[email protected]>
This commit is contained in:
1 parent
8aba939e77
commit
565f85a9c2
1 file changed
+10
@@ -2371,6 +2371,7 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
|
||||
GdkDisplay *window_display;
|
||||
GtkIconTheme *theme;
|
||||
char *dir;
|
||||
int idx;
|
||||
|
||||
if (!gtkinit) {
|
||||
fprintf(stderr, "gtk initialization failed\n");
|
||||
@@ -2434,6 +2435,15 @@ static void gtk_display_init(DisplayState *ds, DisplayOptions *opts)
|
||||
gtk_container_add(GTK_CONTAINER(s->window), s->vbox);
|
||||
|
||||
gtk_widget_show_all(s->window);
|
||||
|
||||
for (idx = 0;; idx++) {
|
||||
QemuConsole *con = qemu_console_lookup_by_index(idx);
|
||||
if (!con) {
|
||||
break;
|
||||
}
|
||||
gtk_widget_realize(s->vc[idx].gfx.drawing_area);
|
||||
}
|
||||
|
||||
if (opts->u.gtk.has_show_menubar &&
|
||||
!opts->u.gtk.show_menubar) {
|
||||
gtk_widget_hide(s->menu_bar);
|
||||
|
||||
Reference in new issue
Block a user