File xcb-fix-slow-widget-resizing.patch of Package libqt5-qtbase.2170

From 83d7e83b78df037836d81a9aedaba99655a587b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Fri, 2 Oct 2015 22:46:22 +0200
Subject: [PATCH] xcb: Fix slow widget resizing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 src/plugins/platforms/xcb/qxcbwindow.cpp | 5 +----
 src/plugins/platforms/xcb/qxcbwindow.h   | 1 -
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index bcc571c..d76f124 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 b2c5fa7..41c4b44 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -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();
 
-- 
2.6.3

openSUSE Build Service is sponsored by