diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-03 14:35:09 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-03 14:35:09 +0200 |
commit | 7e4116cc8a54e9e46c7bb4c96a54fb96ab38f3d5 (patch) | |
tree | e8e21bcaeb871711daf7e0b0694e92c9d7d15414 /src/plugins/platforms/xcb | |
parent | a9910abac9b3c9cf5aa532ca9d3e62e6cae0b839 (diff) |
Basic QDesktopWidget support.
Makes it possible to use grabWindow on the desktop widget with the xcb
plugin, which gives us a few more passing tests in tst_QWidget.
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 81822474a4..9d6f3e01ad 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -113,6 +113,14 @@ void QXcbWindow::create() Qt::WindowType type = window()->windowType(); + if (type == Qt::Desktop) { + m_window = m_screen->root(); + m_depth = m_screen->screen()->root_depth; + m_format = (m_depth == 32) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32; + connection()->addWindow(m_window, this); + return; + } + const quint32 mask = XCB_CW_BACK_PIXMAP | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_SAVE_UNDER | XCB_CW_EVENT_MASK; const quint32 values[] = { // XCB_CW_BACK_PIXMAP @@ -149,6 +157,7 @@ void QXcbWindow::create() { #if defined(XCB_USE_GLX) XVisualInfo *visualInfo = qglx_findVisualInfo(DISPLAY_FROM_XCB(m_screen),m_screen->screenNumber(), window()->requestedWindowFormat()); + #elif defined(XCB_USE_EGL) EGLDisplay eglDisplay = connection()->egl_display(); EGLConfig eglConfig = q_configFromQWindowFormat(eglDisplay,window()->requestedWindowFormat(),true); |