Open Bug 1444223 Opened 6 years ago Updated 11 months ago

Honour cross-platform AND system AND user scrollbar preferences

Categories

(Core :: Widget: Gtk, task, P5)

task

Tracking

()

Tracking Status
firefox60 --- affected

People

(Reporter: jgamleus, Unassigned)

Details

Action:
One clicks in a Mozilla application like Firefox, Thunderbird or Seamonkey the (left) mouse button on the vertical scrollbar in any window, iframe or form

Expected:
The cross-platform preferences of a Mozilla application are honoured (primary click=scroll one page, other click/shift click/right click=warp)

Result:
On Windows and macOS the cross-platform preferences are honoured, but with Linux the system wide preferences are honoured (primary click=warp, other click/shift click/right click=scroll one page).

Bug 1269172 Behaviors transposed for {Click on Scrollbar} and {Shift+click on Scrollbar} shows that in Linux the switch between click and shift-click is intentional, not a bug.

Bug 803633 [Linux gtk] Honor scrollbar preference of system, with honor in the imperative tense, shows indeed that someone considered the system wide preferences of GTK+3 (primary click=warp) not being honoured as a bug and people started coding immediately, resulting in FF and TB having this warp-behaviour already several years and SM now several weeks.

But perhaps people started coding a bit too quick, because the question involves a general, deep, question: in case of conflict, what should have precedence: the cross-platform Mozilla preferences (e.g. scroll bars in FF, TB, SM behave the same in Windows, macOS, Linux) or the system wide Linux GTK+3 preferences (e.g. scroll bars behave the same in all applications under Linux)?

And the question can be stated in an even more general form: in case of conflict, what should have precedence: the cross-platform preferences of any cross-platform application (running on Windows, macOS and Linux) or the system preferences of any system (be it either Windows, macOS or Linux)?

Furthermore, there are user preferences. In the scroll bar example they are as follows.

As https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-primary-button-warps-slider points out, users can add to ~/.config/gtk-3.0/settings.ini the line [Settings] gtk-primary-button-warps-slider = false to enforce primary-click=scoll behaviour and the (curiously enough) middle click=warp-behaviour. But there is no such line by default, the user has to add the line.

As http://kb.mozillazine.org/Ui.scrollToClick points out, users can set their individual Mozilla preferences by surfing to about:config and setting a new preference 'ui.scrollToClick' to 0 to enforce the primary-click=scroll behaviour and the right/shift click=warp-behaviour. Also here, there is no such preference by default, the user has to create it.

Looking for an ad hoc solution to put the preference somewhere in a file (seems most files are gone by now and are hard coded?), in Firefox 58.0.2, Thunderbird 52.6.0 and Seamonkey 2.49.2 there is a directory defaults/pref containing channel-pref.js which contains pref("app.update.channel", "release"); . If one puts there a similar file, e.g. all.js, containing pref("ui.scrollToClick", 0); we get the same primary-click=scroll behaviour as manually setting the preference.

So one has system wide preferences, cross-platform application preferences and user preferences.

Then in the most general form the question becomes: in case of conflict, what should have precedence: the cross-platform preferences, the system wide preferences or the user preferences?

Or, to put it in other words: what is the order of precedence of cross-platform preferences, system wide preferences and user preferences?

There are many duplicates of this issue in Bugzilla relating to scroll bar and other behaviour but I see none discussing or solving the fundamental question of the order of precedence of both cross-platform, system as well as user preferences. Most handle one kind of preference, some handle two and none handles three.

So, let's handle this.

In the general case one has system-wide settings, cross-platform application settings and user settings.

The saying goes that one hour of thinking is worth more than years of coding. 

So, staring at this question on the screen intensely for one hour, the following solution came up:

1. cross-platform behaviour should have precedence over system-wide behaviour, but user settings should have precedence over application settings.
2. if this is true, then a Mozilla application has to test whether the GTK-flag is manually set in a file (or has to query some GTK-function). If set, then this uniform system-wide behaviour is requested by the user and this user setting has precedence over the standard application behaviour.
3. we could as well make in a Mozilla application next to Menu, Edit, Preferences, Browser, Location Bar an entry Scroll Bar, with the action desired by the user when clicked on the scroll bar: 1. cross-platform Mozilla/scroll behaviour anytime 2. default (cross-platform/scroll behaviour if there is no system wide/warp behaviour requested by the user in a GTK setting, otherwise the latter has precedence) 3. system-wide/warp behaviour anytime.

