generateSyntheticMouseEvent();
});
+ d->resetScreen();
// With Qt4.5 a mouse event will happen before the first paint event
// so make sure that the buffer view has an up to date metrics.
d->buffer_view_->resize(viewport()->width(), viewport()->height());
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());
- if (d->need_resize_ || pixelRatio() != d->last_pixel_ratio_)
+ if (d->need_resize_ || pixelRatio() != d->last_pixel_ratio_) {
+ d->resetScreen();
d->resizeBufferView();
+ }
d->last_pixel_ratio_ = pixelRatio();
- GuiPainter pain(viewport(), pixelRatio());
+ GuiPainter pain(d->screenDevice(), pixelRatio());
+
d->buffer_view_->draw(pain, d->caret_visible_);
// The preedit text, if needed
// and the caret
if (d->caret_visible_)
d->caret_->draw(pain);
+
+ d->updateScreen(ev->rect());
+
ev->accept();
}
d->buffer_view_->cursor().insert(qstring_to_ucs4(e->commitString()));
d->buffer_view_->updateMetrics();
d->buffer_view_->cursor().endUndoGroup();
+ d->updateCaretGeometry();
viewport()->update();
}