gdm_session_worker_handle_start_program (GdmDBusWorker         *object,
                                         GDBusMethodInvocation *invocation,
                                         const char            *text)
{
        GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
        GError *parse_error = NULL;
        validate_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SESSION_STARTED);

        if (worker->priv->is_reauth_session) {
                g_dbus_method_invocation_return_error (invocation,
                                                       GDM_SESSION_WORKER_ERROR,
                                                       GDM_SESSION_WORKER_ERROR_IN_REAUTH_SESSION,
                                                       "Cannot start a program while in a reauth session");
                return TRUE;
        }

        g_debug ("GdmSessionWorker: start program: %s", text);

        g_clear_pointer (&worker->priv->arguments, g_strfreev);
        if (! g_shell_parse_argv (text, NULL, &worker->priv->arguments, &parse_error)) {
                g_dbus_method_invocation_take_error (invocation, parse_error);
                return TRUE;
        }

        worker->priv->pending_invocation = invocation;
        queue_state_change (worker);

        return TRUE;
}
gdm_session_worker_handle_start_program (GdmDBusWorker         *object,
                                         GDBusMethodInvocation *invocation,
                                         const char            *text)
{
        GdmSessionWorker *worker = GDM_SESSION_WORKER (object);
        GError *parse_error = NULL;
        validate_state_change (worker, invocation, GDM_SESSION_WORKER_STATE_SESSION_STARTED);

        if (worker->priv->is_reauth_session) {
                g_dbus_method_invocation_return_error (invocation,
                                                       GDM_SESSION_WORKER_ERROR,
                                                       GDM_SESSION_WORKER_ERROR_IN_REAUTH_SESSION,
                                                       "Cannot start a program while in a reauth session");
                return TRUE;
        }

        g_debug ("GdmSessionWorker: start program: %s", text);

        g_clear_pointer (&worker->priv->arguments, g_strfreev);
        if (! g_shell_parse_argv (text, NULL, &worker->priv->arguments, &parse_error)) {
                g_dbus_method_invocation_take_error (invocation, parse_error);
                return TRUE;
        }

        worker->priv->pending_invocation = invocation;
        queue_state_change (worker);

        return TRUE;
}