diff -rup vcl/inc/salsession.hxx vcl/inc/salsession.hxx
--- vcl/inc/salsession.hxx	2005-09-09 13:22:55.000000000 +0200
+++ vcl/inc/salsession.hxx	2006-02-20 17:10:26.000000000 +0100
@@ -109,11 +109,9 @@ public:
     // query the session manager for a user interaction slot
     virtual void queryInteraction() = 0;
     // signal the session manager that we're done with user interaction
-    virtual void interactionDone() = 0;
+    virtual void interactionDone( bool bCancelShutdown ) = 0;
     // signal that we're done saving
     virtual void saveDone() = 0;
-    // try to cancel the sutdown in progress
-    virtual bool cancelShutdown() = 0;
 };
 
 #endif
diff -rup vcl/source/app/session.cxx vcl/source/app/session.cxx
--- vcl/source/app/session.cxx	2005-09-09 13:41:36.000000000 +0200
+++ vcl/source/app/session.cxx	2006-02-20 17:10:19.000000000 +0100
@@ -126,9 +126,8 @@ public:
     virtual void SAL_CALL addSessionManagerListener( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
     virtual void SAL_CALL removeSessionManagerListener( const Reference< XSessionManagerListener>& xListener ) throw( RuntimeException );
     virtual void SAL_CALL queryInteraction( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
-    virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
+    virtual void SAL_CALL interactionDone( const Reference< XSessionManagerListener >& xListener, sal_Bool bCancelShutdown ) throw( RuntimeException );
     virtual void SAL_CALL saveDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException );
-    virtual sal_Bool SAL_CALL cancelShutdown() throw( RuntimeException );
 };
 
 VCLSession* VCLSession::pOneInstance = NULL;
@@ -208,7 +207,7 @@ void VCLSession::callInteractionGranted(
         if( aListeners.empty() )
         {
             if( m_pSession )
-                m_pSession->interactionDone();
+                m_pSession->interactionDone( false );
             return;
         }
     }
@@ -310,7 +309,7 @@ void SAL_CALL VCLSession::queryInteracti
     }
 }
 
-void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener ) throw( RuntimeException )
+void SAL_CALL VCLSession::interactionDone( const Reference< XSessionManagerListener >& xListener, sal_Bool bCancelShutdown ) throw( RuntimeException )
 {
     osl::MutexGuard aGuard( m_aMutex );
     int nRequested = 0, nDone = 0;
@@ -329,7 +328,7 @@ void SAL_CALL VCLSession::interactionDon
     {
         m_bInteractionDone = true;
         if( m_pSession )
-            m_pSession->interactionDone();
+            m_pSession->interactionDone( bCancelShutdown );
     }
 }
 
@@ -354,11 +353,6 @@ void SAL_CALL VCLSession::saveDone( cons
     }
 }
 
-sal_Bool SAL_CALL VCLSession::cancelShutdown() throw( RuntimeException )
-{
-    return m_pSession ? (sal_Bool)m_pSession->cancelShutdown() : sal_False;
-}
-
 // service implementation
 
 static Sequence< rtl::OUString > SAL_CALL vcl_session_getSupportedServiceNames()
