diff --git a/src/display.c b/src/display.c index 4e1db83..345f968 100644 --- a/src/display.c +++ b/src/display.c @@ -1921,7 +1921,7 @@ eventLoop (void) } else if (shutDown) { - exit (0); + return ; } while (XPending (display->display)) diff --git a/src/session.c b/src/session.c index 6f339be..d36df52 100644 --- a/src/session.c +++ b/src/session.c @@ -89,11 +89,11 @@ setCloneRestartCommands (SmcConn connect } static void -setRestartStyle (SmcConn connection) +setRestartStyle (SmcConn connection, + char hint) { SmProp prop, *pProp; SmPropValue propVal; - char hint = SmRestartImmediately; prop.name = SmRestartStyleHint; prop.type = SmCARD8; @@ -139,7 +139,7 @@ saveYourselfGotProps (SmcConn connecti } out: - setRestartStyle (connection); + setRestartStyle (connection, SmRestartImmediately); setCloneRestartCommands (connection); SmcSaveYourselfDone (connection, 1); @@ -226,12 +226,13 @@ closeSession (void) { if (connected) { - if (SmcCloseConnection (smcConnection, 0, NULL) != SmcConnectionInUse) - connected = FALSE; - if (smClientId) { - free (smClientId); - smClientId = NULL; - } + setRestartStyle (smcConnection, SmRestartIfRunning); + if (SmcCloseConnection (smcConnection, 0, NULL) != SmcConnectionInUse) + connected = FALSE; + if (smClientId) { + free (smClientId); + smClientId = NULL; + } } }