From 32b8e1e2efe297fe4b7d59e5354377949600931c Mon Sep 17 00:00:00 2001 From: Wolf Date: Wed, 1 Jan 2020 22:22:20 +0100 Subject: group-desktop: Add patch supporting weltschmerz in glib Because of what I can only surmise to be legacy reasons, glib (and therefore gio) use a hardcoded list of terminal emulators to use with AppInfo. This is used, for example, when launching terminal applications through a .desktop file with "Terminal=True". This patch adds rudimentary support for our own terminal emulator, weltschmerz. Hopefully sometime in the next 10 years this will be replaced by a cleaner solution upstream. --- .../patches/dev-libs/glib/add-weltschmerz.patch | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 group-desktop/patches/dev-libs/glib/add-weltschmerz.patch diff --git a/group-desktop/patches/dev-libs/glib/add-weltschmerz.patch b/group-desktop/patches/dev-libs/glib/add-weltschmerz.patch new file mode 100644 index 0000000..5f7c693 --- /dev/null +++ b/group-desktop/patches/dev-libs/glib/add-weltschmerz.patch @@ -0,0 +1,29 @@ +diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c +index 7d7425ea9..7a31a519e 100644 +--- a/gio/gdesktopappinfo.c ++++ b/gio/gdesktopappinfo.c +@@ -2523,6 +2523,12 @@ prepend_terminal_to_vector (int *argc, + } + else + { ++ int skip_option = 0; ++ if (check == NULL) ++ { ++ check = g_find_program_in_path ("weltschmerz"); ++ skip_option = 1; ++ } + if (check == NULL) + check = g_find_program_in_path ("nxterm"); + if (check == NULL) +@@ -2537,7 +2543,10 @@ prepend_terminal_to_vector (int *argc, + g_debug ("Couldn’t find a terminal: falling back to xterm"); + } + term_argv[0] = check; +- term_argv[1] = g_strdup ("-e"); ++ if (!skip_option) ++ term_argv[1] = g_strdup ("-e"); ++ else ++ term_argc--; + } + + real_argc = term_argc + *argc; -- cgit v1.2.3-2-gb3c3