diff -rup vcl/unx/inc/sm.hxx vcl/unx/inc/sm.hxx
--- vcl/unx/inc/sm.hxx	2006-03-14 12:28:47.000000000 +0100
+++ vcl/unx/inc/sm.hxx	2006-02-20 17:37:18.000000000 +0100
@@ -44,7 +44,8 @@ class SessionManagerClient
 {
 	static SmcConn			aSmcConnection;
 	static ByteString		aClientID;
-    static bool			bDocSaveDone;
+    static bool			    bDocSaveDone;
+	static bool             bSaveDoneSent;
 
 	static void SaveYourselfProc(		SmcConn connection,
 										SmPointer client_data,
@@ -73,8 +74,8 @@ public:
 
     static bool checkDocumentsSaved();
     static bool queryInteraction();
-    static void saveDone();
-    static void interactionDone();
+    static void saveDone( bool bSuccess = true );
+    static void interactionDone( bool bCancelShutdown = false );
 
 	static String getExecName();
 	static VCL_DLLPUBLIC const ByteString&  getSessionID();
@@ -89,9 +90,8 @@ public:
     virtual ~IceSalSession();
     
     virtual void queryInteraction();
-    virtual void interactionDone();
+    virtual void interactionDone( bool bCancelShutdown );
     virtual void saveDone();
-    virtual bool cancelShutdown();
 
     static void handleOldX11SaveYourself( SalFrame* pFrame );
 };
Only in vcl/unx/inc: sm.hxx.~1.9.~
diff -rup vcl/unx/source/app/sm.cxx vcl/unx/source/app/sm.cxx
--- vcl/unx/source/app/sm.cxx	2006-03-14 12:28:47.000000000 +0100
+++ vcl/unx/source/app/sm.cxx	2006-02-20 17:44:23.000000000 +0100
@@ -129,9 +129,9 @@ void IceSalSession::queryInteraction()
     }
 }
 
-void IceSalSession::interactionDone()
+void IceSalSession::interactionDone( bool bCancelShutdown )
 {
-    SessionManagerClient::interactionDone();
+    SessionManagerClient::interactionDone( bCancelShutdown );
 }
 
 void IceSalSession::saveDone()
@@ -144,11 +144,6 @@ void IceSalSession::saveDone()
     }
 }
 
-bool IceSalSession::cancelShutdown()
-{
-    return false;
-}
-
 void IceSalSession::handleOldX11SaveYourself( SalFrame* pFrame )
 {
     // do this only once
@@ -201,6 +196,7 @@ int					ICEConnectionObserver::nWakeupFi
 // HACK
 bool SessionManagerClient::bDocSaveDone = false;
 
+bool SessionManagerClient::bSaveDoneSent = false;
 
 static SmProp*	pSmProps = NULL;
 static SmProp**	ppSmProps = NULL;
@@ -269,12 +265,18 @@ bool SessionManagerClient::checkDocument
     return bDocSaveDone;
 }
 
+struct SaveYourselfArgs {
+	bool bShutdown;
+	bool bFast;
+	int nInteractionStyle;
+} aSaveYourselfArg;
+
 IMPL_STATIC_LINK( SessionManagerClient, SaveYourselfHdl, void*, EMPTYARG )
 {
     SMprintf( "posting save documents event shutdown = %s\n", (pThis!=0) ? "true" : "false" );
     if( pOneInstance )
     {
-        SalSessionSaveRequestEvent aEvent( pThis != 0, false );
+        SalSessionSaveRequestEvent aEvent( aSaveYourselfArg.bShutdown, aSaveYourselfArg.nInteractionStyle == SmInteractStyleAny && !aSaveYourselfArg.bFast );
         pOneInstance->CallCallback( &aEvent );        
     }
     else
@@ -286,12 +288,13 @@ IMPL_STATIC_LINK( SessionManagerClient, 
 IMPL_STATIC_LINK_NOINSTANCE( SessionManagerClient, InteractionHdl, void*, EMPTYARG )
 {
     SMprintf( "interaction link\n" );
-    if( pOneInstance )
+ 
+	if( pOneInstance )
     {
         SalSessionInteractionEvent aEvent( true );
         pOneInstance->CallCallback( &aEvent );
     }
-    
+
     return 0;
 }
 
@@ -304,6 +307,9 @@ IMPL_STATIC_LINK( SessionManagerClient, 
         pOneInstance->CallCallback( &aEvent );
     }
     
+ 	if( !bSaveDoneSent )
+ 		saveDone( false );
+
     return 0;
 }
 
@@ -317,7 +317,7 @@ void SessionManagerClient::SaveYourselfP
 	int save_type,
 	Bool shutdown,
 	int interact_style,
-	Bool
+	Bool fast
 	)
 {
     SMprintf( "Session: save yourself, save_type = %s, shutdown = %s, interact_style = %s, fast = %s\n",
@@ -324,8 +330,9 @@ void SessionManagerClient::SaveYourselfP
               interact_style == SmInteractStyleNone ? "SmInteractStyleNone" :
               ( interact_style == SmInteractStyleErrors ? "SmInteractStyleErrors" :
                 ( interact_style == SmInteractStyleAny ? "SmInteractStyleAny" : "<unknown>" ) ),
-              false ? "true" : "false"
+              fast ? "true" : "false"
               );
+	bSaveDoneSent = false;
 	BuildSmPropertyList();
 #ifdef USE_SM_EXTENSION
     bDocSaveDone = false;
@@ -340,7 +347,12 @@ void SessionManagerClient::SaveYourselfP
         SessionManagerClient::saveDone();
         return;
     }
