[Libreoffice] [PATCH] Use GtkStatusIcon instead of libegg

David Tardon dtardon at redhat.com
Tue Dec 7 01:54:54 PST 2010


> The problem is that SessionManagerClient is only initialized with the
> first sal frame (IOW, GtkSalFrame::Show calls
> SessionManagerClient::open). Obviously, if there has never been any
> frame opened, which, I suppose, happens in a lot of cases, this hadn't
> happened. So the app is not aware that the desktop session is ending and
> continues to run, till it's killed by an XIOError.
> 
> I think the simplest thing here is to run SessionManagerClient::open
> when initializing the quickstarter (the function is exported, so there
> should be no problem with that), but there might be a cleaner solution.
> 

What if we do this when SalSession is created? Does anyone see any
problem with that approach?

D.
-------------- next part --------------
commit d1227b3d8b43ced1ef834bb00aec26a03d76c648
Author: David Tardon <dtardon at redhat.com>
Date:   Tue Dec 7 10:51:36 2010 +0100

    initialize session client when SalSession is created
    
    This avoids crash on end of desktop session if quickstarter is running
    and there has not been any window opened.

diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 39f5f87..9ed4385 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1282,7 +1282,6 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate )
             gtk_window_set_keep_above( GTK_WINDOW(m_pWindow), bVisible );
         if( bVisible )
         {
-            SessionManagerClient::open(); // will simply return after the first time
             initClientId();
             getDisplay()->startupNotificationCompleted();
             
diff --git a/vcl/unx/source/app/sm.cxx b/vcl/unx/source/app/sm.cxx
index 2b26694..5125ed2 100644
--- a/vcl/unx/source/app/sm.cxx
+++ b/vcl/unx/source/app/sm.cxx
@@ -82,6 +82,7 @@ SalSession* X11SalInstance::CreateSalSession()
 {
     if( ! pOneInstance )
         pOneInstance = new IceSalSession();
+    SessionManagerClient::open();
     return pOneInstance;
 }
 
diff --git a/vcl/unx/source/window/salframe.cxx b/vcl/unx/source/window/salframe.cxx
index 4310f2d..839bd03 100644
--- a/vcl/unx/source/window/salframe.cxx
+++ b/vcl/unx/source/window/salframe.cxx
@@ -1152,8 +1152,6 @@ void X11SalFrame::Show( BOOL bVisible, BOOL bNoActivate )
     setXEmbedInfo();
     if( bVisible )
     {
-        SessionManagerClient::open(); // will simply return after the first time
-
         mbInShow = TRUE;
         if( ! (nStyle_ & SAL_FRAME_STYLE_INTRO) )
         {


More information about the LibreOffice mailing list