path: root/src/plugins/platforms
diff options
authorBłażej Szczygieł <>2015-10-02 22:46:22 +0200
committerBłażej Szczygieł <>2015-11-19 19:30:44 +0000
commit83d7e83b78df037836d81a9aedaba99655a587b9 (patch)
treeb6cd66f304eb5df05f9913321e047af514c85cbf /src/plugins/platforms
parentdd3be4fbac09f1a085086f1ea400e6637ae68c10 (diff)
xcb: Fix slow widget resizing
It can speed up window resizing using on XCB platform (like in Qt4 or GTK). It doesn't affect QRasterWindow, but it affects all QWidget-based windows and OpenGL windows. This code uses XCB Sync Protocol on all windows when it is supported. In previous code the XCB Sync Protocol was used only when window doesn't support OpenGL (on QRasterWindow),but QWidget can use OpenGL, so it doesn't use the XCB Sync Protocol. With XCB Sync Protocol which is implemented in Qt XCB plugin, windows can be resized smoother/faster. You can see bigger difference when you use non-composited window manager to test it: - Kwin without compositing and fast style, - Marco, - Xfwm4, - Openbox. Task-number: QTBUG-46641 Change-Id: Ia18dee94616e64ba7e11bd4b062d2326ec530748 Reviewed-by: Martin Gräßlin <> Reviewed-by: Laszlo Agocs <>
Diffstat (limited to 'src/plugins/platforms')
2 files changed, 1 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index bcc571c3c8..d76f1245e8 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -500,10 +500,7 @@ void QXcbWindow::create()
properties[propertyCount++] = atom(QXcbAtom::WM_TAKE_FOCUS);
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_PING);
- if (platformScreen->syncRequestSupported())
- m_usingSyncProtocol = supportsSyncProtocol();
- else
- m_usingSyncProtocol = false;
+ m_usingSyncProtocol = platformScreen->syncRequestSupported();
if (m_usingSyncProtocol)
properties[propertyCount++] = atom(QXcbAtom::_NET_WM_SYNC_REQUEST);
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index b2c5fa7d4d..41c4b4443d 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -176,7 +176,6 @@ public Q_SLOTS:
virtual void resolveFormat() { m_format = window()->requestedFormat(); }
virtual void *createVisual() { return Q_NULLPTR; }
- virtual bool supportsSyncProtocol() { return !window()->supportsOpenGL(); }
QXcbScreen *parentScreen();