summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-03-08 15:19:33 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-13 19:11:12 +0100
commit846cf1a13f80fe4590cc9ad4d9972d7a173accd6 (patch)
tree4ab2abea5eb47a9673f7a91c8e07e15b93607591 /src/plugins/platforms/xcb
parent1975e65d73ef2bf225bd765e6b50b6f50167f71c (diff)
Fix sluggish resizing for opengl windows on X11
Disable sync protocol for OpenGL surfaces in the XCB plugin. Task-number: QTBUG-29304 Change-Id: I4cb47b04637e15e012758d3b0840abd13d27df69 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h1
2 files changed, 8 insertions, 4 deletions
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;