8076325
diff -r 3c24aa9a7810 desktop/source/app/cmdlineargs.cxx
8076325
--- a/desktop/source/app/cmdlineargs.cxx	Sat Jan 23 16:31:03 2010 +0000
8076325
+++ b/desktop/source/app/cmdlineargs.cxx	Tue Feb 02 13:59:39 2010 +0000
8076325
@@ -396,7 +396,7 @@
8076325
 	}
8076325
 	else if ( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-quickstart" )) == sal_True )
8076325
 	{
8076325
-#if defined(WNT) || defined(OS2) || defined(QUARTZ)
8076325
+#if defined(ENABLE_QUICKSTART_APPLET)
8076325
 		SetBoolParam_Impl( CMD_BOOLPARAM_QUICKSTART, sal_True );
8076325
 #endif
8076325
         SetBoolParam_Impl( CMD_BOOLPARAM_NOQUICKSTART, sal_False );
8076325
diff -r 3c24aa9a7810 desktop/source/app/makefile.mk
8076325
--- a/desktop/source/app/makefile.mk	Sat Jan 23 16:31:03 2010 +0000
8076325
+++ b/desktop/source/app/makefile.mk	Tue Feb 02 13:59:39 2010 +0000
8076325
@@ -53,6 +53,10 @@
8076325
 # DEPLOYMENTMISCLIB = -ldeploymentmisc$(DLLPOSTFIX)
8076325
 # .ENDIF
8076325
 
8076325
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2" || "$(GUIBASE)"=="aqua" || "$(ENABLE_SYSTRAY_GTK)"=="TRUE"
8076325
+CFLAGS+=-DENABLE_QUICKSTART_APPLET
8076325
+.ENDIF
8076325
+
8076325
 SHL1TARGET = sofficeapp
8076325
 SHL1OBJS = \
8076325
     $(SLO)$/app.obj \
8076325
diff -r 3c24aa9a7810 sfx2/source/appl/shutdownicon.cxx
8076325
--- a/sfx2/source/appl/shutdownicon.cxx	Sat Jan 23 16:31:03 2010 +0000
8076325
+++ b/sfx2/source/appl/shutdownicon.cxx	Tue Feb 02 13:59:39 2010 +0000
8076325
@@ -555,8 +555,8 @@
8076325
         return;
8076325
         
8076325
     // always remove ourselves as listener
8076325
+    pInst->m_bListenForTermination = true;
8076325
     xDesktop->removeTerminateListener( pInst );
8076325
-    pInst->m_bListenForTermination = true;
8076325
 
8076325
     // terminate desktop only if no tasks exist
8076325
     Reference< XFramesSupplier > xSupplier( xDesktop, UNO_QUERY );
8076325
diff -r 3c24aa9a7810 sfx2/source/appl/shutdowniconunx.cxx
8076325
--- a/sfx2/source/appl/shutdowniconunx.cxx	Sat Jan 23 16:31:03 2010 +0000
8076325
+++ b/sfx2/source/appl/shutdowniconunx.cxx	Tue Feb 02 13:59:39 2010 +0000
8076325
@@ -39,6 +39,7 @@
8076325
 static EggTrayIcon *pTrayIcon;
8076325
 static GtkWidget *pExitMenuItem = NULL;
8076325
 static GtkWidget *pOpenMenuItem = NULL;
8076325
+static GtkWidget *pDisableMenuItem = NULL;
8076325
 
8076325
 static void open_url_cb( GtkWidget *, gpointer data )
8076325
 {
8076325
@@ -67,8 +68,10 @@
8076325
 static void exit_quickstarter_cb( GtkWidget * )
8076325
 {
8076325
 	egg_tray_icon_cancel_message (pTrayIcon, 1 );
8076325
-	ShutdownIcon::getInstance()->terminateDesktop();
8076325
 	plugin_shutdown_sys_tray();
8076325
+	//terminate may cause this .so to be unloaded. So we must be hands off
8076325
+	//all calls into this .so after this call
8076325
+	ShutdownIcon::terminateDesktop();
8076325
 }
8076325
 
8076325
 static void menu_deactivate_cb( GtkWidget *pMenu )
8076325
@@ -265,7 +268,7 @@
8076325
 	pMenuItem = gtk_separator_menu_item_new();
8076325
 	gtk_menu_shell_append( pMenuShell, pMenuItem );
8076325
 
8076325
-	(void) add_image_menu_item
8076325
+	pDisableMenuItem = add_image_menu_item
8076325
         ( pMenuShell, GTK_STOCK_CLOSE,
8076325
 		  pShutdownIcon->GetResString( STR_QUICKSTART_PRELAUNCH_UNX ),
8076325
 		  G_CALLBACK( systray_disable_cb ) );
8076325
@@ -289,6 +292,7 @@
8076325
 	bool bModal = ShutdownIcon::bModalMode;
8076325
 	gtk_widget_set_sensitive( pExitMenuItem, !bModal);
8076325
 	gtk_widget_set_sensitive( pOpenMenuItem, !bModal);
8076325
+	gtk_widget_set_sensitive( pDisableMenuItem, !bModal);
8076325
 }
8076325
 
8076325
 extern "C" {
8076325
@@ -404,6 +409,7 @@
8076325
 	pTrayIcon = NULL;
8076325
 	pExitMenuItem = NULL;
8076325
 	pOpenMenuItem = NULL;
8076325
+	pDisableMenuItem = NULL;
8076325
 }
8076325
 
8076325
 #endif // ENABLE_QUICKSTART_APPLET