summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qwindowsurface_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qwindowsurface_x11.cpp')
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 46c4c42..77e019c 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -94,6 +94,8 @@ QPaintDevice *QX11WindowSurface::paintDevice()
void QX11WindowSurface::beginPaint(const QRegion &rgn)
{
#ifndef QT_NO_XRENDER
+ Q_ASSERT(!d_ptr->device.isNull());
+
if (d_ptr->translucentBackground) {
if (d_ptr->device.depth() != 32)
static_cast<QX11PixmapData *>(d_ptr->device.data_ptr().data())->convertToARGB32();
@@ -157,8 +159,8 @@ void QX11WindowSurface::setGeometry(const QRect &rect)
QPixmap::x11SetDefaultScreen(d_ptr->widget->x11Info().screen());
QX11PixmapData *oldData = static_cast<QX11PixmapData *>(d_ptr->device.pixmapData());
- Q_ASSERT(oldData);
- if (!(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) {
+
+ if (oldData && !(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) {
// Copy the content of the old pixmap into the new one.
QX11PixmapData *newData = new QX11PixmapData(QPixmapData::PixmapType);
newData->resize(size.width(), size.height());