diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c index 69018cfdd..a484c63d4 100644 --- a/gio/gdesktopappinfo.c +++ b/gio/gdesktopappinfo.c @@ -2518,34 +2518,43 @@ prepend_terminal_to_vector (int *argc, term_argv = g_new0 (char *, 3); check = g_find_program_in_path ("gnome-terminal"); - if (check == NULL) - check = g_find_program_in_path ("mate-terminal"); - if (check == NULL) - check = g_find_program_in_path ("xfce4-terminal"); if (check != NULL) { term_argv[0] = check; - /* Note that gnome-terminal takes -x and - * as -e in gnome-terminal is broken we use that. */ - term_argv[1] = g_strdup ("-x"); + /* Since 2017, gnome-terminal has preferred `--` over `-x` or `-e`. */ + term_argv[1] = g_strdup ("--"); } else { if (check == NULL) - check = g_find_program_in_path ("nxterm"); - if (check == NULL) - check = g_find_program_in_path ("color-xterm"); - if (check == NULL) - check = g_find_program_in_path ("rxvt"); - if (check == NULL) - check = g_find_program_in_path ("dtterm"); + check = g_find_program_in_path ("mate-terminal"); if (check == NULL) + check = g_find_program_in_path ("xfce4-terminal"); + if (check != NULL) { - check = g_strdup ("xterm"); - g_debug ("Couldn’t find a terminal: falling back to xterm"); + term_argv[0] = check; + /* Note that gnome-terminal takes -x and + * as -e in gnome-terminal is broken we use that. */ + term_argv[1] = g_strdup ("-x"); + } + else + { + if (check == NULL) + check = g_find_program_in_path ("nxterm"); + if (check == NULL) + check = g_find_program_in_path ("color-xterm"); + if (check == NULL) + check = g_find_program_in_path ("rxvt"); + if (check == NULL) + check = g_find_program_in_path ("dtterm"); + if (check == NULL) + { + check = g_strdup ("xterm"); + g_debug ("Couldn’t find a terminal: falling back to xterm"); + } + term_argv[0] = check; + term_argv[1] = g_strdup ("-e"); } - term_argv[0] = check; - term_argv[1] = g_strdup ("-e"); } real_argc = term_argc + *argc; diff --git a/gio/tests/appinfo-test.desktop.in b/gio/tests/appinfo-test.desktop.in index bc292b135..1f6ff7144 100644 --- a/gio/tests/appinfo-test.desktop.in +++ b/gio/tests/appinfo-test.desktop.in @@ -9,7 +9,7 @@ Comment=GAppInfo example Comment[de]=GAppInfo Beispiel Exec=@installed_tests_dir@/appinfo-test --option %U %i --name %c --filename %k %m %% Icon=testicon.svg -Terminal=true +Terminal=false StartupNotify=true StartupWMClass=appinfo-class MimeType=image/png;image/jpeg; diff --git a/gio/tests/appinfo.c b/gio/tests/appinfo.c index f13698d70..4fec6b379 100644 --- a/gio/tests/appinfo.c +++ b/gio/tests/appinfo.c @@ -87,7 +87,7 @@ test_launch_no_app_id (void) "Comment=GAppInfo example\n" "Comment[de]=GAppInfo Beispiel\n" "Icon=testicon.svg\n" - "Terminal=true\n" + "Terminal=false\n" "StartupNotify=true\n" "StartupWMClass=appinfo-class\n" "MimeType=image/png;image/jpeg;\n" diff --git a/glib/gtestutils.c b/glib/gtestutils.c index 517c03b53..881789087 100644 --- a/glib/gtestutils.c +++ b/glib/gtestutils.c @@ -3323,6 +3323,18 @@ g_test_trap_fork (guint64 usec_timeout, close (stdout_pipe[1]); if (stderr_pipe[1] >= 3) close (stderr_pipe[1]); + + /* We typically expect these child processes to crash, and some + * tests spawn a *lot* of them. Avoid spamming system crash + * collection programs such as systemd-coredump and abrt. + */ +#ifdef HAVE_SYS_RESOURCE_H + { + struct rlimit limit = { 0, 0 }; + (void) setrlimit (RLIMIT_CORE, &limit); + } +#endif + return TRUE; } else /* parent */