From e915b7924f251f849b2b5480d2945981a93108f6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 19 Sep 2011 21:10:07 +0200 Subject: Create the window when needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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(window()->screen()->handle()); - QXcbWindow* win = static_cast(window()->handle()); + QPlatformWindow *pw = window()->handle(); + if (!pw) { + window()->create(); + pw = window()->handle(); + } + QXcbWindow* win = static_cast(pw); delete m_image; m_image = new QXcbShmImage(screen, size, win->depth(), win->imageFormat()); -- cgit v1.2.3