X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad81651f00edc6f489d9b6a0839d316a964fd521..b6c588e1a65704bd5f3707b0e691a957ad43a148:/src/motif/app.cpp diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 916c8b9419..53b01e0f35 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -68,6 +68,18 @@ BEGIN_EVENT_TABLE(wxApp, wxEvtHandler) EVT_IDLE(wxApp::OnIdle) END_EVENT_TABLE() +#ifdef __WXDEBUG__ + typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *); + + XErrorHandlerFunc gs_pfnXErrorHandler = 0; + + static int wxXErrorHandler(Display *dpy, XErrorEvent *xevent) + { + // just forward to the default handler for now + return gs_pfnXErrorHandler(dpy, xevent); + } +#endif // __WXDEBUG__ + long wxApp::sm_lastMessageTime = 0; bool wxApp::Initialize() @@ -575,6 +587,11 @@ bool wxApp::OnInitGui() } m_initialDisplay = (WXDisplay*) dpy; +#ifdef __WXDEBUG__ + // install the X error handler + gs_pfnXErrorHandler = XSetErrorHandler(wxXErrorHandler); +#endif // __WXDEBUG__ + wxTheApp->m_topLevelWidget = (WXWidget) XtAppCreateShell((String)NULL, (const char*) wxTheApp->GetClassName(), applicationShellWidgetClass,dpy, NULL,0) ;