X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/955a919785b76a1826e6b8d55f696a0dfb62a318..1e52188741389278cd99abf79218162c87024ba3:/src/x11/app.cpp diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 57612cd474..7602f5821f 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "app.h" #endif @@ -98,7 +98,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) gs_pfnXErrorHandler = XSetErrorHandler( wxXErrorHandler ); #endif // __WXDEBUG__ - char *displayName = NULL; + wxString displayName; bool syncDisplay = FALSE; int argcOrig = argc; @@ -126,7 +126,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) if (wxSscanf(argv[i], _T("%dx%d"), &w, &h) != 2) { wxLogError( _("Invalid geometry specification '%s'"), - wxString::FromAscii(argv[i]).c_str() ); + wxString(argv[i]).c_str() ); } else { @@ -166,7 +166,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv) } // X11 display stuff - Display *xdisplay = XOpenDisplay( displayName ); + Display *xdisplay; + if ( displayName.empty() ) + xdisplay = XOpenDisplay( NULL ); + else + xdisplay = XOpenDisplay( displayName.ToAscii() ); if (!xdisplay) { wxLogError( _("wxWindows could not open display. Exiting.") ); @@ -785,7 +789,7 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display) Window wxGetWindowParent(Window window) { - wxASSERT_MSG( window, "invalid window" ); + wxASSERT_MSG( window, _T("invalid window") ); return (Window) 0;