From d03deeca0c666256ea68087c5c70b8de73b66edc Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 14 May 2018 09:46:54 +0200 Subject: [PATCH] Avoid black screen on macOS When paintEvent is triggered on macOS, the least we can do is to copy our backing store to the screen. --- src/frontends/qt4/GuiWorkArea.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 7c80fcce42..d4010a9b4c 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1247,9 +1247,15 @@ void GuiWorkArea::Private::paintPreeditText(GuiPainter & pain) void GuiWorkArea::paintEvent(QPaintEvent * ev) { - // Hopefully fixes bug #10989. - if (view().busy()) + // Do not trigger the painting machinery if we are not ready (see + // bug #10989). However, since macOS has turned the screen black at + // this point, our backing store has to be copied to screen. + if (view().busy()) { + // 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()); -- 2.39.5