summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-06-03 14:35:09 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-06-03 14:35:09 +0200
commit7e4116cc8a54e9e46c7bb4c96a54fb96ab38f3d5 (patch)
treee8e21bcaeb871711daf7e0b0694e92c9d7d15414
parenta9910abac9b3c9cf5aa532ca9d3e62e6cae0b839 (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.
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp9
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp4
2 files changed, 11 insertions, 2 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);
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index 4bfd6f19a7..169977db25 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -90,7 +90,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
Qt::WindowFlags flags = data.window_flags;
- if ((!q->testAttribute(Qt::WA_NativeWindow) && !q->isWindow()) || q->windowType() == Qt::Desktop )
+ if (!q->testAttribute(Qt::WA_NativeWindow) && !q->isWindow())
return; // we only care about real toplevels
QWindowSurface *surface = q->windowSurface();
@@ -776,7 +776,7 @@ void QWidgetPrivate::createTLSysExtra()
Q_Q(QWidget);
extra->topextra->screenIndex = 0;
extra->topextra->window = 0;
- if ((q->testAttribute(Qt::WA_NativeWindow) || q->isWindow()) && q->windowType() != Qt::Desktop)
+ if (q->testAttribute(Qt::WA_NativeWindow) || q->isWindow())
extra->topextra->window = new QWidgetWindow(q);
}