SUMMARY STEPS TO REPRODUCE 1. When selecting text and dragging over the edge, auto scrolling starts 2. Notice this is way faster down than up. 3. Notice this is likely way faster than you'd like to ADDITIONAL INFORMATION I worked mostly with an old version (14.3) and with kile, but I just tested in a VM with debian buster having 18.8.0 the same bug is still there In the old version I seem to have fixed it with following patch. There are two issues, one is in KateViewInternal::scrollTimeout() itself, where placeCursor() and scrollLines() interfere with each other on the startLine. And the other is in KateViewInternal::mouseMoveEvent() where in case of scrollTimouts when dragging the mouse and moving the mouse around, the events double an again placeCursor() messes around with startLine. In my "fix" I just disabled placing the cursor when scrollTimeouts are about to arrive, as this will be place the cursor (with correct scrolling speed). ----------------------- diff -ru kate-4.14.3/part/view/kateviewinternal.cpp kate-4.14.3-orig/part/view/kateviewinternal.cpp --- kate-4.14.3/part/view/kateviewinternal.cpp 2019-06-18 17:05:47.507032294 +0200 +++ kate-4.14.3-orig/part/view/kateviewinternal.cpp 2014-10-26 21:17:55.000000000 +0100 @@ -2864,7 +2864,7 @@ m_scrollY = d; } - if( !m_scrollY ) placeCursor( QPoint( m_mouseX, m_mouseY ), true ); + placeCursor( QPoint( m_mouseX, m_mouseY ), true ); } else @@ -3092,9 +3092,8 @@ { if (m_scrollX || m_scrollY) { - int scrollTo = startPos().line() + (m_scrollY / (int) renderer()->lineHeight()); + scrollLines (startPos().line() + (m_scrollY / (int) renderer()->lineHeight())); placeCursor( QPoint( m_mouseX, m_mouseY ), true ); - scrollLines (scrollTo); } } ----------------- Sorry it's for the old version where I needed this fixed, but I believe some way or another it's still an up2date bug, probably with some similar fix. Maybe there is a more elegant solution to keep better track of startLine while auto-scrolling.
PS: sorry my above patch proposal got out to be reversed, this is in the right direction: diff -ru kate-4.14.3-orig/part/view/kateviewinternal.cpp kate-4.14.3/part/view/kateviewinternal.cpp --- kate-4.14.3-orig/part/view/kateviewinternal.cpp 2014-10-26 21:17:55.000000000 +0100 +++ kate-4.14.3/part/view/kateviewinternal.cpp 2019-06-18 17:05:47.507032294 +0200 @@ -2864,7 +2864,7 @@ m_scrollY = d; } - placeCursor( QPoint( m_mouseX, m_mouseY ), true ); + if( !m_scrollY ) placeCursor( QPoint( m_mouseX, m_mouseY ), true ); } else @@ -3092,8 +3092,9 @@ { if (m_scrollX || m_scrollY) { - scrollLines (startPos().line() + (m_scrollY / (int) renderer()->lineHeight())); + int scrollTo = startPos().line() + (m_scrollY / (int) renderer()->lineHeight()); placeCursor( QPoint( m_mouseX, m_mouseY ), true ); + scrollLines (scrollTo); } }
Thanks for the patch! Can you submit it using https://phabricator.kde.org/differential/diff/create/? Full documentation is available at https://community.kde.org/Infrastructure/Phabricator
OK, there I uplaoded it. https://phabricator.kde.org/D22071
Thanks!
Git commit 4f4d1ad9b78999671c4944e013ea4f103d8ce86c by Christoph Cullmann, on behalf of Axel Kittenberger. Committed on 24/06/2019 at 20:14. Pushed by cullmann into branch 'master'. fix autoscrolling down speed Differential Revision: https://phabricator.kde.org/D22071 M +5 -2 src/view/kateviewinternal.cpp https://commits.kde.org/ktexteditor/4f4d1ad9b78999671c4944e013ea4f103d8ce86c