diff options
Diffstat (limited to 'src/interface-gtk')
-rw-r--r-- | src/interface-gtk/interface-gtk.cpp | 10 | ||||
-rw-r--r-- | src/interface-gtk/interface-gtk.h | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp index 4ef0b38..920f01b 100644 --- a/src/interface-gtk/interface-gtk.cpp +++ b/src/interface-gtk/interface-gtk.cpp @@ -183,7 +183,12 @@ InterfaceGtk::get_options(void) {NULL} }; - GOptionGroup *group = gtk_get_option_group(TRUE); + /* + * Parsing the option context with the Gtk option group + * will automatically initialize Gtk, so gtk_init() + * does not have to be called. + */ + GOptionGroup *group = gtk_get_option_group(FALSE); g_option_group_add_entries(group, entries); @@ -191,7 +196,7 @@ InterfaceGtk::get_options(void) } void -InterfaceGtk::main_impl(int &argc, char **&argv) +InterfaceGtk::init(void) { static const Cmdline empty_cmdline; @@ -208,7 +213,6 @@ InterfaceGtk::main_impl(int &argc, char **&argv) g_thread_init(NULL); #endif gdk_threads_init(); - gtk_init(&argc, &argv); /* * Register clipboard registers. diff --git a/src/interface-gtk/interface-gtk.h b/src/interface-gtk/interface-gtk.h index 0145ff4..a19d253 100644 --- a/src/interface-gtk/interface-gtk.h +++ b/src/interface-gtk/interface-gtk.h @@ -113,8 +113,8 @@ public: /* overrides Interface::get_options() */ GOptionGroup *get_options(void); - /* implementation of Interface::main() */ - void main_impl(int &argc, char **&argv); + /* override of Interface::init() */ + void init(void); /* implementation of Interface::vmsg() */ void vmsg_impl(MessageType type, const gchar *fmt, va_list ap); |