From 86100936d9bf8e0e87f2de0214df8db42a52de69 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Tue, 15 Apr 2014 17:18:18 -0400 Subject: [PATCH] util: Don't check whether zenity supports options Doing this synchronously means that zenity tries to initialize GTK+. Under Wayland, that will try to connect back to mutter as a display server. We're waiting on zenity to exit, and zenity is waiting for a connection response. Deadlock. Simply assume that zenity will support all the options we feed it, since it should be the correct version. Perhaps we should replace our use of zenity with a simple helper binary that we know will have all the right options if this still isn't good enough. --- src/core/util.c | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/core/util.c b/src/core/util.c index 73a822ca4..2b04de0e7 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -579,23 +579,6 @@ meta_external_binding_name_for_action (guint keybinding_action) return g_strdup_printf ("external-grab-%u", keybinding_action); } -static gboolean -zenity_supports_option (const char *section, const char *option) -{ - char *command, *out; - gboolean rv; - - command = g_strdup_printf ("zenity %s", section); - g_spawn_command_line_sync (command, &out, NULL, NULL, NULL); - - rv = (out && strstr (out, option)); - - g_free (command); - g_free (out); - - return rv; -} - /* Command line arguments are passed in the locale encoding; in almost * all cases, we'd hope that is UTF-8 and no conversion is necessary. * If it's not UTF-8, then it's possible that the message isn't @@ -684,13 +667,8 @@ meta_show_dialog (const char *type, if (icon_name) { - char *option = g_strdup_printf ("--help%s", type + 1); - if (zenity_supports_option (option, "--icon-name")) - { - append_argument (args, "--icon-name"); - append_argument (args, icon_name); - } - g_free (option); + append_argument (args, "--icon-name"); + append_argument (args, icon_name); } tmp = columns; @@ -714,8 +692,7 @@ meta_show_dialog (const char *type, setenv ("WINDOWID", env, 1); g_free (env); - if (zenity_supports_option ("--help-general", "--modal")) - append_argument (args, "--modal"); + append_argument (args, "--modal"); } g_ptr_array_add (args, NULL); /* NULL-terminate */