]> git.saurik.com Git - wxWidgets.git/commitdiff
show the error returned by SmcOpenConnection(); don't call it more than once -- the...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 May 2007 13:41:36 +0000 (13:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 May 2007 13:41:36 +0000 (13:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/utilsgtk.cpp

index 13bc7c448cae90fd89cffe932df7172ce9dda6e9..faf8184ba8e9929b55fd677621740d445f084ef7 100644 (file)
@@ -332,15 +332,19 @@ static wxString GetSM()
     if ( !dpy )
         return wxEmptyString;
 
+    char smerr[256];
     char *client_id;
     SmcConn smc_conn = SmcOpenConnection(NULL, NULL,
                                          999, 999,
                                          0 /* mask */, NULL /* callbacks */,
                                          NULL, &client_id,
-                                         0, NULL);
+                                         WXSIZEOF(smerr), smerr);
 
     if ( !smc_conn )
+    {
+        wxLogWarning(_("Failed to connect to session manager: %s"), smerr);
         return wxEmptyString;
+    }
 
     char *vendor = SmcVendor(smc_conn);
     wxString ret = wxString::FromAscii( vendor );
@@ -471,7 +475,7 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg)
 wxString wxGUIAppTraits::GetDesktopEnvironment() const
 {
 #if wxUSE_DETECT_SM
-    const wxString SM = GetSM();
+    static const wxString SM = GetSM();
 
     if (SM == wxT("GnomeSM"))
         return wxT("GNOME");