summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-05-04 12:38:39 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-05-04 13:14:29 +0200
commitf838dcc050217507fd060d4c5dd093eb22ac95af (patch)
treece7745321d32405a3c8265e1975af2ff4169d435 /src/plugins
parent9ff98b92a176a011b16d5bf538a2dcc3f8494ca5 (diff)
Improved handling of child windows.
Don't force-create QWindows until they're explicitly created or shown.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index b0df622b33..84886554b1 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -113,6 +113,10 @@ QXcbWindow::QXcbWindow(QWindow *window)
QRect rect = window->geometry();
+ xcb_window_t xcb_parent_id = m_screen->root();
+ if (window->parent() && window->parent()->windowHandle())
+ xcb_parent_id = static_cast<QXcbWindow *>(window->parent()->windowHandle())->xcb_window();
+
#if defined(XCB_USE_GLX) || defined(XCB_USE_EGL)
if (window->surfaceType() == QWindow::OpenGLSurface
&& QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::OpenGL))
@@ -133,11 +137,11 @@ QXcbWindow::QXcbWindow(QWindow *window)
visualInfo = XGetVisualInfo(DISPLAY_FROM_XCB(this), VisualIDMask, &visualInfoTemplate, &matchingCount);
#endif //XCB_USE_GLX
if (visualInfo) {
- Colormap cmap = XCreateColormap(DISPLAY_FROM_XCB(this), m_screen->root(), visualInfo->visual, AllocNone);
+ Colormap cmap = XCreateColormap(DISPLAY_FROM_XCB(this), xcb_parent_id, visualInfo->visual, AllocNone);
XSetWindowAttributes a;
a.colormap = cmap;
- m_window = XCreateWindow(DISPLAY_FROM_XCB(this), m_screen->root(), rect.x(), rect.y(), rect.width(), rect.height(),
+ m_window = XCreateWindow(DISPLAY_FROM_XCB(this), xcb_parent_id, rect.x(), rect.y(), rect.width(), rect.height(),
0, visualInfo->depth, InputOutput, visualInfo->visual,
CWColormap, &a);
@@ -153,7 +157,7 @@ QXcbWindow::QXcbWindow(QWindow *window)
Q_XCB_CALL(xcb_create_window(xcb_connection(),
XCB_COPY_FROM_PARENT, // depth -- same as root
m_window, // window id
- m_screen->root(), // parent window id
+ xcb_parent_id, // parent window id
rect.x(),
rect.y(),
rect.width(),