From 7e4bb2ff689a6caf535b331e6e9fd73c1890450a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 20 Jan 2023 16:51:31 -0700 Subject: [PATCH] only when necessary, parse GTK/GDK command line arguments --- gtk2_ardour/main.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 54c9145b09..e3a76b45be 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -323,6 +323,19 @@ int main (int argc, char *argv[]) } #endif + /* This is horrible, but ... we don't want to init GTK until it is + * really time (during a Gtkmm2ext::UI constructor. However, this will + * try to load GTK modules too, so do this only if it appears that need + * to do this. + */ + + for (int n = 1; n < argc; ++n) { + if (!strncmp (argv[n], "--gtk", 5) || !strncmp (argv[n], "--gdk", 5)) { + gtk_parse_args (&argc, &argv); + break; + } + } + if (parse_opts (argc, argv)) { command_line_parse_error (&argc, &argv); exit (EXIT_FAILURE);