diff options
Diffstat (limited to 'src/gui/image/qnativeimage.cpp')
-rw-r--r-- | src/gui/image/qnativeimage.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/image/qnativeimage.cpp b/src/gui/image/qnativeimage.cpp index aebcbaf..e1382dd 100644 --- a/src/gui/image/qnativeimage.cpp +++ b/src/gui/image/qnativeimage.cpp @@ -153,7 +153,12 @@ QImage::Format QNativeImage::systemFormat() QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* isTextBuffer */, QWidget *widget) : xshmimg(0), xshmpm(0) { - if (!X11->use_mitshm) { + QX11Info info = widget->x11Info(); + + int dd = info.depth(); + Visual *vis = (Visual*) info.visual(); + + if (!X11->use_mitshm || format != QImage::Format_RGB16 && X11->bppForDepth.value(dd) != 32) { image = QImage(width, height, format); // follow good coding practice and set xshminfo attributes, though values not used in this case xshminfo.readOnly = true; @@ -163,11 +168,6 @@ QNativeImage::QNativeImage(int width, int height, QImage::Format format,bool /* return; } - QX11Info info = widget->x11Info(); - - int dd = info.depth(); - Visual *vis = (Visual*) info.visual(); - xshmimg = XShmCreateImage(X11->display, vis, dd, ZPixmap, 0, &xshminfo, width, height); if (!xshmimg) { qWarning("QNativeImage: Unable to create shared XImage."); |