[krita] 3rdparty/ext_qt: Fix a "bended lines"+AMD+Qt5.6 bug

Dmitry Kazakov dimula73 at gmail.com
Wed Apr 20 20:41:35 UTC 2016

Git commit 31195a85a054e50af2d61ae764f341db12190f1e by Dmitry Kazakov.
Committed on 20/04/2016 at 20:03.
Pushed by dkazakov into branch 'master'.

Fix a "bended lines"+AMD+Qt5.6 bug

The bug is actually in Qt 5.6. They decided to implement a motion event
compression without *any* way to disable it. So we have a lot of events
dropped resulting in "bended lines" on canvas.

For some reason the bug is reproducible on AMD GPUs only, with openGL
activated. It seems like either Qt asks for some synchronization, or
rendering on AMD is just too slow. I don't know the exact reason,
but being busy with rendering makes Qt drop a lot of events.

Since this event compression cannot be disabled in any official way, we
should start patching Qt on Linux as well. Yes, it means that Krita 3.0
cannot be distributed through official distribution repositories. Which
means that Krita Lime will have to be shut down as soon as Ubuntu 16.04
will upgrade to Qt 5.6.

CC:kimageshop at kde.org
CC:Shawn.Rutledge at theqtcompany.com
Fixes T2224

M  +1    -0    3rdparty/ext_qt/CMakeLists.txt
A  +20   -0    3rdparty/ext_qt/qt-no-motion-compression.diff


diff --git a/3rdparty/ext_qt/CMakeLists.txt b/3rdparty/ext_qt/CMakeLists.txt
index 78146a5..8fa3ba3 100644
--- a/3rdparty/ext_qt/CMakeLists.txt
+++ b/3rdparty/ext_qt/CMakeLists.txt
@@ -7,6 +7,7 @@ ExternalProject_Add(
     URL_MD5 03402708f260dcc917abae9bc559c1df
     PATCH_COMMAND myptch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/disable-wintab.diff
           COMMAND myptch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qtgui-private-headers.diff
+          COMMAND myptch -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qt-no-motion-compression.diff
     CONFIGURE_COMMAND <SOURCE_DIR>/configure.bat -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdoc -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtsensors -skip qtserialport -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtxmlpatterns -no-sql-sqlite -nomake examples -nomake tools -no-compile-examples -no-dbus -no-iconv -no-angle -no-ssl -no-openssl -no-wmf-backend -no-qml-debug -no-libproxy -no-system-proxies -no-nis -no-icu -no-mtdev -opensource -confirm-license -release -opengl desktop -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -prefix ${EXTPREFIX_qt}
diff --git a/3rdparty/ext_qt/qt-no-motion-compression.diff b/3rdparty/ext_qt/qt-no-motion-compression.diff
new file mode 100644
index 0000000..bac2995
--- /dev/null
+++ b/3rdparty/ext_qt/qt-no-motion-compression.diff
@@ -0,0 +1,20 @@
+diff --git a/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp b/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp
+index 05c0224..8fa9345 100644
+--- a/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp
++++ b/qtbase/src/plugins/platforms/xcb/qxcbconnection.cpp
+@@ -1687,8 +1687,13 @@ void QXcbConnection::processXcbEvents()
+             continue;
+         }
+-        if (compressEvent(event, i, eventqueue))
+-            continue;
++        /**
++         * (Krita) Do *NOT* compress any motion events! This is the
++         * most weird thing one can do for a painting application!
++         */
++        // if (compressEvent(event, i, eventqueue))
++        //     continue;
+         bool accepted = false;
+         if (clipboard()->processIncr())

More information about the kimageshop mailing list