X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e39af974ef7846e26686ae39d74e4696c1fef0c3..f58fc1407b9d1f6db80943338714242d87b766d0:/src/x11/app.cpp diff --git a/src/x11/app.cpp b/src/x11/app.cpp index ff91c2fb6b..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 @@ -88,7 +88,7 @@ WXDisplay *wxApp::ms_display = NULL; IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler) BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) - EVT_IDLE(wxApp::OnIdle) + EVT_IDLE(wxAppBase::OnIdle) END_EVENT_TABLE() bool wxApp::Initialize(int& argc, wxChar **argv) @@ -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.") ); @@ -700,32 +704,6 @@ bool wxApp::HandlePropertyChange(WXEvent *event) return FALSE; } -void wxApp::OnIdle(wxIdleEvent& event) -{ - static bool s_inOnIdle = FALSE; - - // Avoid recursion (via ProcessEvent default case) - if (s_inOnIdle) - return; - - s_inOnIdle = TRUE; - - // Resend in the main thread events which have been prepared in other - // threads - ProcessPendingEvents(); - - // 'Garbage' collection of windows deleted with Close() - DeletePendingObjects(); - - // Send OnIdle events to all windows - bool needMore = SendIdleEvents(); - - if (needMore) - event.RequestMore(TRUE); - - s_inOnIdle = FALSE; -} - void wxApp::WakeUpIdle() { // TODO: use wxMotif implementation? @@ -811,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;