calendar: Launch the calendar server with DBus autostart
The supposed reason for launching the calendar server in a peculiar way was so that the process would be killed when the Shell was killed, but that didn't actually work. Launch the calendar server through auto-start, and persist all throughout the session. https://bugzilla.gnome.org/show_bug.cgi?id=683156
This commit is contained in:
parent
3a1f623ea3
commit
cb9062f818
@ -204,12 +204,11 @@ const CalendarServerInfo = Gio.DBusInterfaceInfo.new_for_xml(CalendarServerIfac
|
|||||||
|
|
||||||
function CalendarServer() {
|
function CalendarServer() {
|
||||||
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
|
var self = new Gio.DBusProxy({ g_connection: Gio.DBus.session,
|
||||||
g_interface_name: CalendarServerInfo.name,
|
g_interface_name: CalendarServerInfo.name,
|
||||||
g_interface_info: CalendarServerInfo,
|
g_interface_info: CalendarServerInfo,
|
||||||
g_name: 'org.gnome.Shell.CalendarServer',
|
g_name: 'org.gnome.Shell.CalendarServer',
|
||||||
g_object_path: '/org/gnome/Shell/CalendarServer',
|
g_object_path: '/org/gnome/Shell/CalendarServer',
|
||||||
g_flags: (Gio.DBusProxyFlags.DO_NOT_AUTO_START |
|
g_flags: Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES });
|
||||||
Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES) });
|
|
||||||
|
|
||||||
self.init(null);
|
self.init(null);
|
||||||
return self;
|
return self;
|
||||||
|
@ -80,10 +80,6 @@ let _overridesSettings = null;
|
|||||||
let background = null;
|
let background = null;
|
||||||
|
|
||||||
function createUserSession() {
|
function createUserSession() {
|
||||||
// Load the calendar server. Note that we are careful about
|
|
||||||
// not loading any events until the user presses the clock
|
|
||||||
global.launch_calendar_server();
|
|
||||||
|
|
||||||
telepathyClient = new TelepathyClient.Client();
|
telepathyClient = new TelepathyClient.Client();
|
||||||
automountManager = new AutomountManager.AutomountManager();
|
automountManager = new AutomountManager.AutomountManager();
|
||||||
autorunManager = new AutorunManager.AutorunManager();
|
autorunManager = new AutorunManager.AutorunManager();
|
||||||
|
@ -1686,60 +1686,6 @@ gboolean _shell_global_check_xdnd_event (ShellGlobal *global,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
shell_global_get_session_mode (ShellGlobal *global)
|
shell_global_get_session_mode (ShellGlobal *global)
|
||||||
{
|
{
|
||||||
|
@ -134,8 +134,6 @@ void shell_global_init_xdnd (ShellGlobal *global);
|
|||||||
|
|
||||||
void shell_global_reexec_self (ShellGlobal *global);
|
void shell_global_reexec_self (ShellGlobal *global);
|
||||||
|
|
||||||
void shell_global_launch_calendar_server (ShellGlobal *global);
|
|
||||||
|
|
||||||
const char * shell_global_get_session_mode (ShellGlobal *global);
|
const char * shell_global_get_session_mode (ShellGlobal *global);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
Loading…
Reference in New Issue
Block a user