From 09cd95bb27b18a83a3028399236ee5309327bad8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 22 Nov 2016 19:14:48 +0100 Subject: Gtk interface: make sure that the default display is opened * this has been broken since cb5e08b40d --- src/interface-gtk/interface-gtk.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/interface-gtk/interface-gtk.cpp') diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp index 920f01b..ca04a6e 100644 --- a/src/interface-gtk/interface-gtk.cpp +++ b/src/interface-gtk/interface-gtk.cpp @@ -185,8 +185,8 @@ InterfaceGtk::get_options(void) /* * Parsing the option context with the Gtk option group - * will automatically initialize Gtk, so gtk_init() - * does not have to be called. + * will automatically initialize Gtk, but we do not yet + * open the default display. */ GOptionGroup *group = gtk_get_option_group(FALSE); @@ -214,6 +214,14 @@ InterfaceGtk::init(void) #endif gdk_threads_init(); + /* + * gtk_init() is not necessary when using gtk_get_option_group(), + * but this will open the default display. + * FIXME: Perhaps it is possible to defer this until we initialize + * interactive mode!? + */ + gtk_init(NULL, NULL); + /* * Register clipboard registers. * Unfortunately, we cannot find out which -- cgit v1.2.3