diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index abd2f7a147..11ce1126ae 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -156,6 +156,7 @@ QXcbWindow::QXcbWindow(QWindow *window) , m_gravity(XCB_GRAVITY_STATIC) , m_mapped(false) , m_transparent(false) + , m_usingSyncProtocol(false) , m_deferredActivation(false) , m_netWmUserTimeWindow(XCB_NONE) , m_dirtyFrameMargins(false) @@ -318,7 +319,9 @@ void QXcbWindow::create() properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS); properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING); - if (m_screen->syncRequestSupported()) + m_usingSyncProtocol = m_screen->syncRequestSupported() && window()->surfaceType() != QSurface::OpenGLSurface; + + if (m_usingSyncProtocol) properties[propertyCount++] = atom(QXcbAtom::_NET_WM_SYNC_REQUEST); if (window()->flags() & Qt::WindowContextHelpButtonHint) @@ -335,7 +338,7 @@ void QXcbWindow::create() m_syncValue.hi = 0; m_syncValue.lo = 0; - if (m_screen->syncRequestSupported()) { + if (m_usingSyncProtocol) { m_syncCounter = xcb_generate_id(xcb_connection()); Q_XCB_CALL(xcb_sync_create_counter(xcb_connection(), m_syncCounter, m_syncValue)); @@ -418,7 +421,7 @@ void QXcbWindow::destroy() if (connection()->focusWindow() == this) connection()->setFocusWindow(0); - if (m_syncCounter && m_screen->syncRequestSupported()) + if (m_syncCounter && m_usingSyncProtocol) Q_XCB_CALL(xcb_sync_destroy_counter(xcb_connection(), m_syncCounter)); if (m_window) { if (m_netWmUserTimeWindow) { @@ -1694,7 +1697,7 @@ void QXcbWindow::handleFocusOutEvent(const xcb_focus_out_event_t *) void QXcbWindow::updateSyncRequestCounter() { - if (m_screen->syncRequestSupported() && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) { + if (m_usingSyncProtocol && (m_syncValue.lo != 0 || m_syncValue.hi != 0)) { Q_XCB_CALL(xcb_sync_set_counter(xcb_connection(), m_syncCounter, m_syncValue)); xcb_flush(xcb_connection()); connection()->sync(); diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 3b5404684f..6a8b98ff0d 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -181,6 +181,7 @@ private: bool m_mapped; bool m_transparent; + bool m_usingSyncProtocol; bool m_deferredActivation; bool m_deferredExpose; bool m_configureNotifyPending;