diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:51:33 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-11-26 10:51:34 +0100 |
commit | 3061dc4abdfbd1a536918935d380872de6655521 (patch) | |
tree | ff440ed0c7d5816cc7e2874f73fdabfb0bce493f /src/plugins/platforms/xcb | |
parent | 25b2b682d616dd52c3515f443e3d25fc0224f3a2 (diff) | |
parent | 9b8570c4e9359eb8b45b39c28aa9d8c140f3fc44 (diff) |
Merge remote-tracking branch 'origin/release' into stable
Change-Id: I83ff8f4d7dffd7385013a1bd8a1732a89ee20d56
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qglxintegration.cpp | 25 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 22 |
2 files changed, 38 insertions, 9 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index e6fa8fc898..e504d93fba 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -415,12 +415,17 @@ bool QGLXContext::m_supportsThreading = true; // If this list grows to any significant size, change it a // proper string table and make the implementation below use // binary search. -static const char *qglx_threadedgl_blacklist[] = { +static const char *qglx_threadedgl_blacklist_renderer[] = { "Chromium", // QTBUG-32225 (initialization fails) "Mesa DRI Intel(R) Sandybridge Mobile", // QTBUG-34492 (flickering in fullscreen) 0 }; +static const char *qglx_threadedgl_blacklist_vendor[] = { + "nouveau", // QTCREATORBUG-10875 (crash in creator) + 0 +}; + void QGLXContext::queryDummyContext() { if (m_queriedDummyContext) @@ -437,8 +442,8 @@ void QGLXContext::queryDummyContext() oldSurface = oldContext->surface(); QScopedPointer<QSurface> surface; - const char *vendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); - if (vendor && !strcmp(vendor, "ATI")) { + const char *glxvendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR); + if (glxvendor && !strcmp(glxvendor, "ATI")) { QWindow *window = new QWindow; window->resize(64, 64); window->setSurfaceType(QSurface::OpenGLSurface); @@ -454,11 +459,19 @@ void QGLXContext::queryDummyContext() context.create(); context.makeCurrent(surface.data()); + m_supportsThreading = true; + const char *renderer = (const char *) glGetString(GL_RENDERER); + for (int i = 0; qglx_threadedgl_blacklist_renderer[i]; ++i) { + if (strstr(renderer, qglx_threadedgl_blacklist_renderer[i]) != 0) { + m_supportsThreading = false; + break; + } + } - m_supportsThreading = true; - for (int i = 0; qglx_threadedgl_blacklist[i]; ++i) { - if (strstr(renderer, qglx_threadedgl_blacklist[i]) != 0) { + const char *vendor = (const char *) glGetString(GL_VENDOR); + for (int i = 0; qglx_threadedgl_blacklist_vendor[i]; ++i) { + if (strstr(vendor, qglx_threadedgl_blacklist_vendor[i]) != 0) { m_supportsThreading = false; break; } diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index cc8c42f96b..4d2735ca85 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1749,10 +1749,26 @@ bool QXcbConnection::xi2GetValuatorValueIfSet(void *event, int valuatorNum, doub return true; } -bool QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *event, int opCode) +// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed: +// - "pad0" became "extension" +// - "pad1" and "pad" became "pad0" +// New and old version of this struct share the following fields: +// NOTE: API might change again in the next release of xcb in which case this comment will +// need to be updated to reflect the reality. +typedef struct qt_xcb_ge_event_t { + uint8_t response_type; + uint8_t extension; + uint16_t sequence; + uint32_t length; + uint16_t event_type; +} qt_xcb_ge_event_t; + +bool QXcbConnection::xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *ev, int opCode) { - // xGenericEvent has "extension" on the second byte, xcb_ge_event_t has "pad0". - if (event->pad0 == opCode) { + qt_xcb_ge_event_t *event = (qt_xcb_ge_event_t *)ev; + // xGenericEvent has "extension" on the second byte, the same is true for xcb_ge_event_t starting from + // the xcb version 1.9.3, prior to that it was called "pad0". + if (event->extension == opCode) { // xcb event structs contain stuff that wasn't on the wire, the full_sequence field // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes. // Move this data back to have the same layout in memory as it was on the wire |