diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2011-10-12 11:53:01 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-14 00:25:20 +0200 |
commit | bb22b4965070409df4658f16fdf549f0362e8a9c (patch) | |
tree | 1df259ab8d4e4d54097addf58da884d91e037831 /src/plugins/platforms | |
parent | 472028c1d43ec5fc9c8f054f24d286aa7873ad26 (diff) |
Fix OpenGL on Harmattan showing only the first frame.
swapBuffers would wait until DRI2_InvalidateBuffers was received from the
X server, but would never receive it since we are not running the xlib event loop.
This patch calls the XESetWireToEvent xlib callback of an unhandled event from the
xcb event loop directly, if one is available for its response type.
Change-Id: I3b4ef3f6e3efbae25f49f161e229e9b15e951778
Reviewed-on: http://codereview.qt-project.org/6557
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 08c569c993..af5822f7f7 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -62,6 +62,7 @@ #ifdef XCB_USE_XLIB #include <X11/Xlib.h> #include <X11/Xlib-xcb.h> +#include <X11/Xlibint.h> #endif #ifdef XCB_USE_RENDER @@ -542,6 +543,19 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) } } +#ifdef XCB_USE_XLIB + if (!handled) { + // Check if a custom XEvent constructor was registered in xlib for this event type, and call it discarding the constructed XEvent if any. + // XESetWireToEvent might be used by libraries to intercept messages from the X server e.g. the OpenGL lib waiting for DRI2 events. + Bool (*proc)(Display*, XEvent*, xEvent*) = XESetWireToEvent((Display*)m_xlib_display, response_type, 0); + if (proc) { + XESetWireToEvent((Display*)m_xlib_display, response_type, proc); + XEvent dummy; + proc((Display*)m_xlib_display, &dummy, (xEvent*)event); + } + } +#endif + if (handled) printXcbEvent("Handled XCB event", event); else |