From e6a813c7869fb3677b15b3907bd6647b5f80bd5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= Date: Thu, 12 Mar 2015 17:33:22 +0100 Subject: Do not return null Display or Connection when there are no screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a followup change for recent changes in QtGui which now handles a situation where there are no outputs, and hence a nullptr QScreen comes haunting us. Thanks to Martin Gräßlin for pointing out where the problem is, and to Richard Moore for explaining how to fix it. Change-Id: I8f70c7a0b232073d4edb55b29eb19dae9fc09413 Reviewed-by: Richard J. Moore Reviewed-by: Shawn Rutledge --- src/x11extras/qx11info_x11.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11extras/qx11info_x11.cpp b/src/x11extras/qx11info_x11.cpp index 4647bd6..8d8f337 100644 --- a/src/x11extras/qx11info_x11.cpp +++ b/src/x11extras/qx11info_x11.cpp @@ -338,7 +338,7 @@ Display *QX11Info::display() if (!native) return NULL; - void *display = native->nativeResourceForScreen(QByteArray("display"), QGuiApplication::primaryScreen()); + void *display = native->nativeResourceForIntegration(QByteArray("display")); return reinterpret_cast(display); } @@ -355,7 +355,7 @@ xcb_connection_t *QX11Info::connection() if (!native) return NULL; - void *connection = native->nativeResourceForWindow(QByteArray("connection"), 0); + void *connection = native->nativeResourceForIntegration(QByteArray("connection")); return reinterpret_cast(connection); } -- cgit v1.2.1