Bug 115363 - [GTK] clicking on the scrollbar trough steps rather than jumps to the clicked position
Summary: [GTK] clicking on the scrollbar trough steps rather than jumps to the clicked...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on: 153493
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-29 09:38 PDT by Sebastian Keller
Modified: 2016-02-16 01:50 PST (History)
9 users (show)

See Also:


Attachments
Patch (15.52 KB, patch)
2016-02-10 09:43 PST, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Keller 2013-04-29 09:38:10 PDT
The current scrolling policy in gtk is to jump to the clicked position
immediately rather than step to it. Epiphany behaved this way too before the
webkit2 port.

To test this:
- go to http://git.gnome.org or some other page that requires scrolling

- left click the trough somewhere close to the bottom
--> it steps to the clicked position

- middle click the trough somewhere close to the bottom
--> it jumps immediately to the clicked position

- right click the trough somewhere close to the bottom
--> it opens the context menu


What other gtk apps currently do:
- open /usr/bin in nautilus

- left click the trough somewhere close to the bottom
--> it jumps immediately to the clicked position

- middle click the trough somewhere close to the bottom
--> nothing

- right click the trough somewhere close to the bottom
--> it steps to the clicked position
Comment 1 Carlos Garcia Campos 2016-02-10 09:43:24 PST
Created attachment 270996 [details]
Patch
Comment 2 Michael Catanzaro 2016-02-15 22:26:28 PST
Comment on attachment 270996 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=270996&action=review

Looks great

> Source/WebCore/ChangeLog:8
> +        Allow RenderTheme to decide the behavior of a button press event,

RenderTheme -> ScrollbarTheme

> Source/WebCore/ChangeLog:15
> +        (WebCore::Scrollbar::mouseDown): Ask RenderTheme to handle the

Ditto.

> Source/WebCore/platform/Scrollbar.cpp:396
> +    if (action == ScrollbarButtonPressAction::None)

Eh... on the one hand, it's probably the best solution.

On the other hand, it's not great that policy is decided by a class called "theme." Did you consider having Scrollbar::platformHandleMousePressEvent and adding new files for each port just to implement that; it's a bit more work, but this is platform after all.

On the other other hand, shouldCenterOnThumb is already there, and maybe the logic is tied so closely to the theme it's just the best place. So whatevs.

> Source/WebCore/platform/mac/ScrollbarThemeMac.mm:449
> +        break;

Fix this unreachable break

> Source/WebCore/platform/win/ScrollbarThemeWin.cpp:209
> +        break;

Ditto.
Comment 3 Carlos Garcia Campos 2016-02-16 01:50:34 PST
Committed r196632: <http://trac.webkit.org/changeset/196632>