예제 #1
0
func ddeSessionRegister() {
	cookie := os.ExpandEnv("$DDE_SESSION_PROCESS_COOKIE_ID")
	utils.UnsetEnv("DDE_SESSION_PROCESS_COOKIE_ID")
	manager, err := sessionmanager.NewSessionManager("com.deepin.SessionManager", "/com/deepin/SessionManager")
	if err != nil {
		return
	}
	manager.Register(cookie)
}
예제 #2
0
func doLogout() {
	if m, err := sessionmanager.NewSessionManager("com.deepin.SessionManager", "/com/deepin/SessionManager"); err != nil {
		logger.Warning("can't build SessionManager Object:", err)
	} else {
		if err = m.Logout(); err != nil {
			logger.Warning("ShutDown failed:", err)
		}
		sessionmanager.DestroySessionManager(m)
	}
}
예제 #3
0
func doSuspend() {
	if m, err := sessionmanager.NewSessionManager("com.deepin.SessionManager", "/com/deepin/SessionManager"); err != nil {
		logger.Warning("can't build SessionManager Object:", err)
	} else {
		if err = m.RequestSuspend(); err != nil {
			logger.Warning("Suspend failed:", err)
		}
		logger.Debug("RequestSuspend...", err)
		sessionmanager.DestroySessionManager(m)
	}
}