If org.gnome.Panel exists on the bus, replace it rather than using gdb

Avoid depending on gdb for replacing an existing panel, since it
requires debuginfo and gdb installed.

Instead we grab the org.gnome.Panel DBus name, using DBus name
replacement semantics.
This commit is contained in:
Colin Walters
2009-07-21 10:50:18 -04:00
parent e12587619b
commit fdd9b85448
2 changed files with 26 additions and 4 deletions

View File

@ -739,11 +739,23 @@ shell_global_grab_dbus_service (ShellGlobal *global)
*/
exit (0);
}
/* Also grab org.gnome.Panel to replace any existing panel process */
if (!dbus_g_proxy_call (bus, "RequestName", &error,
G_TYPE_STRING, "org.gnome.Panel",
G_TYPE_UINT, DBUS_NAME_FLAG_REPLACE_EXISTING | DBUS_NAME_FLAG_DO_NOT_QUEUE,
G_TYPE_INVALID,
G_TYPE_UINT, &request_name_result,
G_TYPE_INVALID))
{
g_print ("failed to acquire org.gnome.Panel: %s\n", error->message);
exit (1);
}
g_object_unref (bus);
}
void
void
shell_global_start_task_panel (ShellGlobal *global)
{
const char* panel_args[] = {"gnomeshell-taskpanel", SHELL_DBUS_SERVICE, NULL};