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 <mgraesslin@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>bb10
parent
dd3be4fbac
commit
83d7e83b78
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -176,7 +176,6 @@ public Q_SLOTS:
|
|||
protected:
|
||||
virtual void resolveFormat() { m_format = window()->requestedFormat(); }
|
||||
virtual void *createVisual() { return Q_NULLPTR; }
|
||||
virtual bool supportsSyncProtocol() { return !window()->supportsOpenGL(); }
|
||||
|
||||
QXcbScreen *parentScreen();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue