// X11 error handling
//------------------------------------------------------------------------
-#ifdef __WXDEBUG__
typedef int (*XErrorHandlerFunc)(Display *, XErrorEvent *);
XErrorHandlerFunc gs_pfnXErrorHandler = 0;
else
return 0;
}
-#endif // __WXDEBUG__
//------------------------------------------------------------------------
// wxApp
bool wxApp::Initialize(int& argC, wxChar **argV)
{
-#if defined(__WXDEBUG__) && !wxUSE_NANOX
+#if !wxUSE_NANOX
// install the X error handler
gs_pfnXErrorHandler = XSetErrorHandler( wxXErrorHandler );
-#endif // __WXDEBUG__
+#endif
wxString displayName;
bool syncDisplay = false;
return false;
}
-#ifdef __WXDEBUG__
- wxString windowClass = win->GetClassInfo()->GetClassName();
-#endif
switch (event->type)
{
}
#if !wxUSE_NANOX
case PropertyNotify:
- {
- //wxLogDebug("PropertyNotify: %s", windowClass.c_str());
return HandlePropertyChange(_event);
- }
+
case ClientMessage:
{
if (!win->IsEnabled())
return win->HandleWindowEvent(focusEvent);
}
return false;
-
-#ifdef __WXDEBUG__
- default:
- //wxString eventName = wxGetXEventName(XEvent& event);
- //wxLogDebug(wxT("Event %s not handled"), eventName.c_str());
- break;
-#endif // __WXDEBUG__
}
return false;
wxAppConsole::Exit();
}
-// Yield to other processes
-
-bool wxApp::DoYield(bool onlyIfNeeded, long eventsToProcess)
-{
- // Sometimes only 2 yields seem
- // to do the trick, e.g. in the
- // progress dialog
- int i;
- for (i = 0; i < 2; i++)
- {
- if ( m_isInsideYield )
- {
- if ( !onlyIfNeeded )
- {
- wxFAIL_MSG( wxT("wxYield called recursively" ) );
- }
-
- return false;
- }
-
- m_isInsideYield = true;
- m_eventsToProcessInsideYield = eventsToProcess;
-
- // Make sure we have an event loop object,
- // or Pending/Dispatch will fail
- wxEventLoopGuarantor dummyLoopIfNeeded;
-
- // Call dispatch at least once so that sockets
- // can be tested
- wxTheApp->Dispatch();
-
- // TODO: implement event filtering using the eventsToProcess mask
- while (wxTheApp && wxTheApp->Pending())
- wxTheApp->Dispatch();
-
-#if wxUSE_TIMER
- wxGenericTimerImpl::NotifyTimers();
-#endif
- ProcessIdle();
-
- m_isInsideYield = false;
- }
-
- return true;
-}
-
-#ifdef __WXDEBUG__
-
-void wxApp::OnAssert(const wxChar *file, int line, const wxChar* cond, const wxChar *msg)
-{
- // While the GUI isn't working that well, just print out the
- // message.
-#if 1
- wxAppBase::OnAssert(file, line, cond, msg);
-#else
- wxString msg2;
- msg2.Printf("At file %s:%d: %s", file, line, msg);
- wxLogDebug(msg2);
-#endif
-}
-
-#endif // __WXDEBUG__