[mutter] util: Don't check whether zenity supports options
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] util: Don't check whether zenity supports options
- Date: Tue, 15 Apr 2014 21:20:53 +0000 (UTC)
commit 86100936d9bf8e0e87f2de0214df8db42a52de69
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Apr 15 17:18:18 2014 -0400
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 files changed, 3 insertions(+), 26 deletions(-)
---
diff --git a/src/core/util.c b/src/core/util.c
index 73a822c..2b04de0 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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]