diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index 31998ed02..659f7124e 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -1491,16 +1491,15 @@ GuiApplication::process_events_impl (QEventLoop::ProcessEventsFlags flags, bool return; } - if (silent && tl::DeferredMethodScheduler::instance ()) { - tl::DeferredMethodScheduler::instance ()->enable (false); + if (silent) { + tl::DeferredMethodScheduler::enable (false); } -#if QT_VERSION < 0x050000 - QApplication::syncX (); -#endif - mp_mw->enter_busy_mode (true); try { +#if QT_VERSION < 0x050000 + QApplication::syncX (); +#endif QApplication::processEvents (flags); // Qt seems not to send posted UserEvents in some cases (e.g. in the unit test application with GLib? // Glib not doing this without a main window visible?). Hence we do this explicitly here. @@ -1510,8 +1509,8 @@ GuiApplication::process_events_impl (QEventLoop::ProcessEventsFlags flags, bool } mp_mw->enter_busy_mode (false); - if (silent && tl::DeferredMethodScheduler::instance ()) { - tl::DeferredMethodScheduler::instance ()->enable (true); + if (silent) { + tl::DeferredMethodScheduler::enable (true); } } diff --git a/src/lay/lay/layLogViewerDialog.cc b/src/lay/lay/layLogViewerDialog.cc index 27b8ce6db..fbc175204 100644 --- a/src/lay/lay/layLogViewerDialog.cc +++ b/src/lay/lay/layLogViewerDialog.cc @@ -254,6 +254,12 @@ LogFile::add (LogFileEntry::mode_type mode, const std::string &msg, bool continu void LogFile::yield () { +#if 0 + // This looked like a good idea, but in fact it introduces a hell lot of instability + // as it potentially leads to a recursion of events inside innocent functions. Remember + // that log output may be generated from every function called in response of an event + // and not every such function may process further events + bool can_yield = false; { @@ -268,10 +274,10 @@ LogFile::yield () // use this opportunity to process events // NOTE: as process events may trigger further log output, it's necessary to do process events outside any other // method (e.g. add) which is subject to locking. Hence we avoid deadlocks. - // We accept the risk of recursion inside process_events as we have a timeout before accepting new yield calls. if (can_yield) { - lay::ApplicationBase::instance ()->process_events (QEventLoop::AllEvents); + lay::ApplicationBase::instance ()->process_events (QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, true /*silent*/); } +#endif } int