-    Application::PostUserEvent( STATIC_LINK( (void*)(shutdown ? 0xffffffff : 0x0), SessionManagerClient, SaveYourselfHdl ) );
+
+	aSaveYourselfArg.bShutdown = shutdown;
+	aSaveYourselfArg.nInteractionStyle = interact_style;
+	aSaveYourselfArg.bFast = fast;
+	Application::PostUserEvent( STATIC_LINK( NULL, SessionManagerClient, SaveYourselfHdl ) );
+
     SMprintf( "waiting for save yourself event to be processed\n" );
 #endif
 }
@@ -393,20 +405,21 @@ void SessionManagerClient::InteractProc(
         Application::PostUserEvent( STATIC_LINK( NULL, SessionManagerClient, InteractionHdl ) );
 }
 
-void SessionManagerClient::saveDone()
+void SessionManagerClient::saveDone( bool bSuccess )
 {
     if( aSmcConnection )
     {
         ICEConnectionObserver::lock();
-        SmcSetProperties( aSmcConnection, nSmProps, ppSmProps );
-        SmcSaveYourselfDone( aSmcConnection, True );
+		if( bSuccess )
+			SmcSetProperties( aSmcConnection, nSmProps, ppSmProps );
+        SmcSaveYourselfDone( aSmcConnection, bSuccess );
         SMprintf( "sent SaveYourselfDone\n" );
-        bDocSaveDone = true;
+        bDocSaveDone = bSuccess;
+		bSaveDoneSent = true;
         ICEConnectionObserver::unlock();
     }
 }
 
-
 void SessionManagerClient::open()
 {
 	static SmcCallbacks aCallbacks;
@@ -505,12 +518,12 @@ bool SessionManagerClient::queryInteract
     return bRet;
 }
 
-void SessionManagerClient::interactionDone()
+void SessionManagerClient::interactionDone( bool bCancelShutdown )
 {
     if( aSmcConnection )
     {
         ICEConnectionObserver::lock();
-        SmcInteractDone( aSmcConnection, False );
+        SmcInteractDone( aSmcConnection, bCancelShutdown );
         ICEConnectionObserver::unlock();
     }
 }
diff -rup framework/inc/services/sessionlistener.hxx framework/inc/services/sessionlistener.hxx
--- framework/inc/services/sessionlistener.hxx	2006-01-19 18:50:05.000000000 +0100
+++ framework/inc/services/sessionlistener.hxx	2006-02-20 18:00:46.000000000 +0100
@@ -180,16 +180,12 @@ class SessionListener :   // interfaces
         css::uno::Reference< css::lang::XMultiServiceFactory > m_cfgProv;
 
         void _doInteraction(const rtl::OUString& title, const rtl::OUString& url, sal_Bool bc, sal_Bool* save, sal_Bool* cancel);
-        sal_Bool _cancelShutdown();
-        sal_Bool _requestInteraction();
-        void _finishInteraction();
+        void _requestInteraction();
+        void _finishInteraction( bool bCancelShutdown );
+	    void _saveAutorecovery();
 
         SessionList_t m_sessionList;
 
-        // interaction+shutdown handling
-        oslCondition* _pcInteract;
-        oslCondition* _pcCancelShutdown;
-
         // restore handling
         oslCondition m_cRestoreDone;
         sal_Bool m_bRestored;
