From bd2ce747fc47f16fa0ed5af452e0ce0afcf9d743 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 22 Jan 2012 21:03:12 +0100 Subject: [PATCH] xcb: Correctly check the X11 connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit e08453f31ae2a195f86a763f0b1c5e617df0e1ce added a check which makes sure qt prints an error message instead of segfaulting when it can't connect to the X11 server. However, libxcb will never return NULL from xcb_connect() and thus that commit only works if XCB_USE_XLIB is defined and used. Change-Id: I8cc1496494a94f07055a3ac5093ce362dd347c5b Signed-off-by: Uli Schlachter Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qxcbconnection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index d5a668af76..c77eae284b 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -132,7 +132,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char m_connection = xcb_connect(m_displayName.constData(), &m_primaryScreen); #endif //XCB_USE_XLIB - if (!m_connection) + if (!m_connection || xcb_connection_has_error(m_connection)) qFatal("Could not connect to display %s", m_displayName.constData()); m_reader = new QXcbEventReader(this);