diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 12:04:40 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-03-30 12:08:27 (GMT) |
commit | 5c0605f617aa3dd727853b92b7d1b1d46208646f (patch) | |
tree | ddcfc95763f12c1fffd4357857879f0e36774cf6 /src/plugins/platforms/xcb | |
parent | 8af8a969ea7266ecdce4cbbc89c3e505074b5286 (diff) | |
download | Qt-5c0605f617aa3dd727853b92b7d1b1d46208646f.zip Qt-5c0605f617aa3dd727853b92b7d1b1d46208646f.tar.gz Qt-5c0605f617aa3dd727853b92b7d1b1d46208646f.tar.bz2 |
Fixed synchronization issue in QXcbWindow.
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 1 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindowsurface.cpp | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 5b7d6d5..ffa6537 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -701,6 +701,13 @@ void QXcbConnection::initializeAllAtoms() { m_allAtoms[i] = xcb_intern_atom_reply(xcb_connection(), cookies[i], 0)->atom; } +void QXcbConnection::sync() +{ + // from xcb_aux_sync + xcb_get_input_focus_cookie_t cookie = Q_XCB_CALL(xcb_get_input_focus(xcb_connection())); + free(xcb_get_input_focus_reply(xcb_connection(), cookie, 0)); +} + #if defined(XCB_USE_EGL) bool QXcbConnection::hasEgl() const { diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 036670a..2723f26 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -228,6 +228,8 @@ public: QXcbConnection(const char *displayName = 0); ~QXcbConnection(); + QXcbConnection *connection() const { return const_cast<QXcbConnection *>(this); } + QList<QXcbScreen *> screens() const { return m_screens; } int primaryScreen() const { return m_primaryScreen; } @@ -256,6 +258,8 @@ public: void *egl_display() const { return m_egl_display; } #endif + void sync(); + protected: void run(); diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 710d531..508755a 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -423,6 +423,7 @@ void QXcbWindow::lower() void QXcbWindow::requestActivateWindow() { Q_XCB_CALL(xcb_set_input_focus(xcb_connection(), m_window, XCB_INPUT_FOCUS_PARENT, XCB_TIME_CURRENT_TIME)); + connection()->sync(); } QPlatformGLContext *QXcbWindow::glContext() const diff --git a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp index 110aa10..8ab0140 100644 --- a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp +++ b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp @@ -151,9 +151,7 @@ void QXcbShmImage::preparePaint(const QRegion ®ion) { // to prevent X from reading from the image region while we're writing to it if (m_dirty.intersects(region)) { - // from xcb_aux_sync - xcb_get_input_focus_cookie_t cookie = Q_XCB_CALL(xcb_get_input_focus(xcb_connection())); - free(xcb_get_input_focus_reply(xcb_connection(), cookie, 0)); + connection()->sync(); m_dirty = QRegion(); } } |