After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787669 - Middle mouse click on scrollbar is ignored
Middle mouse click on scrollbar is ignored
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkScrolledWindow
3.22.x
Other Linux
: Low enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-09-14 11:40 UTC by Konstantin Kharlamov
Modified: 2017-10-11 21:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
range: Bring back middle clicks (1.87 KB, patch)
2017-10-11 19:09 UTC, Matthias Clasen
committed Details | Review
Settings: Reflect resurrected middleclick in Range (1.41 KB, patch)
2017-10-11 20:55 UTC, Daniel Boles
committed Details | Review

Description Konstantin Kharlamov 2017-09-14 11:40:51 UTC
Usually applications allow to scroll immediately at the point of the click by clicking the scrollbar with middle mouse button. It is most useful with big documents as it allows to not try catching the small scroll widget of the scrollbar, but to scroll immediately.

But for some reason it doesn't work in evince.

To reproduce:

1. Open a document with multiple pages
2. Click on the free space of the scrollbar with middle mouse button (i.e. the button under wheel).
3. See as nothing happens (it ought to scroll at the point of the click)

It's said that gtk3 apps need the settings below for that to work — I have it set.

	$ grep gtk-primary-button-warps-slider ~/.config/gtk-3.0/settings.ini
	gtk-primary-button-warps-slider=false
