]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiWorkArea.cpp
Use QMessageBox for toggleWarning if possible
[lyx.git] / src / frontends / qt4 / GuiWorkArea.cpp
index 6df7e4e2909b51caf81d907f5027ff7b5fc3a699..5835cbd9b63e061f4fa38025978fab506c460d41 100644 (file)
@@ -1244,6 +1244,18 @@ void GuiWorkArea::Private::paintPreeditText(GuiPainter & pain)
 
 void GuiWorkArea::paintEvent(QPaintEvent * ev)
 {
+       // Do not trigger the painting machinery if we are not ready (see
+       // bug #10989). The second test triggers when in the middle of a
+       // dispatch operation.
+       if (view().busy() || d->buffer_view_->buffer().undo().activeUndoGroup()) {
+               // Since macOS has turned the screen black at this point, our
+               // backing store has to be copied to screen (this is a no-op
+               // except on macOS).
+               d->updateScreen(ev->rect());
+               ev->accept();
+               return;
+       }
+
        // LYXERR(Debug::PAINTING, "paintEvent begin: x: " << rc.x()
        //      << " y: " << rc.y() << " w: " << rc.width() << " h: " << rc.height());
 
@@ -1282,6 +1294,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
                d->buffer_view_->cursor().insert(qstring_to_ucs4(e->commitString()));
                d->buffer_view_->updateMetrics();
                d->buffer_view_->cursor().endUndoGroup();
+               d->updateCaretGeometry();
                viewport()->update();
        }