mirror of
https://github.com/brl/mutter.git
synced 2024-12-25 20:32:16 +00:00
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.
This commit is contained in:
parent
37de96ce86
commit
86100936d9
@ -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
|
||||
@ -683,15 +666,10 @@ 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);
|
||||
}
|
||||
|
||||
tmp = columns;
|
||||
while (tmp)
|
||||
@ -714,7 +692,6 @@ meta_show_dialog (const char *type,
|
||||
setenv ("WINDOWID", env, 1);
|
||||
g_free (env);
|
||||
|
||||
if (zenity_supports_option ("--help-general", "--modal"))
|
||||
append_argument (args, "--modal");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user