Comment 1 Jason Crain 2017-09-23 23:58:26 UTC
I'm not aware of any gtk3 apps which do this, scroll on middle click, so I'm marking this as an enhancement and reassigning to gtk3.
Comment 2 Konstantin Kharlamov 2017-09-24 00:03:36 UTC
(In reply to Jason Crain from comment #1)
> I'm not aware of any gtk3 apps which do this, scroll on middle click, so I'm
> marking this as an enhancement and reassigning to gtk3.

Well, granted I don't use much gtk3 apps, but it works in Thunderbird and Firefox. Anyway, why is that an enhancement as opposed to a bug if there is an option to enable that behavior?
Comment 3 Konstantin Kharlamov 2017-09-24 00:05:46 UTC
I'm also put this link here for two reasons: to show it's a popular feature, and that usually that option is used to enable it in gtk3 apps https://askubuntu.com/questions/295988/how-to-fix-gtk3-scrollbar-behavior
Comment 4 Konstantin Kharlamov 2017-09-24 00:12:34 UTC
Ah, wait, never mind, it's a question about left click. It's worth noting though, that for some reason in Firefox middle click didn't work until I enabled just that option.
Comment 5 Matthias Clasen 2017-10-07 23:16:22 UTC
scrollbar behavior has changed a bit, but that is not a bug. web browsers like firefox do their own scrolling
Comment 6 Konstantin Kharlamov 2017-10-07 23:22:38 UTC
But this is a problem! May be this is not obvious, but recently it worked everywhere. To list:

Pidgin (gtk3), Konsole, Dolphin, Firefox, Thunderbird, Okular, Chromium, vlc, qutebrowser…

This is a usability problem, how do people supposed to scroll?
Comment 7 Konstantin Kharlamov 2017-10-08 11:43:43 UTC
@Matthias Clasen can you at least not close it? If not because it's useful, then at least for consistency with a bunch of other apps — it's clearly a feature, we can't create a bunch of bugreports to other toolkits and apps about "disabling middle click scroll for consistency with newer gtk3" (note: it worked in gtk3 earlier, e.g. pidgin is gtk3).
Comment 8 Konstantin Kharlamov 2017-10-08 11:59:12 UTC
I mean, so somebody besides gtk3 developers could join and be sure that if they fix it, the patchset will be accepted.
Comment 9 Alina-malina 2017-10-08 12:01:46 UTC
I encourage hi-angel and I want this feature to be added, please make this thing with middle-click-scrolling to work, because that will save tons of time for me and other developers, thanks!
Comment 10 Emmanuele Bassi (:ebassi) 2017-10-08 14:28:26 UTC
(In reply to hi-angel from comment #6)
> But this is a problem! May be this is not obvious, but recently it worked
> everywhere. To list:
> 
> Konsole

Which is a KDE/Qt application…

> Dolphin

Assuming you mean the file manager, another KDE/Qt application…

> Firefox, Thunderbird

Do not use GTK for their scrollbars…

> Okular

KDE/Qt application…

> Chromium,

Does not use GTK for the scrollbars…

> vlc, qutebrowser…

Do not use GTK…

> This is a usability problem, how do people supposed to scroll?

With their pointing device, or their touchscreen.

I assume, though, you're talking about *jumping* to a specific location. If you are using a GTK+ application (and only Pidgin, in the list above, applies) then you can scroll to the location of the pointer using Ctrl + click.
Comment 11 Konstantin Kharlamov 2017-10-08 14:33:45 UTC
> If you are using a GTK+ application (and only Pidgin, in the list above,
> applies) then you can scroll to the location of the pointer using Ctrl + click.

I just tried it with evince, and it doesn't work.

Either way, suppose it should work — why not to just bind one more shortcut? Nobody knows Ctrl+click, but everybody know middle-click for the simple reason that it worked earlier, including GTK3 until they, as Matthias said, changed scrollbar behavior a bit (e.g. pidgin has the old behavior).

Middle-click is a noop otherwise, so it should be fine.
Comment 12 Konstantin Kharlamov 2017-10-08 14:40:46 UTC
To add another GTK3 app: it does work in GIMP.
Comment 13 Matthias Clasen 2017-10-09 15:45:59 UTC
most laptops don't even have a middle mouse button.
different toolkits have different behaviors, its a fact of life.
we offer other useful functionality for scrolling, such as variable-speed smooth scrolling.
Comment 14 Emmanuele Bassi (:ebassi) 2017-10-09 15:47:47 UTC
(In reply to hi-angel from comment #12)
> To add another GTK3 app: it does work in GIMP.

GIMP is a GTK+ 2 application.
Comment 15 Konstantin Kharlamov 2017-10-09 16:07:23 UTC
Matthias Clasen: 

1. Peoples are using laptops with mouse whenever possible anyway. In fact, I am writing this right now from a laptop without a middle button, but I do use mouse.
2. Middle mouse click on touchpad is emulated by pressing both left and right buttons simulationously. It is actually hard to work without any middle mouse capability on touchpad, e.g. because it automatically leaves you without primary clipboard.

> we offer other useful functionality for scrolling

This is great, but please, can you explain why does this functionality conflict with a simple hotkey?
Comment 16 Daniel Boles 2017-10-11 18:54:22 UTC
(In reply to hi-angel from comment #0)
> It's said that gtk3 apps need the settings below for that to work — I have
> it set.
> 
> 	$ grep gtk-primary-button-warps-slider ~/.config/gtk-3.0/settings.ini
> 	gtk-primary-button-warps-slider=false

That affects what the primary button, i.e. single click, does.

It might indeed be good to have the option to keep that off, with the primary button doing pagewise movement, and make middle click do the warp if it doesn't conflict with anything; I don't know whether it would.
Comment 17 Matthias Clasen 2017-10-11 19:09:29 UTC
Created attachment 361347 [details] [review]
range: Bring back middle clicks

It does not hurt us to keep middle clicks doing the same
as shift-primary clicks. This makes the transition from gtk2
less painful in terms of muscle memory.
Comment 18 Matthias Clasen 2017-10-11 19:10:45 UTC
(In reply to hi-angel from comment #15)

> 
> This is great, but please, can you explain why does this functionality
> conflict with a simple hotkey?

I've come to the conclusion that it doesn't
Comment 19 Matthias Clasen 2017-10-11 19:16:04 UTC
Attachment 361347 [details] pushed as 2120ea6 - range: Bring back middle clicks
Comment 20 Konstantin Kharlamov 2017-10-11 19:18:08 UTC
Matthias Clasen, man, I love you, thank you very much!
Comment 21 Daniel Boles 2017-10-11 20:55:45 UTC
Created attachment 361381 [details] [review]
Settings: Reflect resurrected middleclick in Range

and while here, make the explanation more explicit as to which values do
what, & use general Range terminology instead of focussing on scrollbars
Comment 22 Daniel Boles 2017-10-11 21:19:45 UTC
Comment on attachment 361381 [details] [review]
Settings: Reflect resurrected middleclick in Range

cherry-picked to gtk-3-22

Attachment 361381 [details] pushed as 694686d - Settings: Reflect resurrected middleclick in Range