diff -rup framework/source/services/sessionlistener.cxx framework/source/services/sessionlistener.cxx
--- framework/source/services/sessionlistener.cxx	2006-01-20 13:41:53.000000000 +0100
+++ framework/source/services/sessionlistener.cxx	2006-02-20 18:00:23.000000000 +0100
@@ -154,8 +154,6 @@ SessionListener::SessionListener(const c
         : ThreadHelpBase      (&Application::GetSolarMutex())
         , OWeakObject         (                             )
         , m_xSMGR             (xSMGR                        )
-        , _pcInteract( NULL )
-        , _pcCancelShutdown( NULL )
         , m_cRestoreDone(osl_createCondition())
         , m_bRestored( false )
 {   
@@ -255,38 +253,46 @@ sal_Bool SAL_CALL SessionListener::doRes
     return m_bRestored;
 }
 
+void SessionListener::_saveAutorecovery()
+{
+	sal_Bool bDispatched = sal_False;
+	ResetableGuard aGuard(m_aLock);    
+	try 
+		{
+			// xd create SERVICENAME_AUTORECOVERY -> XDispatch
+			// xd->dispatch("vnd.sun.star.autorecovery:/doSessionSave, async=true
+			// on stop event m_rSessionManager->saveDone(this);
+
+			Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW);
+			Reference< XURLTransformer > xURLTransformer(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), UNO_QUERY_THROW);
+			URL aURL;
+			aURL.Complete = OUString::createFromAscii("vnd.sun.star.autorecovery:/doSessionSave");
+			xURLTransformer->parseStrict(aURL);
+			xDispatch->addStatusListener(this, aURL);
+			Sequence< PropertyValue > args(1);
+			args[0] = PropertyValue(OUString::createFromAscii("DispatchAsynchron"),-1,makeAny(sal_True),PropertyState_DIRECT_VALUE);
+			xDispatch->dispatch(aURL, args);
+			bDispatched = sal_True;
+			// on stop event set call m_rSessionManager->saveDone(this);            
+		} catch (com::sun::star::uno::Exception& e) {
+			OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8);
+			OSL_ENSURE(sal_False, aMsg.getStr());
+			// save failed, but tell manager to go on if we havent yet dispatched the request
+			if (m_rSessionManager.is() && !bDispatched)
+				m_rSessionManager->saveDone(this);
+		}
+}
 
-void SAL_CALL SessionListener::doSave( sal_Bool bShutdown, sal_Bool /*bCancelable*/ )
+void SAL_CALL SessionListener::doSave( sal_Bool bShutdown, sal_Bool bCancelable )
     throw (RuntimeException)
 {
     if (bShutdown)
     {
-        sal_Bool bDispatched = sal_False;
-        ResetableGuard aGuard(m_aLock);    
-        try 
-        {
-            // xd create SERVICENAME_AUTORECOVERY -> XDispatch
-            // xd->dispatch("vnd.sun.star.autorecovery:/doSessionSave, async=true
-            // on stop event m_rSessionManager->saveDone(this);
-
-            Reference< XDispatch > xDispatch(m_xSMGR->createInstance(SERVICENAME_AUTORECOVERY), UNO_QUERY_THROW);
-            Reference< XURLTransformer > xURLTransformer(m_xSMGR->createInstance(SERVICENAME_URLTRANSFORMER), UNO_QUERY_THROW);
-            URL aURL;
-            aURL.Complete = OUString::createFromAscii("vnd.sun.star.autorecovery:/doSessionSave");
-            xURLTransformer->parseStrict(aURL);
-            xDispatch->addStatusListener(this, aURL);
-            Sequence< PropertyValue > args(1);
-            args[0] = PropertyValue(OUString::createFromAscii("DispatchAsynchron"),-1,makeAny(sal_True),PropertyState_DIRECT_VALUE);
-            xDispatch->dispatch(aURL, args);
-            bDispatched = sal_True;
-            // on stop event set call m_rSessionManager->saveDone(this);            
-        } catch (com::sun::star::uno::Exception& e) {
-            OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8);
-            OSL_ENSURE(sal_False, aMsg.getStr());
-            // save failed, but tell manager to go on if we havent yet dispatched the request
-            if (m_rSessionManager.is() && !bDispatched)
-                m_rSessionManager->saveDone(this);
-        }
+		if (bCancelable) {
+			_requestInteraction();
+		} else {
+			_saveAutorecovery();
+		}
     }
     // we don't have anything to do so tell the session manager we're done
     else if( m_rSessionManager.is() )
