Move calendar handling out-of-process
Unfortunately the evolution-data-server client-side libraries seem to block the calling thread. This is a major problem as we must never ever block the main thread (doing so causes animations to flicker etc.). In the worst case, this problem causes login to hang (without falling back to fall-back mode) and in the best case it slows down login until a network connection is acquired. Additionally, in order to sanely use these evolution-data-server libraries, GConf has to be involved and GConf is not thread-safe. So it's not really feasible just moving the code to a separate thread. Therefore, move all calendar IO out of process and use a simple (and private) D-Bus interface for the shell to communicate with the out-of-process helper. For simplification, remove existing in-process code since internal interfaces have been slightly revised. This means that the shell is no longer using any native code for drawing the calendar dropdown. https://bugzilla.gnome.org/show_bug.cgi?id=641396 Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
@ -1984,3 +1984,57 @@ shell_get_tp_contacts (TpConnection *self,
|
||||
shell_global_get_tp_contacts_cb,
|
||||
callback, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_global_launch_calendar_server:
|
||||
* @global: The #ShellGlobal.
|
||||
*
|
||||
* Launch the gnome-shell-calendar-server helper.
|
||||
*/
|
||||
void
|
||||
shell_global_launch_calendar_server (ShellGlobal *global)
|
||||
{
|
||||
const gchar *bin_dir;
|
||||
gchar *calendar_server_exe;
|
||||
GError *error;
|
||||
gchar *argv[2];
|
||||
gint child_standard_input;
|
||||
|
||||
/* launch calendar-server */
|
||||
bin_dir = g_getenv ("GNOME_SHELL_BINDIR");
|
||||
if (bin_dir != NULL)
|
||||
calendar_server_exe = g_strdup_printf ("%s/gnome-shell-calendar-server", bin_dir);
|
||||
else
|
||||
calendar_server_exe = g_strdup_printf (GNOME_SHELL_LIBEXECDIR "/gnome-shell-calendar-server");
|
||||
|
||||
argv[0] = calendar_server_exe;
|
||||
argv[1] = NULL;
|
||||
error = NULL;
|
||||
if (!g_spawn_async_with_pipes (NULL, /* working_directory */
|
||||
argv,
|
||||
NULL, /* envp */
|
||||
0, /* GSpawnFlags */
|
||||
NULL, /* child_setup */
|
||||
NULL, /* user_data */
|
||||
NULL, /* GPid *child_pid */
|
||||
&child_standard_input,
|
||||
NULL, /* gint *stdout */
|
||||
NULL, /* gint *stderr */
|
||||
&error))
|
||||
{
|
||||
g_warning ("Error launching `%s': %s (%s %d)",
|
||||
calendar_server_exe,
|
||||
error->message,
|
||||
g_quark_to_string (error->domain),
|
||||
error->code);
|
||||
g_error_free (error);
|
||||
}
|
||||
/* Note that gnome-shell-calendar-server exits whenever its stdin
|
||||
* file descriptor is HUP'ed. This means that whenever the the shell
|
||||
* process exits or is being replaced, the calendar server is also
|
||||
* exits...and if the shell is being replaced, a new copy of the
|
||||
* calendar server is launched...
|
||||
*/
|
||||
|
||||
g_free (calendar_server_exe);
|
||||
}
|
||||
|
Reference in New Issue
Block a user