X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fad0dfda86d2d74f605ae050b294abaa94d1f58..baa9ebc473dba4e4ca0c4f288e6ed7c8c277295e:/src/motif/app.cpp diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 1b899d82ca..4fa8fbcc8f 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -18,20 +18,24 @@ #endif #include "wx/app.h" -#include "wx/utils.h" -#include "wx/module.h" -#include "wx/memory.h" -#include "wx/log.h" -#include "wx/intl.h" + +#ifndef WX_PRECOMP + #include "wx/hash.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/utils.h" + #include "wx/memory.h" + #include "wx/font.h" +#endif + #include "wx/evtloop.h" -#include "wx/hash.h" #if wxUSE_THREADS #include "wx/thread.h" #endif #ifdef __VMS__ -#pragma message disable nosimpint + #pragma message disable nosimpint #endif #include #include @@ -39,7 +43,7 @@ #include #include #ifdef __VMS__ -#pragma message enable nosimpint + #pragma message enable nosimpint #endif #include "wx/motif/private.h" @@ -63,7 +67,6 @@ static void wxTLWidgetDestroyCallback(Widget w, XtPointer clientData, XtPointer ptr); static WXWidget wxCreateTopLevelWidget( WXDisplay* display ); -extern wxList wxPendingDelete; extern bool wxAddIdleCallback(); wxHashTable *wxWidgetHashTable = NULL; @@ -247,8 +250,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 +377,7 @@ WXWidget wxCreateTopLevelRealizedWidget( WXDisplay* WXUNUSED(display) ) { Widget rTlw = XtVaCreateWidget( "dummy_widget", topLevelShellWidgetClass, (Widget)wxTheApp->GetTopLevelWidget(), - NULL, 0 ); + NULL ); XtSetMappedWhenManaged( rTlw, False ); XtRealizeWidget( rTlw );