summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2010-11-22 09:28:34 +0100
committerDavid Tardon <dtardon@redhat.com>2010-11-22 09:50:48 +0100
commit5dfa2bcf6f4a7699c2acae87caa96de739f82636 (patch)
tree3460e0abf6362741d9d8e8abe8f407898f5806db /sfx2
parent43a9042c5062374d8a7d787a5df7652b1b471682 (diff)
rhbz#650170# shutdown quickstarter at end of desktop session
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/shutdowniconunx.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx
index 510c6ca967..3bb5b7729c 100644
--- a/sfx2/source/appl/shutdowniconunx.cxx
+++ b/sfx2/source/appl/shutdowniconunx.cxx
@@ -66,11 +66,14 @@ static void systray_disable_cb()
static void exit_quickstarter_cb( GtkWidget * )
{
- egg_tray_icon_cancel_message (pTrayIcon, 1 );
- plugin_shutdown_sys_tray();
- //terminate may cause this .so to be unloaded. So we must be hands off
- //all calls into this .so after this call
- ShutdownIcon::terminateDesktop();
+ if (pTrayIcon)
+ {
+ egg_tray_icon_cancel_message (pTrayIcon, 1 );
+ plugin_shutdown_sys_tray();
+ //terminate may cause this .so to be unloaded. So we must be hands off
+ //all calls into this .so after this call
+ ShutdownIcon::terminateDesktop();
+ }
}
static void menu_deactivate_cb( GtkWidget *pMenu )
@@ -396,6 +399,9 @@ void SAL_DLLPUBLIC_EXPORT plugin_init_sys_tray()
// disable shutdown
pShutdownIcon->SetVeto( true );
pShutdownIcon->addTerminateListener();
+
+ g_signal_connect(GTK_WIDGET(pTrayIcon), "destroy",
+ G_CALLBACK(exit_quickstarter_cb), NULL);
}
void SAL_DLLPUBLIC_EXPORT plugin_shutdown_sys_tray()