<table><tr><td style="">rjvbb created this revision.<br />rjvbb added a project: KTextEditor.<br />Restricted Application added subscribers: Frameworks, kwrite-devel.<br />Restricted Application added a project: Frameworks.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D5037" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>KTextEditor::KateViewInternal::wheelEvent() implements text zoom in reaction to Ctrl+Wheel events, something Qt also implements or used to implement for QTextEdit and/or QTextBrowser.<br />
Problems can occur with systems with a trackpad that use 2-finger scrolling and scroll inertia. These are subject to unexpected, accidental text zooming when the user holds presses the Ctrl key to trigger a shortcut (say, Ctrl-S to save the current document) before scroll coasting has stopped completely.</p>
<p>The end of coasting isn't always clear: scroll events may continue to come in with sub-threshold deltas, or when the view has already reached its extreme position and can scroll no further. This affects me much more frequently than I would like in applications like KDevelop and is especially annoying since there is no standard shortcut to return to 100% (no zoom).</p>
<p>Qt itself has a form of protection against this kind of annoyance on Mac and possibly other systems where inertial scrolling has better platform support than under X11.<br />
This patch provides what I hope is a reasonably minimal implementation of a similar protection that ignores Control modifier changes that occur within a certain lapse of time after the start of a series of wheel events.</p>
<p>See also <a href="https://bugs.kde.org/show_bug.cgi?id=377562" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=377562</a></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>This is stripped-down version of a proof of concept designed by Thomas Lübking and me and well tested on Linux and Mac:</p>
<p><a href="https://github.com/RJVB/qtwheeltest/blob/master/wheeltest.cpp" class="remarkup-link" target="_blank" rel="noreferrer">https://github.com/RJVB/qtwheeltest/blob/master/wheeltest.cpp</a></p>
<p>the timing parameters have been tuned in a rather ad-hoc fashion; the lower threshold is probably just fine as it is but the higher threshold could possibly be set lower. It represents the time one would have to hold down the Ctrl key before wheel events again cause zooming after the protection has triggered. Any wheel event without the modifier key set will also reset the timer.</p>
<p>This is a patch that merits being tested in practice, not just reviewed in source code.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R39 KTextEditor</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5037" rel="noreferrer">https://phabricator.kde.org/D5037</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/view/kateviewinternal.cpp<br />
src/view/kateviewinternal.h</div></div></div><br /><div><strong>To: </strong>rjvbb, KTextEditor<br /><strong>Cc: </strong>kwrite-devel, KTextEditor, Frameworks, head7, cullmann, kfunk, sars, dhaumann<br /></div>