]> Git Repo - qemu.git/blobdiff - ui/gtk.c
target-arm: Fix default_exception_el() function for the case when EL3 is not supported
[qemu.git] / ui / gtk.c
index 126326ac7f8eb2e94f70116d0f5df907eb7f82d3..df2a79e7ac044ac0e9407bf28f9ef3091cd77f2f 100644 (file)
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1917,12 +1917,19 @@ static void gd_set_keycode_type(GtkDisplayState *s)
 #endif
 }
 
+static gboolean gtkinit;
+
 void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
 {
     GtkDisplayState *s = g_malloc0(sizeof(*s));
     char *filename;
     GdkDisplay *window_display;
 
+    if (!gtkinit) {
+        fprintf(stderr, "gtk initialization failed\n");
+        exit(1);
+    }
+
     s->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 #if GTK_CHECK_VERSION(3, 2, 0)
     s->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
@@ -2003,7 +2010,11 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
 
 void early_gtk_display_init(int opengl)
 {
-    gtk_init(NULL, NULL);
+    gtkinit = gtk_init_check(NULL, NULL);
+    if (!gtkinit) {
+        /* don't exit yet, that'll break -help */
+        return;
+    }
 
     switch (opengl) {
     case -1: /* default */
This page took 0.023595 seconds and 4 git commands to generate.