@@ -298,58 +304,38 @@ void SAL_CALL SessionListener::doSave( s
 
    
 
-void SAL_CALL SessionListener::approveInteraction( sal_Bool /*bInteractionGranted*/ )
+void SAL_CALL SessionListener::approveInteraction( sal_Bool bInteractionGranted )
     throw (RuntimeException)
 {
-    if (_pcInteract != NULL)
-        osl_setCondition(*_pcInteract);
+	if( bInteractionGranted ) {
+		bool bExit = GetpApp()->QueryExit();
+
+		if( m_rSessionManager.is() )
+			m_rSessionManager->saveDone( this );
+    
+		_finishInteraction( !bExit );
+	} else
+		_saveAutorecovery();
 }
 
 void SessionListener::shutdownCanceled()
     throw (RuntimeException)
 {
-    if (_pcCancelShutdown != NULL)
-        osl_setCondition(*_pcCancelShutdown);
 }
 
-
-
 void SessionListener::_doInteraction(
         const OUString& /*title*/, const OUString& /*url*/, sal_Bool /*bCanceable*/, sal_Bool* /*save*/, sal_Bool* /*cancel*/)
 {
 }
 
-sal_Bool SessionListener::_cancelShutdown()
+void SessionListener::_requestInteraction()
 {
-    oslCondition c = osl_createCondition();
-    _pcCancelShutdown = &c;
-    TimeValue t;
-    t.Seconds = 5;
-    t.Nanosec = 0;
-    m_rSessionManager->cancelShutdown();
-    sal_Bool b = osl_waitCondition(c, &t);
-    _pcCancelShutdown = NULL;
-    osl_destroyCondition(c);
-    return b;
-}
-
-sal_Bool SessionListener::_requestInteraction()
-{
-    oslCondition c = osl_createCondition();
-    _pcInteract = &c;
-    TimeValue t;
-    t.Seconds = 5;
-    t.Nanosec = 0;
     m_rSessionManager->queryInteraction(Reference<XSessionManagerListener>(this));
-    sal_Bool b = osl_waitCondition(c, &t);
-    _pcInteract = NULL;
-    osl_destroyCondition(c);
-    return b;
 }
 
-void SessionListener::_finishInteraction()
+void SessionListener::_finishInteraction( bool bCancelShutdown )
 {
-    m_rSessionManager->interactionDone(Reference< XSessionManagerListener >(this));
+    m_rSessionManager->interactionDone(Reference< XSessionManagerListener >(this), bCancelShutdown );
 }
 
 }
diff -rup offapi/com/sun/star/frame/XSessionManagerClient.idl offapi/com/sun/star/frame/XSessionManagerClient.idl
--- offapi/com/sun/star/frame/XSessionManagerClient.idl	2005-09-08 03:25:36.000000000 +0200
+++ offapi/com/sun/star/frame/XSessionManagerClient.idl	2006-02-20 17:09:58.000000000 +0100
@@ -88,7 +88,7 @@ module com {  module sun {  module star 
 
         @see XSessionManagerListener
         */
-        [oneway] void interactionDone( [in] XSessionManagerListener xListener );
+        [oneway] void interactionDone( [in] XSessionManagerListener xListener, [in] boolean bCancelShutdown );
 
         /** saveDone signals that a listener has processed a save request
 
@@ -98,14 +98,6 @@ module com {  module sun {  module star 
         @see XSessionManagerListener
         */
         [oneway] void saveDone( [in] XSessionManagerListener xListener );
-
-        /** Call cancelShutdown to try to cancel a desktop shutdown in progress
-
-        @returns
-        <TRUE/> if shutdown was canceled,
-        <FALSE/> else.
-        */
-        boolean cancelShutdown();
     };
 
 }; }; }; };
