summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2012-09-24 15:23:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-27 06:07:17 +0200
commite424354e85671928e6a1cf11cb5cf0a89ba9357f (patch)
tree20aa3832c66f9107e0a48c31bb0331ac21b1a6d9 /src
parentae0ddb8c729c105a5b4f32a4f6765af8fe546333 (diff)
xcb: consistently check xcb_get_extension_data for extension inits
This seems to fix the ability to run a Qt app across a forwarded X connection (e.g. ssh -X). Change-Id: I2b7a26985cf11107e69b303337a5fbb369e38c9e Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index b82a17dc05..76534cf5c4 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -1219,8 +1219,10 @@ void QXcbConnection::initializeXFixes()
{
xcb_generic_error_t *error = 0;
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xfixes_id);
- xfixes_first_event = reply->first_event;
+ if (!reply || !reply->present)
+ return;
+ xfixes_first_event = reply->first_event;
xcb_xfixes_query_version_cookie_t xfixes_query_cookie = xcb_xfixes_query_version(m_connection,
XCB_XFIXES_MAJOR_VERSION,
XCB_XFIXES_MINOR_VERSION);
@@ -1237,6 +1239,10 @@ void QXcbConnection::initializeXFixes()
void QXcbConnection::initializeXRender()
{
#ifdef XCB_USE_RENDER
+ const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_render_id);
+ if (!reply || !reply->present)
+ return;
+
xcb_generic_error_t *error = 0;
xcb_render_query_version_cookie_t xrender_query_cookie = xcb_render_query_version(m_connection,
XCB_RENDER_MAJOR_VERSION,
@@ -1253,11 +1259,11 @@ void QXcbConnection::initializeXRender()
void QXcbConnection::initializeXRandr()
{
- const xcb_query_extension_reply_t *xrandr_reply = xcb_get_extension_data(m_connection, &xcb_randr_id);
- if (!xrandr_reply || !xrandr_reply->present)
+ const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_randr_id);
+ if (!reply || !reply->present)
return;
- xrandr_first_event = xrandr_reply->first_event;
+ xrandr_first_event = reply->first_event;
xcb_generic_error_t *error = 0;
xcb_randr_query_version_cookie_t xrandr_query_cookie = xcb_randr_query_version(m_connection,