So the order of precedence is (from low to high)
1. the standard setting of GTK
2. the standard setting of Mozilla
3. the user setting of GTK 
4. the user setting of Mozilla

This takes into account both the system settings, as well as the application settings as well as the user settings, hence the title of this bug.

So, when a system starts up, it sets the scroll bar behaviour to something (e.g. Linux GTK+3 sets it standard to warp-behaviour).
Then, when a Mozilla application starts up, it thinks "I am bigger than you are" and sets the scroll bar behaviour to something (e.g. FF/TB/SM sets it standard to scroll-behaviour).
Then the Mozilla application thinks "what the user wants as system-wide behaviour is even more important than what I want as standard cross-platform behaviour" and sets the behaviour according to the GTK-flag, if any.
Then the Mozilla application thinks "what the user wants as cross-platform Mozilla behaviour is even more important then what the user wants as system-wide behaviour" and sets the behaviour according to the Mozilla user preference, if any.

In a default environment, where the user has not set any GTK or Mozilla preferences, this results in standard Mozilla behaviour, which means a return to scroll behaviour.

Let us keep in mind that any "standard behaviour" of a system or application can be changed by its designers at any time. The mentioned precedence order is only a proposal to resolve things in time of conflict, as is now the case with the scroll bar behaviour of a Mozilla application in Windows and macOS resp. Linux.

However, it all depends on whether the setting of the user GTK-flag (gtk-primary-button-warps-slider) and the user Mozilla preference (ui.scrollToClick) can be read in three different states: true, default/not set and false. I don't have the practical expertise to determine this.

So what do we think of the proposal? (before anyone starts coding :)
IMO, priority high to low should be:

1-user's profile setting (ui.scrollToClick if set)
2-global system setting (/etc/gtk-3.0/settings.ini) if it exists
3-WM/DE default (if different from upstream)
4-distro's default (if different from upstream)
5-upstream (GTK) default

Isn't this what it already is?
But for instance, now, in the default distributions of a Mozilla application (FF/TB/SM), the scrollbar acts differently in Linux than in Windows and macOS. There is no uniform cross-platform behaviour any more. Is this what we want of Mozilla?

Suppose a teacher standing for a class full of Windows, macOS and Linux computers, teaching Firefox to his students. He has to say "if you click on the scrollbar then this and this happens", not "look first on your computer, if it has a Windows sticker then ..., if it is an Apple then ...," etc.

On the other hand one can image a teacher standing for a class full of Linux computers, teaching Linux behaviour to his students. He would like to say "in an arbitrary application, if you click on the scroll bar then this and this happens", not "in a Mozilla application, if you click on the scroll bar then this and this happens, in that and that program, if you click on the scroll bar then that and that happens".

What weighs heavier?

Or think of a student who puts his profile on a USB stick (don't know whether that is possible) and puts it one time in a Windows PC, thereafter in an Apple, thereafter in a Linux machine, each time using the Mozilla application installed on that machine. He expects the scroll bar to work on all machines the same. Or doesn't he?

So what should be the order of honouring the cross-platform, system and user preferences?
(In reply to Johannes Leushuis from comment #2)
> So what should be the order of honouring the cross-platform, system and user
> preferences?

As long as GTK upstream is contrary to Mac and Windows, Linux distros and/or WM/DEs should probably be providing cross-platform defaults. The problem is that Gnome and/or Fedora and/or Ubuntu is/are almost certainly the source(es) of GTK contrariness. I never allocate disk space to Gnome, so can't know what to expect from it, or why.

In the meantime, schools providing computers with and/or teaching Linux as adjunct to primary studies may need to be providing /etc/gtk-3.0/settings.ini.
QA Whiteboard: qa-not-actionable

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --
Priority: -- → P3
Severity: -- → S4
Type: defect → task
Priority: P3 → P5
You need to log in before you can comment on or make changes to this bug.