Add meta_activate_session

This will be used on startup to switch to the newly activated session.
This commit is contained in:
Jasper St. Pierre
2014-03-11 17:04:22 -04:00
parent f21312e2fd
commit d47b7ba038
6 changed files with 46 additions and 2 deletions

View File

@ -502,6 +502,32 @@ meta_register_with_session (void)
g_free (opt_client_id);
}
/**
* meta_activate_session:
*
* Tells mutter to activate the session. When mutter is a
* Wayland compositor, this tells logind to switch over to
* the new session.
*/
gboolean
meta_activate_session (void)
{
if (meta_is_wayland_compositor ())
{
MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
GError *error = NULL;
if (!meta_wayland_compositor_activate_session (compositor, &error))
{
g_warning ("Could not activate session: %s\n", error->message);
g_error_free (error);
return FALSE;
}
}
return TRUE;
}
/**
* meta_run: (skip)
*