Bug 377562 - [PATCH] protecting against accidental zooming
Summary: [PATCH] protecting against accidental zooming
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL: https://phabricator.kde.org/D5037
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-13 13:09 UTC by RJVB
Modified: 2018-04-04 09:20 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RJVB 2017-03-13 13:09:41 UTC
This is something I've brought up before but never with a real determination to address the issue myself:

With Qt's default shortcut/action mapping, text editor documents built on KTextEditor are prone to be victim of accidental zooming. Qt's standard for this is Ctrl-Wheel events. This means that systems with a trackpad that use 2-finger scrolling and scroll inertia may cause text zooming when the user holds presses the Ctrl key to trigger a shortcut (say, Ctrl-S to save the current document) before coasting has stopped completely. 

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.

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. But it's not very difficult to implement a similar protection under X11; a proof of concept designed by Thomas Lübking and me:

https://github.com/RJVB/qtwheeltest/blob/master/wheeltest.cpp

I'd appreciate it if someone could have a look at and comment this approach before I start integrating it with KTextEditor (if at all possible, I haven't checked that yet).
Comment 1 RJVB 2017-03-13 17:30:52 UTC
This was easier than I thought so I submitted a patch for review:
https://phabricator.kde.org/D5037
Comment 2 RJVB 2017-03-13 17:34:37 UTC
This was easier than I thought so I submitted a patch for review:
https://phabricator.kde.org/D5037
Comment 3 Nate Graham 2017-11-28 22:13:29 UTC
author	R.J.V. Bertin <rjvbertin@gmail.com>	2017-11-12 16:36:10 (GMT)
committer	R.J.V. Bertin <rjvbertin@gmail.com>	2017-11-12 16:36:10 (GMT)
commit	f51befdc80b1a8dfd65b800b3b10dba97d10a2cb (patch)
tree	a2ea7719932973a03323d4105367892f9a888c45
parent	79f8dcb63ad5b4650c0081e90840359a3caa3eda (diff)
prevent accidental zooming.
This helps prevent problems that can occur with simulated scroll inertia
(e.g. trackpads supporting 2-finger scrolling under X11). Unexpected,
accidental text zooming can arise when the user holds presses the Ctrl
key to trigger a shortcut before scroll coasting has stopped completely.

Differential Revision: https://phabricator.kde.org/D5037
Diffstat
-rw-r--r--	src/view/kateviewinternal.cpp	63	
		
-rw-r--r--	src/view/kateviewinternal.h	3	
		
2 files changed, 64 insertions, 2 deletions