summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xlib/qxlibwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xlib/qxlibwindow.cpp')
-rw-r--r--src/plugins/platforms/xlib/qxlibwindow.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/xlib/qxlibwindow.cpp b/src/plugins/platforms/xlib/qxlibwindow.cpp
index 90bcc0d9d5..4efcb1101c 100644
--- a/src/plugins/platforms/xlib/qxlibwindow.cpp
+++ b/src/plugins/platforms/xlib/qxlibwindow.cpp
@@ -102,18 +102,27 @@ QXlibWindow::QXlibWindow(QWidget *window)
visualInfo = XGetVisualInfo(mScreen->display()->nativeDisplay(), VisualIDMask, &visualInfoTemplate, &matchingCount);
#endif //!defined(QT_OPENGL_ES_2)
if (visualInfo) {
- Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(),mScreen->rootWindow(),visualInfo->visual,AllocNone);
+ mDepth = visualInfo->depth;
+ mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ mVisual = visualInfo->visual;
+ Colormap cmap = XCreateColormap(mScreen->display()->nativeDisplay(), mScreen->rootWindow(), visualInfo->visual, AllocNone);
XSetWindowAttributes a;
+ a.background_pixel = WhitePixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
+ a.border_pixel = BlackPixel(mScreen->display()->nativeDisplay(), mScreen->xScreenNumber());
a.colormap = cmap;
x_window = XCreateWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),x, y, w, h,
0, visualInfo->depth, InputOutput, visualInfo->visual,
- CWColormap, &a);
+ CWBackPixel|CWBorderPixel|CWColormap, &a);
} else {
qFatal("no window!");
}
#endif //!defined(QT_NO_OPENGL)
} else {
+ mDepth = mScreen->depth();
+ mFormat = (mDepth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ mVisual = mScreen->defaultVisual();
+
x_window = XCreateSimpleWindow(mScreen->display()->nativeDisplay(), mScreen->rootWindow(),
x, y, w, h, 0 /*border_width*/,
mScreen->blackPixel(), mScreen->whitePixel());