Bug 417811 - click+hold on scrollbar thumb triggers scrolling to that point on the track instead of allowing drag
Summary: click+hold on scrollbar thumb triggers scrolling to that point on the track i...
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-18 03:01 UTC by fantasai
Modified: 2023-02-19 17:20 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fantasai 2020-02-18 03:01:35 UTC
SUMMARY
One common method of interacting with a scrollbar is to drag the thumb to the desired position. This is currently broken in Kate because the click needed to activate dragging behavior (triggered by click+hold of the mouse) changes the scroll position. Point-and-click scrolling should be triggered on mouseup, not mousedown, and not if there was a drag operation in between.

STEPS TO REPRODUCE
1. Open a multi-page document
2. Scroll partway down.
3. Click on the scrollbar and hold down the mouse, as if you're going to drag the scrollbar thumb to scroll the document.
4. Pause and observe what happened...

OBSERVED RESULT

Notice that even before you drag the thumb, the page has scrolled to some random other point, depending on where in the scrollbar thumb you happened to click.


EXPECTED RESULT

Holding down the mouse key on the scrollbar thumb should have no effect on the scroll position.
SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Kåre Särs 2020-02-18 08:58:29 UTC
I think this is working as designed.

When the mini-map is enabled clicking the scrollbar jumps directly to the place in the document that corresponds to the place that was clicked on the scrollbar.

Is there some tweaking to that behavior that you are after?

I could think of not jumping immediately to the clicked place, if the clicked area is under the handle. So if you only want to move a short distance you do not have to hit exactly the right place when you press the button and can then move up/down, which might be more precise.
Comment 2 Nate Graham 2020-02-18 16:46:20 UTC
Yes, I think what's being requested is for it to only jump to the exact place that's clicked if the click is *outside* the scroll handle. All other scrollbars behave this way, but Kate's minimap scrollbar does not.

Perhaps, if the clicked area is inside the scroll handle, it would only immediately jump to that location if the cursor is released without moving.

Does that make any sense?
Comment 3 fantasai 2020-02-19 06:01:45 UTC
Yes, exactly, 100% agree with Nate's comment!
Comment 4 Kåre Särs 2020-02-19 06:59:32 UTC
OK,

I think we have an agreement on that pressing the mouse button on the scroll-handle should not jump directly to the corresponding place.

I do think tho that it should not jump to that location on release either. I think it is more logical that if the handle is pressed it means that you "grab" it for moving and if you then change your mind and release it, it should not jump.
Comment 5 Nate Graham 2020-02-19 14:50:26 UTC
Yeah, that makes sense to me.
Comment 6 Bug Janitor Service 2023-02-19 12:22:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/485
Comment 7 Christoph Cullmann 2023-02-19 17:20:57 UTC
Git commit f51556552f0d896f8f14797fe094b9a46b1e37d7 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 19/02/2023 at 16:53.
Pushed by cullmann into branch 'master'.

Minimap: Dont jump if click is inside the slider

M  +2    -1    src/view/kateviewhelpers.cpp
M  +1    -0    src/view/kateviewhelpers.h

https://invent.kde.org/frameworks/ktexteditor/commit/f51556552f0d896f8f14797fe094b9a46b1e37d7