bool KRequestShutdownHelper::requestShutdown( ShutdownConfirm confirm ) { #if HAVE_X11 if( conn == NULL ) return false; SmcRequestSaveYourself( conn, SmSaveBoth, True, SmInteractStyleAny, confirm == ShutdownConfirmNo, True ); // flush the request IceFlush(SmcGetIceConnection(conn)); #endif return true; }
void mod_sm_smhook(int what) { save_complete_fn=NULL; /* pending check? */ switch(what){ case IONCORE_SM_RESIGN: restart_hint=SmRestartIfRunning; sm_set_properties(); /*SmcRequestSaveYourself(sm_conn, SmSaveBoth, False, SmInteractStyleAny, False, False); save_complete_fn=&sm_exit;*/ ioncore_do_exit(); break; case IONCORE_SM_SHUTDOWN: restart_hint=SmRestartIfRunning; SmcRequestSaveYourself(sm_conn, SmSaveBoth, True, SmInteractStyleAny, False, True); break; case IONCORE_SM_RESTART: restart_hint=SmRestartImmediately; SmcRequestSaveYourself(sm_conn, SmSaveBoth, False, SmInteractStyleAny, False, False); save_complete_fn=&sm_exit; break; case IONCORE_SM_RESTART_OTHER: restart_hint=SmRestartIfRunning; SmcRequestSaveYourself(sm_conn, SmSaveBoth, False, SmInteractStyleAny, False, False); save_complete_fn=&sm_restart; break; case IONCORE_SM_SNAPSHOT: restart_hint=SmRestartImmediately; SmcRequestSaveYourself(sm_conn, SmSaveBoth, False, SmInteractStyleAny, False, True); break; } }