Commit 99005e254b6055e63fc432efd38b9a5a2d0ffcc9
Fixed passing a zero drawable to X11 api causing X errors.
In the windowsurface we shouldn't create a backingstore pixmap if the
window has invalid size.
Reviewed-by: Samuel
| |   |
| 139 | 139 | QWindowSurface::setGeometry(rect); |
| 140 | 140 | |
| 141 | 141 | const QSize size = rect.size(); |
| if (d_ptr->device.size() == size) |
|
| if (d_ptr->device.size() == size || size.width() <= 0 || size.height() <= 0) |
| 143 | 144 | return; |
| 144 | 145 | #ifndef QT_NO_XRENDER |
| 145 | 146 | if (d_ptr->translucentBackground) { |
| … | … | |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| if (gc) |
| if (gc) { |
| 188 | 188 | XFreeGC(X11->display, gc); |
| gc = XCreateGC(X11->display, d_ptr->device.handle(), 0, 0); |
| XSetGraphicsExposures(X11->display, gc, False); |
| gc = 0; |
| } |
| if (!d_ptr->device.isNull()) { |
| gc = XCreateGC(X11->display, d_ptr->device.handle(), 0, 0); |
| XSetGraphicsExposures(X11->display, gc, False); |
| } |
| 191 | 195 | } |
| 192 | 196 | |
| 193 | 197 | bool QX11WindowSurface::scroll(const QRegion &area, int dx, int dy) |