Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88E41DFE5 for ; Sun, 1 Jul 2012 14:27:24 +0000 (UTC) Received: (qmail 37849 invoked by uid 500); 1 Jul 2012 14:27:23 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 37647 invoked by uid 500); 1 Jul 2012 14:27:18 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 37602 invoked by uid 99); 1 Jul 2012 14:27:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 14:27:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2012 14:27:14 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7DDB723889D5; Sun, 1 Jul 2012 14:26:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: ooo-commits@incubator.apache.org From: arielch@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120701142653.7DDB723889D5@eris.apache.org> 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 #include #include +#include +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 )