incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1355915 - in /incubator/ooo/trunk/main/sfx2/source/appl: shutdownicon.cxx shutdownicon.hxx shutdowniconunx.cxx
Date Sun, 01 Jul 2012 14:26:53 GMT
Author: arielch
Date: Sun Jul  1 14:26:52 2012
New Revision: 1355915

URL: http://svn.apache.org/viewvc?rev=1355915&view=rev
Log:
i120095 - Asynchronous Desktop termination

Modified:
    incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.cxx
    incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.hxx
    incubator/ooo/trunk/main/sfx2/source/appl/shutdowniconunx.cxx

Modified: incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.cxx?rev=1355915&r1=1355914&r2=1355915&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.cxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.cxx Sun Jul  1 14:26:52 2012
@@ -190,6 +190,15 @@ bool ShutdownIcon::LoadModule( osl::Modu
 	return true;
 }
 
+
+struct AsyncDesktopTerminationData
+{
+    Reference< XDesktop > mxDesktop;
+    AsyncDesktopTerminationData( const Reference< XDesktop > &xDesktop )
+    : mxDesktop( xDesktop ) {}
+};
+
+
 class IdleUnloader : Timer
 {
     ::osl::Module *m_pModule;
@@ -584,10 +593,11 @@ void ShutdownIcon::terminateDesktop()
     if ( xSupplier.is() )
     {
         Reference< XIndexAccess > xTasks ( xSupplier->getFrames(), UNO_QUERY );
-        if( xTasks.is() )
+        if( xTasks.is() && xTasks->getCount() < 1 )
         {
-            if( xTasks->getCount() < 1 )
-                xDesktop->terminate();
+            AsyncDesktopTerminationData * pData = new AsyncDesktopTerminationData( xDesktop
);
+            if ( !Application::PostUserEvent( STATIC_LINK( 0, ShutdownIcon, AsyncDesktopTermination
), pData ) )
+                delete pData;
         }
     }
 
@@ -595,6 +605,17 @@ void ShutdownIcon::terminateDesktop()
     ShutdownIcon::pShutdownIcon = 0;
 }
 
+
+IMPL_STATIC_LINK_NOINSTANCE( ShutdownIcon, AsyncDesktopTermination, AsyncDesktopTerminationData*,
pData )
+{
+    if ( pData && pData->mxDesktop.is() )
+        pData->mxDesktop->terminate();
+    delete pData;
+    return 0;
+}
+
+
+
 // ---------------------------------------------------------------------------
 
 ShutdownIcon* ShutdownIcon::getInstance()

Modified: incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.hxx?rev=1355915&r1=1355914&r2=1355915&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.hxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/appl/shutdownicon.hxx Sun Jul  1 14:26:52 2012
@@ -44,7 +44,9 @@
 #include <sfx2/sfxuno.hxx>
 #include <cppuhelper/compbase4.hxx>
 #include <sfx2/dllapi.h>
+#include <tools/link.hxx>
 
+struct AsyncDesktopTerminationData;
 class ResMgr;
 namespace sfx2
 {
@@ -102,6 +104,8 @@ class SFX2_DLLPUBLIC ShutdownIcon :	publ
 
 		virtual ~ShutdownIcon();
 
+        DECL_STATIC_LINK( ShutdownIcon, AsyncDesktopTermination, AsyncDesktopTerminationData*
);
+
         SFX_DECL_XSERVICEINFO
 
 		static ShutdownIcon* getInstance();

Modified: incubator/ooo/trunk/main/sfx2/source/appl/shutdowniconunx.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sfx2/source/appl/shutdowniconunx.cxx?rev=1355915&r1=1355914&r2=1355915&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sfx2/source/appl/shutdowniconunx.cxx (original)
+++ incubator/ooo/trunk/main/sfx2/source/appl/shutdowniconunx.cxx Sun Jul  1 14:26:52 2012
@@ -87,8 +87,8 @@ static void systray_disable_cb()
 
 static void exit_quickstarter_cb( GtkWidget * )
 {
-	ShutdownIcon::getInstance()->terminateDesktop();
 	plugin_shutdown_sys_tray();
+    ShutdownIcon::getInstance()->terminateDesktop();
 }
 
 static void menu_deactivate_cb( GtkWidget *pMenu )



Mime
View raw message