]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/app.cpp
fixed wxMBConv_iconv to work with UTF-16/32
[wxWidgets.git] / src / motif / app.cpp
index 1b899d82cad8f69a62bc8e1e198fe525274a152e..d6c6206c93fe9474dc1009a6b4d4b1beabcf6a2a 100644 (file)
@@ -247,8 +247,20 @@ bool wxApp::OnInitGui()
     wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
     XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
 
-    Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,(String)NULL,NULL,
-        wxTheApp->GetClassName().c_str(), NULL, 0,
+    // we shouldn't pass empty application/class name as it results in
+    // immediate crash inside XOpenIM() (if XIM is used) under IRIX
+    wxString appname = wxTheApp->GetAppName();
+    if ( appname.empty() )
+        appname = _T("wxapp");
+    wxString clsname = wxTheApp->GetClassName();
+    if ( clsname.empty() )
+        clsname = _T("wx");
+
+    Display *dpy = XtOpenDisplay((XtAppContext) wxTheApp->m_appContext,
+        (String)NULL,
+        appname.c_str(),
+        clsname.c_str(),
+        NULL, 0,    // no options
 # if XtSpecificationRelease < 5
         (Cardinal*) &argc,
 # else
@@ -362,7 +374,7 @@ WXWidget wxCreateTopLevelRealizedWidget( WXDisplay* WXUNUSED(display) )
 {
     Widget rTlw = XtVaCreateWidget( "dummy_widget", topLevelShellWidgetClass,
                                     (Widget)wxTheApp->GetTopLevelWidget(),
-                                     NULL, 0 );
+                                     NULL );
     XtSetMappedWhenManaged( rTlw, False );
     XtRealizeWidget( rTlw );