]> git.lyx.org Git - features.git/commitdiff
Avoid black screen on macOS
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 14 May 2018 07:46:54 +0000 (09:46 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 15 May 2018 08:22:03 +0000 (10:22 +0200)
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

index 7c80fcce42faffda7bc9c10d1d714c2fd881c818..d4010a9b4c02a093b66d40c60718f9cee2a8cd8b 100644 (file)
@@ -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());