Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Dear release team, I've backported two upstream fixes in ktexteditor for stretch that I consider worthwhile: + Fix: Forward dragging text results in wrong selection (a4ad36c) KDE#374163 + fix minimap rendering for HiDPI envs (030c37b) I've uploaded 5.28.0-2 with these changes and it has built successfully in all the release architectures. I'm attaching the corresponding debdiff. Happy hacking, Please unblock package ktexteditor unblock ktexteditor/5.28.0-2 - -- System Information: Debian Release: 9.0 APT prefers unstable-debug APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (50, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386, armhf Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Init: systemd (via /run/systemd/system) -----BEGIN PGP SIGNATURE----- iQJEBAEBCgAuFiEE+JIdOnQEyG4RNSIVxxl2mbKbIyoFAljqJoYQHG1heHlAZGVi aWFuLm9yZwAKCRDHGXaZspsjKjGOD/9ZV9w3eQ4O2Sj6WQt2fa1AcpTgszPdfpoG rEKQ9MFN+NzN33IW1z0/qcx20ehWMdeSsW79TCkHHIxTWftd6vWmVt1vlQJ8tSpQ T8kixf7n/OQSmCPD2omCfrNW7ONWoG7hd4qjMJm3D16W8WYyNIynpIr8hmtQWJN6 HgVH6UFPRgWAnh4slcMbCPobtDbFLwI5k8zxQJZf7vnv/iK+v0kWFUUOPjgU7u7D T5GGmD1jreQ+3ZMBgd+UEeEf7Cmw4ar4f3C58DwU8z/1Lc4kngYpy9g32xmRTsHk ix4vKbCjKlsD1ZFmXGra1RJ67lkekRWS42PeWNIp8Y1r+IYyq6bujZdhM5pKRvaZ zTj3vIA4K2JHS6crMbTjNF+sdrmw2IIVSPE/SUxujes1l4DnJ9cQy3E9Myl0cw7I NNetgKAL3GLV1H/FoBoz1/5evheK3TfqxQdBL6Rf1fpg99MP++X0KbPupDhYp7QP 56mjAyg8jk0Vcc/691pxhThqNkBuXsAlY5EqjKhRuhsKWO/csEkwdy9PBsn8DiKo B/owcwejDXrdCk14JjPaM6iBxvUYCvVReoev38MMKx9XFPrTIhFOxF7qWhbvyvE3 PEF68svk02Dj5e4m2Tpk45Fiv9BMg0Ok63cky9ZLUpQaauYljHxBHiTEchvN6tAS sBzOAwAQ+g== =sMwv -----END PGP SIGNATURE-----
diff -Nru ktexteditor-5.28.0/debian/changelog ktexteditor-5.28.0/debian/changelog --- ktexteditor-5.28.0/debian/changelog 2016-11-18 16:07:00.000000000 +0100 +++ ktexteditor-5.28.0/debian/changelog 2017-04-07 11:57:02.000000000 +0200 @@ -1,3 +1,14 @@ +ktexteditor (5.28.0-2) unstable; urgency=medium + + * Apply "Fix: Forward dragging text results in wrong selection" (a4ad36c) + Add the upstream patch as: + Fix-Forward-dragging-text-results-in-wrong-selection.patch + This fixes KDE#374163 + * Apply "fix minimap rendering for HiDPI envs" (030c37b) + Add upstream patch as: fix-minimap-rendering-for-HiDPI-envs.patch + + -- Maximiliano Curia <m...@debian.org> Fri, 07 Apr 2017 11:57:02 +0200 + ktexteditor (5.28.0-1) unstable; urgency=medium [ Maximiliano Curia ] diff -Nru ktexteditor-5.28.0/debian/patches/Fix-Forward-dragging-text-results-in-wrong-selection.patch ktexteditor-5.28.0/debian/patches/Fix-Forward-dragging-text-results-in-wrong-selection.patch --- ktexteditor-5.28.0/debian/patches/Fix-Forward-dragging-text-results-in-wrong-selection.patch 1970-01-01 01:00:00.000000000 +0100 +++ ktexteditor-5.28.0/debian/patches/Fix-Forward-dragging-text-results-in-wrong-selection.patch 2017-04-07 11:57:02.000000000 +0200 @@ -0,0 +1,138 @@ +From: Dominik Haumann <dhaum...@kde.org> +Date: Sat, 7 Jan 2017 12:15:39 +0100 +Subject: Fix: Forward dragging text results in wrong selection + +Thanks to Serge Roussak for the patch! + +REVIEW: 129758 +BUG: 374163 +--- + autotests/src/kateview_test.cpp | 67 +++++++++++++++++++++++++++++++++++++++++ + autotests/src/kateview_test.h | 2 ++ + src/view/kateviewinternal.cpp | 12 +++++--- + 3 files changed, 77 insertions(+), 4 deletions(-) + +diff --git a/autotests/src/kateview_test.cpp b/autotests/src/kateview_test.cpp +index 950184f4..7372d235 100644 +--- a/autotests/src/kateview_test.cpp ++++ b/autotests/src/kateview_test.cpp +@@ -317,4 +317,71 @@ void KateViewTest::testFoldFirstLine() + QVERIFY(view->textFolding().isLineVisible(1)); + } + ++// test for bug https://bugs.kde.org/374163 ++void KateViewTest::testDragAndDrop() ++{ ++ KTextEditor::DocumentPrivate doc(false, false); ++ doc.setText("line0\n" ++ "line1\n" ++ "line2\n" ++ "\n" ++ "line4"); ++ ++ KTextEditor::View* view = static_cast<KTextEditor::View*>(doc.createView(Q_NULLPTR)); ++ view->show(); ++ view->resize(400, 300); ++ ++ QWidget *internalView = nullptr; ++ foreach (QObject* child, view->children()) { ++ if (child->metaObject()->className() == QByteArrayLiteral("KateViewInternal")) { ++ internalView = qobject_cast<QWidget *>(child); ++ break; ++ } ++ } ++ QVERIFY(internalView); ++ ++ // select "line1\n" ++ view->setSelection(Range(1, 0, 2, 0)); ++ QCOMPARE(view->selectionRange(), Range(1, 0, 2, 0)); ++ ++ QTest::qWaitForWindowExposed(view); ++ const QPoint startDragPos = internalView->mapFrom(view, view->cursorToCoordinate(KTextEditor::Cursor(1, 2))); ++ const QPoint endDragPos = internalView->mapFrom(view, view->cursorToCoordinate(KTextEditor::Cursor(3, 0))); ++ const QPoint gStartDragPos = internalView->mapToGlobal(startDragPos); ++ const QPoint gEndDragPos = internalView->mapToGlobal(endDragPos); ++ ++ // now drag and drop selected text to Cursor(3, 0) ++ QMouseEvent pressEvent(QEvent::MouseButtonPress, startDragPos, gStartDragPos, ++ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); ++ QCoreApplication::sendEvent(internalView, &pressEvent); ++ ++ // ugly workaround: Drag & Drop has own blocking event queue. Therefore, we need a single-shot timer to ++ // break out of the blocking event queue, see (*) ++ QTimer::singleShot(50, [&](){ ++ QMouseEvent moveEvent(QEvent::MouseMove, endDragPos + QPoint(5, 0), gEndDragPos + QPoint(5, 0), ++ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); ++ QMouseEvent releaseEvent(QEvent::MouseButtonRelease, endDragPos, gEndDragPos, ++ Qt::LeftButton, Qt::NoButton, Qt::NoModifier); ++ QCoreApplication::sendEvent(internalView, &moveEvent); ++ QCoreApplication::sendEvent(internalView, &releaseEvent); ++ }); ++ ++ // (*) this somehow blocks... ++ QMouseEvent moveEvent1(QEvent::MouseMove, endDragPos + QPoint(10, 0), gEndDragPos + QPoint(10, 0), ++ Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); ++ QCoreApplication::sendEvent(internalView, &moveEvent1); ++ ++ QTest::qWait(100); ++ ++ // final tests of dragged text ++ QCOMPARE(doc.text(), QString("line0\n" ++ "line2\n" ++ "line1\n" ++ "\n" ++ "line4")); ++ ++ QCOMPARE(view->cursorPosition(), KTextEditor::Cursor(3, 0)); ++ QCOMPARE(view->selectionRange(), Range(2, 0, 3, 0)); ++} ++ + // kate: indent-mode cstyle; indent-width 4; replace-tabs on; +diff --git a/autotests/src/kateview_test.h b/autotests/src/kateview_test.h +index 672e74e6..a48720d9 100644 +--- a/autotests/src/kateview_test.h ++++ b/autotests/src/kateview_test.h +@@ -43,6 +43,8 @@ private Q_SLOTS: + void testKillline(); + + void testFoldFirstLine(); ++ ++ void testDragAndDrop(); + }; + + #endif // KATE_VIEW_TEST_H +diff --git a/src/view/kateviewinternal.cpp b/src/view/kateviewinternal.cpp +index 35545cc1..23a1e21e 100644 +--- a/src/view/kateviewinternal.cpp ++++ b/src/view/kateviewinternal.cpp +@@ -3241,22 +3241,26 @@ void KateViewInternal::dropEvent(QDropEvent *event) + doc()->insertText(targetCursor, text, m_view->blockSelection()); + + KTextEditor::DocumentCursor startCursor(doc(), targetCursor); ++ KTextEditor::DocumentCursor endCursor1(doc(), targetCursor); ++ const int textLength = text.length(); + + if (event->dropAction() != Qt::CopyAction) { + m_view->removeSelectedText(); ++ if (m_cursor.toCursor() < startCursor.toCursor()) { ++ startCursor.move(-textLength); ++ endCursor1.move(-textLength); ++ } + } + +- KTextEditor::DocumentCursor endCursor1(doc(), startCursor); +- + if (!m_view->blockSelection()) { +- endCursor1.move(text.length()); ++ endCursor1.move(textLength); + } else { + endCursor1.setColumn(startCursor.column() + selectionWidth); + endCursor1.setLine(startCursor.line() + selectionHeight); + } + + KTextEditor::Cursor endCursor(endCursor1); +- qCDebug(LOG_KTE) << startCursor << "---(" << text.length() << ")---" << endCursor; ++ qCDebug(LOG_KTE) << startCursor << "---(" << textLength << ")---" << endCursor; + setSelection(KTextEditor::Range(startCursor, endCursor)); + editSetCursor(endCursor); + diff -Nru ktexteditor-5.28.0/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch ktexteditor-5.28.0/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch --- ktexteditor-5.28.0/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch 1970-01-01 01:00:00.000000000 +0100 +++ ktexteditor-5.28.0/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch 2017-04-07 11:57:02.000000000 +0200 @@ -0,0 +1,64 @@ +From: Christoph Cullmann <cullm...@kde.org> +Date: Mon, 9 Jan 2017 06:17:42 +0100 +Subject: fix minimap rendering for HiDPI envs + +Differential Revision: https://phabricator.kde.org/D4018 +--- + src/view/kateviewhelpers.cpp | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp +index e74a237e..3b45d8d4 100644 +--- a/src/view/kateviewhelpers.cpp ++++ b/src/view/kateviewhelpers.cpp +@@ -476,7 +476,8 @@ void KateScrollBar::updatePixmap() + modifiedLineColor.setHsv(modifiedLineColor.hue(), 255, 255 - backgroundColor.value() / 3); + savedLineColor.setHsv(savedLineColor.hue(), 100, 255 - backgroundColor.value() / 3); + +- m_pixmap = QPixmap(pixmapLineWidth, pixmapLineCount); ++ // increase dimensions by ratio ++ m_pixmap = QPixmap(pixmapLineWidth * m_view->devicePixelRatio(), pixmapLineCount * m_view->devicePixelRatio()); + m_pixmap.fill(QColor("transparent")); + + // The text currently selected in the document, to be drawn later. +@@ -583,6 +584,10 @@ void KateScrollBar::updatePixmap() + } + } + } ++ ++ // set right ratio ++ m_pixmap.setDevicePixelRatio(m_view->devicePixelRatio()); ++ + //qCDebug(LOG_KTE) << time.elapsed(); + // Redraw the scrollbar widget with the updated pixmap. + update(); +@@ -627,7 +632,7 @@ void KateScrollBar::miniMapPaintEvent(QPaintEvent *e) + //style()->drawControl(QStyle::CE_ScrollBarSubLine, &opt, &painter, this); + + // calculate the document size and position +- const int docHeight = qMin(grooveRect.height(), m_pixmap.height() * 2) - 2 * docXMargin; ++ const int docHeight = qMin(grooveRect.height(), int(m_pixmap.height() / m_pixmap.devicePixelRatio() * 2)) - 2 * docXMargin; + const int yoffset = 1; // top-aligned in stead of center-aligned (grooveRect.height() - docHeight) / 2; + const QRect docRect(QPoint(grooveRect.left() + docXMargin, yoffset + grooveRect.top()), QSize(grooveRect.width() - docXMargin, docHeight)); + m_mapGroveRect = docRect; +@@ -683,17 +688,17 @@ void KateScrollBar::miniMapPaintEvent(QPaintEvent *e) + } + + // Smooth transform only when squeezing +- if (grooveRect.height() < m_pixmap.height()) { ++ if (grooveRect.height() < m_pixmap.height() / m_pixmap.devicePixelRatio()) { + painter.setRenderHint(QPainter::SmoothPixmapTransform); + } + + // draw the modified lines margin +- QRect pixmapMarginRect(QPoint(0, 0), QSize(s_pixelMargin, m_pixmap.height())); ++ QRect pixmapMarginRect(QPoint(0, 0), QSize(s_pixelMargin, m_pixmap.height() / m_pixmap.devicePixelRatio())); + QRect docPixmapMarginRect(QPoint(0, docRect.top()), QSize(s_pixelMargin, docRect.height())); + painter.drawPixmap(docPixmapMarginRect, m_pixmap, pixmapMarginRect); + + // calculate the stretch and draw the stretched lines (scrollbar marks) +- QRect pixmapRect(QPoint(s_pixelMargin, 0), QSize(m_pixmap.width() - s_pixelMargin, m_pixmap.height())); ++ QRect pixmapRect(QPoint(s_pixelMargin, 0), QSize(m_pixmap.width() / m_pixmap.devicePixelRatio() - s_pixelMargin, m_pixmap.height() / m_pixmap.devicePixelRatio())); + QRect docPixmapRect(QPoint(s_pixelMargin, docRect.top()), QSize(docRect.width() - s_pixelMargin, docRect.height())); + painter.drawPixmap(docPixmapRect, m_pixmap, pixmapRect); + diff -Nru ktexteditor-5.28.0/debian/patches/katesyntaxtest_check_basename ktexteditor-5.28.0/debian/patches/katesyntaxtest_check_basename --- ktexteditor-5.28.0/debian/patches/katesyntaxtest_check_basename 2016-11-18 16:07:00.000000000 +0100 +++ ktexteditor-5.28.0/debian/patches/katesyntaxtest_check_basename 2017-04-07 11:57:02.000000000 +0200 @@ -7,7 +7,7 @@ 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autotests/src/katesyntaxtest.cpp b/autotests/src/katesyntaxtest.cpp -index 04d74bf..4f0b4f8 100644 +index 04d74bf2..4f0b4f86 100644 --- a/autotests/src/katesyntaxtest.cpp +++ b/autotests/src/katesyntaxtest.cpp @@ -55,7 +55,7 @@ void KateSyntaxTest::testSyntaxHighlighting_data() diff -Nru ktexteditor-5.28.0/debian/patches/series ktexteditor-5.28.0/debian/patches/series --- ktexteditor-5.28.0/debian/patches/series 2016-11-18 16:07:00.000000000 +0100 +++ ktexteditor-5.28.0/debian/patches/series 2017-04-07 11:57:02.000000000 +0200 @@ -1 +1,3 @@ katesyntaxtest_check_basename +Fix-Forward-dragging-text-results-in-wrong-selection.patch +fix-minimap-rendering-for-HiDPI-envs.patch