Closed Bug 408053 Opened 17 years ago Closed 14 years ago

Horizontal Scrolling in Tab Bar

Categories

(Firefox :: Tabbed Browser, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: lie.1296, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b1) Gecko/2007110904 Firefox/3.0b1

I think it'd be nice to add horizontal scrolling as a way to scroll the tab bar. Most laptops (through Synaptics or middle button) and some (odd) mouses have a horizontal scrolling feature, in these devices, it'd be nice to use these to scroll the tab bar and actually it's very confusing to use vertical scrolling to scroll a bar that is horizontal. I say, keep the vertical scroll as many devices don't have horizontal scrolling, but add horizontal scrolling as a way to browse the tab.

Reproducible: Always
One problem with allowing both is that it can lead to jerkiness when you're trying to move either vertically or horizontally but don't go exactly straight.  See bug 378028 for an example of this happening.
What about adding an option to choose whether you want horizontal or vertical scrolling in the tab bar?

btw, what's double fingered scrolling? I think it's some mac's feature, but what it does actually?
If you put two fingers on the trackpad instead of one finger, moving your fingers scrolls instead of moving the cursor.  You're correct; this is a feature of Mac laptops.
Is it possible for Firefox to have different configuration sets on different OS? So since this problem only exist in Macs, the configuration might appear only on Macs.

Or is it feasible to implement an auto detection of the scrolling direction? Unlike browsing a page, I think when scrolling a tab bar, people would never (want to) use both horizontal and vertical scrolling at the same time, so an auto detection should be possible, in which we detect the larger movement. Perhaps something like this:

if (abs(mouse.x_old - mouse.x_new) > abs(mouse.y_old - mouse.y_new)) {
    scroll_horizontal(mouse.x_old - mouse.x_new);
}
else {
    scroll_vertical(mouse.y_old - mouse.y_new);
}

[the syntax should be C++, but since I don't speak C++...]
(In reply to comment #4)
> If you put two fingers on the trackpad instead of one finger, moving your
> fingers scrolls instead of moving the cursor.  You're correct; this is a
> feature of Mac laptops.

Well, actually you can have this feature using synaptics on GNU/Linux
Just set:

VertTwoFingerScroll=1
HorizTwoFingerScroll=1

When you put two fingers on the trackpad ans move them up, you scroll up, move left, you scroll left, and so on.
The problem with firefox (at least version 2) is that if you don't go straight, it's a mess. And not only in the main window. In the Firefox UI (in lists for example) left and right scrolls are understood as page up/down. That implies you can hardly scroll the list.
And firefox is not the only software having problems. java applications understand left and right scroll as right click.


(In reply to comment #5)
> Is it possible for Firefox to have different configuration sets on different
> OS? So since this problem only exist in Macs, the configuration might appear
> only on Macs.

Well, hardly on macs only. As I said it works also on GNU/Linux ... and the Apple Mighty Mouse (which has a scroll ball instead or a wheel, so it has the same problem) is a regular USB mouse and can be connected on Windows computers too.

I think that the default behaviour should be to scroll ... and others behaviours  could be selected in the preferences panel.
I originally proposed this feature for a (laptop) touchpad where the Synaptic provides a feature called "Virtual Scrolling". In Virtual Scrolling, you move your finger sideways at the lower region of the touchpad to do horizontal scroll and move your finger vertically at the right region of the touchpad to scroll vertically. In Virtual Scrolling, it is impossible to misidentify whether we're doing vertical or horizontal scrolling so I don't think it should be a problem.

The problem arises because there is a similar feature called two-fingered scrolling in (at least) Macs and GNU/Linux's Synaptic, where it is easy to misidentify whether the scrolling is vertical or horizontal.

An easy solution would then be to have the configuration what scrolling style you want to use on all OSes. The configuration would consist of two checkbox: Allow horizontal scrolling on Tab Bar and Allow Vertical Scrolling on Tab Bar. The default value should be to only allow Vertical Scrolling as there are more people that don't have horizontal scrolling available and mixing both might become problematic for some users (specifically Mac and some Synaptic+GNU/Linux users) and allowing none would just confuse everyone. Alternatively it could also be made a combobox that have four values.
This bug has since been fixed, and we are currently addressing the issues that Jesse brought up in comment #1. (See bug 565788.)
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
Here's the fix:
http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/scrollbox.xml#423

Since this file will likely be modified soon, here's the actual code:
<handler event="DOMMouseScroll"><![CDATA[
  // prevent horizontal scrolling from scrolling a vertical scrollbox
  if (event.axis == event.HORIZONTAL_AXIS &&
      this.orient == "vertical")
    return;
  // We allow vertical scrolling to scroll a horizontal scrollbox
  // because many users have a vertical scroll wheel but no
  // horizontal support.

  this.scrollByIndex(event.detail);
  event.stopPropagation();
]]></handler>
Resolution: WORKSFORME → FIXED
You need to log in before you can comment on or make changes to this bug.