Bug#822460: ktouch: shows typed chars too slow (not usable at >100 chars/min)
I can confirm this bug.
It still exists in 4:16.08.3-1.
I found a solution for this here:
https://bugs.kde.org/show_bug.cgi?id=346248#c1
According to this thread:
https://bugs.kde.org/show_bug.cgi?id=350336
The bug also seems to be closed in the upstream version 16.12 but I haven't tested this yet.
I've attached a debdiff containing the patch from the first thread.
I've tested this for a while without problems.
diff -Nru ktouch-16.08.3/debian/changelog ktouch-16.08.3/debian/changelog
--- ktouch-16.08.3/debian/changelog 2016-11-23 21:17:22.000000000 +0100
+++ ktouch-16.08.3/debian/changelog 2017-01-11 00:25:21.000000000 +0100
@@ -1,3 +1,10 @@
+ktouch (4:16.08.3-1.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * Patched typing delay
+
+ -- Nikolas Hemmert <nmhnh@web.de> Wed, 11 Jan 2017 00:25:21 +0100
+
ktouch (4:16.08.3-1) unstable; urgency=medium
* New upstream release (16.08.3)
diff -Nru ktouch-16.08.3/debian/patches/series ktouch-16.08.3/debian/patches/series
--- ktouch-16.08.3/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ ktouch-16.08.3/debian/patches/series 2017-01-11 00:09:09.000000000 +0100
@@ -0,0 +1 @@
+typing_delay_fix.patch
diff -Nru ktouch-16.08.3/debian/patches/typing_delay_fix.patch ktouch-16.08.3/debian/patches/typing_delay_fix.patch
--- ktouch-16.08.3/debian/patches/typing_delay_fix.patch 1970-01-01 01:00:00.000000000 +0100
+++ ktouch-16.08.3/debian/patches/typing_delay_fix.patch 2017-01-11 00:22:37.000000000 +0100
@@ -0,0 +1,34 @@
+Solves problem with big delay while typing.
+
+The solution found here:
+https://bugs.kde.org/show_bug.cgi?id=346248#c1
+
+--- a/src/declarativeitems/lessonpainter.cpp
++++ b/src/declarativeitems/lessonpainter.cpp
+@@ -236,8 +236,7 @@
+ const QString referenceLine = m_trainingLineCore->referenceLine();
+ const QString actualLine = m_trainingLineCore->actualLine();
+ const QString preeditString = m_trainingLineCore->preeditString();
+- const QTextBlock block = m_doc->findBlockByNumber(m_currentLine + 1);
+- const int blockPosition = block.position();
++ const int blockPosition = m_doc->findBlockByNumber(m_currentLine + 1).position();
+
+ for (int linePos = 0; linePos < referenceLine.length(); linePos++)
+ {
+@@ -257,8 +256,14 @@
+
+ cursor.setPosition(charPosition, QTextCursor::MoveAnchor);
+ cursor.setPosition(charPosition + 1, QTextCursor::KeepAnchor);
+- cursor.deleteChar();
+- cursor.insertText(QString(displayedChar), charFormat);
++
++ /* QUICKFIX: Using the charFormat to decide whether a char must be repainted or not.
++ * Not nice but quite efficient ... */
++ if (cursor.charFormat() != charFormat)
++ {
++ cursor.deleteChar();
++ cursor.insertText(QString(displayedChar), charFormat);
++ }
+ }
+
+ invalidateImageCache();
Reply to: