Verify that the Shadow has a valid size before trying to create it

Summary:
The problem of the badly rendered shadows in case of opening kickoff
twice on Wayland is related to this. In that situation both the
width and height are 0. The rendering to the image fails and creating
the texture fails. This causes the flickering we see during rendering.

This change now discards such a shadow with an invalid size. This is
not fixing the actual problem of the shadow, but rather the symptom.

Nevertheless it's an important change as it makes it at least not
look fully broken.

Reviewers: #kwin, #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D1790
remotes/origin/Plasma/5.7
Martin Gräßlin 10 years ago
parent c65c9728d1
commit d16d77f7fe
  1. 4
      scene_opengl.cpp

@ -2381,6 +2381,10 @@ bool SceneOpenGLShadow::prepareBackend()
const int width = topLeft.width() + top.width() + topRight.width();
const int height = topLeft.height() + left.height() + bottomLeft.height();
if (width == 0 || height == 0) {
return false;
}
QImage image(width, height, QImage::Format_ARGB32);
image.fill(Qt::transparent);
QPainter p;

Loading…
Cancel
Save