diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-09-19 21:10:07 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-21 12:07:19 +0200 |
commit | e915b7924f251f849b2b5480d2945981a93108f6 (patch) | |
tree | 07d3b320250320d05dc7c34562f8a81142176f98 /src/plugins/platforms/xcb/qxcbbackingstore.cpp | |
parent | 21747af805317c93c98fe681200732b14e79ab5b (diff) |
Create the window when needed
We need to create the XWindow here to
avoid crashes, when resizing the backing store
before creating the window.
Change-Id: Ib8d9efca3552e5a91f5f63a9262449080ae301e5
Reviewed-on: http://codereview.qt-project.org/5259
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbbackingstore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index df6cf318bb..2c6ec62475 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -291,7 +291,12 @@ void QXcbBackingStore::resize(const QSize &size, const QRegion &) Q_XCB_NOOP(connection()); QXcbScreen *screen = static_cast<QXcbScreen *>(window()->screen()->handle()); - QXcbWindow* win = static_cast<QXcbWindow *>(window()->handle()); + QPlatformWindow *pw = window()->handle(); + if (!pw) { + window()->create(); + pw = window()->handle(); + } + QXcbWindow* win = static_cast<QXcbWindow *>(pw); delete m_image; m_image = new QXcbShmImage(screen, size, win->depth(), win->imageFormat()); |