commit 8abea3b7e94414ce15211590daf193c20d1d7350
Author: Richard Kimberly Heck <[email protected]>
Date:   Wed Apr 25 23:46:13 2018 -0400

    Try to fix bug #10989.
    
    The problem is that popping dialogs during reload can cause paint
    events for which we are not ready. If this does not work, then we
    can introduce a new flag, besides 'busy', for that case. But busy
    does not seem to be used very widely, so hopefully this works.
    
    Note that when paintEvent is triggered on macOS, the least we can do
    is to copy our backing store to the screen.
    
    (cherry picked from commit 19e6977b5b527ec8311da35d8f0a40d6fd509080)
    (cherry picked from commit d03deeca0c666256ea68087c5c70b8de73b66edc)
---
 src/frontends/qt4/GuiWorkArea.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt4/GuiWorkArea.cpp 
b/src/frontends/qt4/GuiWorkArea.cpp
index 7a856ae..d68185c 100644
--- a/src/frontends/qt4/GuiWorkArea.cpp
+++ b/src/frontends/qt4/GuiWorkArea.cpp
@@ -1244,6 +1244,16 @@ 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). 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());
 

Reply via email to