Ejemplo n.º 1
0
static void
save_yourself_possibly_done (gboolean shutdown,
                             gboolean successful)
{
  meta_topic (META_DEBUG_SM,
              "save possibly done shutdown = %d success = %d\n",
              shutdown, successful);
  
  if (current_state == STATE_SAVING_PHASE_1)
    {
      Status status;
      
      status = SmcRequestSaveYourselfPhase2 (session_connection,
                                             save_phase_2_callback,
                                             GINT_TO_POINTER (shutdown));

      if (status)
        current_state = STATE_WAITING_FOR_PHASE_2;

      meta_topic (META_DEBUG_SM,
                  "Requested phase 2, status = %d\n", status);
    }

  if (current_state == STATE_SAVING_PHASE_2 &&
      interaction_allowed)
    {
      Status status;

      status = SmcInteractRequest (session_connection,
                                   /* ignore this feature of the protocol by always
                                    * claiming normal
                                    */
                                   SmDialogNormal,
                                   interact_callback,
                                   GINT_TO_POINTER (shutdown));

      if (status)
        current_state = STATE_WAITING_FOR_INTERACT;

      meta_topic (META_DEBUG_SM,
                  "Requested interact, status = %d\n", status);
    }
  
  if (current_state == STATE_SAVING_PHASE_1 ||
      current_state == STATE_SAVING_PHASE_2 ||
      current_state == STATE_DONE_WITH_INTERACT ||
      current_state == STATE_SKIPPING_GLOBAL_SAVE)
    {
      meta_topic (META_DEBUG_SM, "Sending SaveYourselfDone\n");
      
      SmcSaveYourselfDone (session_connection,
                           successful);
      
      if (shutdown)
        current_state = STATE_FROZEN;
      else
        current_state = STATE_IDLE;
    }
}
Ejemplo n.º 2
0
Archivo: session.c Proyecto: Limsik/e17
static void
callback_save_yourself(SmcConn smc_conn, SmPointer client_data __UNUSED__,
		       int save_style __UNUSED__, Bool shutdown __UNUSED__,
		       int interact_style __UNUSED__, Bool fast __UNUSED__)
{
   if (EDebug(EDBUG_TYPE_SESSION))
      Eprintf("callback_save_yourself\n");

   SmcRequestSaveYourselfPhase2(smc_conn, callback_save_yourself2, NULL);
}
Ejemplo n.º 3
0
static void sm_save_yourself(SmcConn UNUSED(conn),
                             SmPointer UNUSED(client_data),
                             int UNUSED(save_type),
                             Bool UNUSED(shutdown),
                             int UNUSED(interact_style),
                             Bool UNUSED(fast))
{
    if(!SmcRequestSaveYourselfPhase2(sm_conn, sm_save_yourself_phase2, NULL)){
        warn(TR("Failed to request save-yourself-phase2 from "
                "session manager."));
        SmcSaveYourselfDone(sm_conn, False);
        sent_save_done=TRUE;
    }else{
        sent_save_done=FALSE;
    }
}