]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiApplication.cpp
Disable CheckTeX while buffer is processed
[lyx.git] / src / frontends / qt4 / GuiApplication.cpp
index 9a5fc93a6978c31bf8a06aa322b42a4c1e3aa8d9..35b639c9ac490e27e09ee25c123afce961eb9840 100644 (file)
@@ -1407,7 +1407,7 @@ DispatchResult const & GuiApplication::dispatch(FuncRequest const & cmd)
        updateCurrentView(cmd, dr);
 
        // the buffer may have been closed by one action
-       if (theBufferList().isLoaded(buffer))
+       if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer))
                buffer->undo().endUndoGroup();
 
        d->dispatch_result_ = dr;
@@ -1883,7 +1883,7 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        dispatch(func);
                }
                // the buffer may have been closed by one action
-               if (theBufferList().isLoaded(buffer))
+               if (theBufferList().isLoaded(buffer) || theBufferList().isInternal(buffer))
                        buffer->undo().endUndoGroup();
                break;
        }
@@ -2070,9 +2070,8 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                        if (current_view_ == 0)
                                createView();
                }
-               // fall through
        }
-
+       // fall through
        default:
                // The LFUN must be for one of GuiView, BufferView, Buffer or Cursor;
                // let's try that:
@@ -2290,8 +2289,12 @@ void GuiApplication::processFuncRequestAsync(FuncRequest const & func)
 void GuiApplication::processFuncRequestQueue()
 {
        while (!d->func_request_queue_.empty()) {
-               processFuncRequest(d->func_request_queue_.front());
+               // take the item from the stack _before_ processing the
+               // request in order to avoid race conditions from nested
+               // or parallel requests (see #10406)
+               FuncRequest const fr(d->func_request_queue_.front());
                d->func_request_queue_.pop();
+               processFuncRequest(fr);
        }
 }