If we were not ready to paint the screen, this does not mean that we
should give up on repainting, just potpone it.
I thought that it was bad to call update() in the paint event, but I
cannot find reference to this anymore and everything seems to work as
intended.
// backing store has to be copied to screen (this is a no-op
// except on macOS).
d->updateScreen(ev->rect());
// backing store has to be copied to screen (this is a no-op
// except on macOS).
d->updateScreen(ev->rect());
+ // Ignore this paint event, but request a new one for later.
+ viewport()->update();