Last Comment Bug 673878 - Option to disable mousewheel scroll on tab bar
: Option to disable mousewheel scroll on tab bar
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: Trunk
: All All
: -- enhancement with 7 votes (vote)
: seamonkey2.6
Assigned To: Philip Chee
:
Mentors:
Depends on: 484968 643294 661450
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-25 03:32 PDT by Stefan A. Möller
Modified: 2011-09-16 02:40 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
fixed


Attachments
Patch v1.0 Minimalist Patch using SHIFT key. (1023 bytes, patch)
2011-08-24 10:46 PDT, Philip Chee
no flags Details | Diff | Splinter Review
Patch v1.1 Use a pref to control behaviour. (3.68 KB, patch)
2011-08-26 08:23 PDT, Philip Chee
jh: feedback+
rsx11m.pub: feedback+
Details | Diff | Splinter Review
Patch v1.0 Don't cache the pref. f=jh f=rsx11m. (3.66 KB, patch)
2011-09-14 20:34 PDT, Philip Chee
neil: review+
Details | Diff | Splinter Review

Description Stefan A. Möller 2011-07-25 03:32:10 PDT
From bug 661450:
>> When I'm scrolling through a page with the mouse wheel, if I happen to let
>> the cursor drift over the tab bar, or move it up there so as to not block
>> my view of the page content, rolling the wheel switches the view to
>> another tab. Very annoying and jarring.
>
> Invalid. This is deliberate.
> Now that bug 484968 is fixed, the scrollable tabbar eats the wheel events.

Deliberate or not, it *is* annoying. Therefore I request an option (in about:config) to disable mousewheel scroll on the tab bar.
Comment 1 therube 2011-07-25 09:12:22 PDT
Confirmed.

There should be a Preference item to disable this "feature".
Comment 2 Stefan [:stefanh] 2011-07-25 11:55:45 PDT
If this is done, it should be done for tabmail too.
Comment 3 Philip Chee 2011-07-26 13:39:03 PDT
Does scrolling the scroll wheel change the selected tab in tabmail?
Comment 4 Stefan A. Möller 2011-07-26 23:59:38 PDT
No, it doesn't.
Comment 5 tonda kavalec 2011-08-08 22:49:36 PDT
Would be possible to make the behaviour like in Opera? Right click and hold + wheel to scroll between tabs? This would solve the problem in an elegant way, though. What do you think about it?
Comment 6 Philip Chee 2011-08-11 10:50:54 PDT
> Would be possible to make the behaviour like in Opera? Right click and hold +
> wheel to scroll between tabs? This would solve the problem in an elegant way,
> though. What do you think about it?
Certainly sounds possible. Anybody else think this is a good idea?
Comment 7 rsx11m 2011-08-13 09:17:03 PDT
Needing *some* other action for tab scrolling indeed should be a good idea to prevent accidental tab changes when you just meant to scroll the content. It should be better than some preference in that it can be done easily on the fly.

I'm not sure if right-click + wheel would conflict with the context menu, which only shows up after releasing the mouse button. Currently, keeping the mouse button down still allows tab scrolling (testing on Windows 7), so that might work. The other option would be a combination of wheel + Shift or Ctrl key.
Comment 8 therube 2011-08-15 07:46:33 PDT
> Needing *some* other action for tab scrolling ... should be better than some preference
> in that it can be done easily on the fly

No problem with that, but there still should be a Preference to disable entirely.  Or even a multipurpose pref.  0 to disable, 1 to enable as is, 2 to enable in conjunction with some action key ...
Comment 9 tonda kavalec 2011-08-19 00:07:18 PDT
I have to say, I never ever had problems with the current behavior. Would be good to ask more people what they think about it. May be a preference with 3 options one of which would be disabled?

value = 0; disabled
value = 1; current behavior
value = 2; right button needed
Comment 10 Philip Chee 2011-08-24 10:46:45 PDT
Created attachment 555450 [details] [diff] [review]
Patch v1.0 Minimalist Patch using SHIFT key.

In Firefox the vertical scroll wheel scrolls the tab bar but doesn't change the focused tab. In the following minimalist patch I'll revert our behaviour to that of Firefox since that's the behaviour that most people are familiar with. To switch the selected tab using the vertical scroll wheel, I've chosen the SHIFT key as the simplest option.

Holding down the right button: I'm using a trackpad with an emulated scrollwheel. Trying to hold down the right button at the same time as trying to scroll aggravates my RSI.

No preferences at the moment because I don't think that's necessary.
Comment 11 Jens Hatlak (:InvisibleSmiley) 2011-08-24 11:35:11 PDT
Comment on attachment 555450 [details] [diff] [review]
Patch v1.0 Minimalist Patch using SHIFT key.

I think the Shift approach is good for defaults (i.e. revert the default to just scrolling the tab bar, but have it overridable on a case-by-case basis), but personally I'd still like to be able to set a pref (hidden, if you want) and get the current behavior. The reason is that Shift is on the keyboard, and I like selecting/switching tabs solely using the mouse. I cannot provide numbers, but I'm sure I'm not alone there.

IOW, f=me if you add a hidden pref (duplicate the handler etc.). Since that's not exactly what this patch does, but partly, I'll reset your request instead of setting f-.
Comment 12 Philip Chee 2011-08-26 08:23:08 PDT
Created attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

Now controlled by a hidden preference:

// Mouse wheel action when over the tab bar:
// false  The mouse wheel scrolls the whole tab bar like Firefox (default).
// true   The mouse wheel advances the selected tab.
pref("browser.tabs.mouseScrollAdvance", false)

Holding the shift key reverses the preference.

This preference is read once when the tabbrowser opens. To see changes to the preference, open a new window, or restart.

The DOMMouseScroll handler is now more extension friendly. It calls a method _handleMouseScroll() which can be overridden by extensions. For example some people would like for the scroll wheel to do nothing at all over the tab bar. An extension can extend _handleMouseScroll() to add this behaviour.
Comment 13 Jens Hatlak (:InvisibleSmiley) 2011-08-26 10:20:32 PDT
Comment on attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

Functionally exactly what I'd like to see, so f=me. Thanks!

I'm not your reviewer, but if I was I'd probably ask for renaming the pref to include "Tab" at the end and rename the member variable accordingly. If it wasn't for compatibility, even the method should be renamed (after all, we're not advancing the selected tab but the selection!).
Comment 14 Stefan [:stefanh] 2011-08-26 12:00:23 PDT
Comment on attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

Cancelling this since I don't have a mouse to test with.
Comment 15 Philip Chee 2011-08-27 09:18:52 PDT
Comment on attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

I guess it's time to ask for a review.
Comment 16 neil@parkwaycc.co.uk 2011-09-04 15:55:44 PDT
Comment on attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

>+// Mouse wheel action when over the tab bar:
>+// false  The mouse wheel scrolls the whole tab bar like Firefox (default).
>+// true   The mouse wheel advances the selected tab.
>+pref("browser.tabs.mouseScrollAdvance", false);
We should have an override in our Linux pref block (about 100 lines from the end of browser-prefs.js) to make the default true on Linux, to match the tabbox behaviour.

>+          this.mScrollSelectedTab = this.mPrefs.getBoolPref("browser.tabs.mouseScrollAdvance");
We don't actually bother caching prefs anywhere else in tabbrowser.
Comment 17 rsx11m 2011-09-13 12:18:02 PDT
Comment on attachment 556033 [details] [diff] [review]
Patch v1.1 Use a pref to control behaviour.

Patch applied to Linux trunk, and it's working fine there with the default being to require Shift being held down to scroll tabs. I think that's better than the alternate proposal with the right-click, given any coordination efforts with the context menu, thus f=me as well.

(In reply to neil@parkwaycc.co.uk from comment #16)
> >+pref("browser.tabs.mouseScrollAdvance", false);
> We should have an override in our Linux pref block (about 100 lines from the
> end of browser-prefs.js) to make the default true on Linux, to match the
> tabbox behaviour.

Using both Windows and Linux in parallel, my personal thinking is to keep the default consistent among platforms, but there apparently is already another instance of a similar setting having different defaults for Linux introducing such inconsistency.

> >+          this.mScrollSelectedTab = this.mPrefs.getBoolPref("browser.tabs.mouseScrollAdvance");
> We don't actually bother caching prefs anywhere else in tabbrowser.

Doing this once in the constructor only has also the potentially confusing effect that the change isn't visible immediately in the current window and only applies for new windows. I didn't try it, but not caching the pref value in this way should have the advantage of any changes being effective immediately also in the current window.
Comment 18 Philip Chee 2011-09-14 20:34:37 PDT
Created attachment 560297 [details] [diff] [review]
Patch v1.0 Don't cache the pref. f=jh f=rsx11m.

> neil@parkwaycc.co.uk      2011-09-04 15:55:44 PDT
> 
> Comment on attachment 556033 [details] [diff] [review] [diff] [details] [review]
> Patch v1.1 Use a pref to control behaviour.
> 
>>+// Mouse wheel action when over the tab bar:
>>+// false  The mouse wheel scrolls the whole tab bar like Firefox (default).
>>+// true   The mouse wheel advances the selected tab.
>>+pref("browser.tabs.mouseScrollAdvance", false);
> We should have an override in our Linux pref block (about 100 lines from the end of browser-prefs.js) to make the default true on Linux, to match the tabbox behaviour.
Fixed.

>>+          this.mScrollSelectedTab = this.mPrefs.getBoolPref("browser.tabs.mouseScrollAdvance");
> We don't actually bother caching prefs anywhere else in tabbrowser.
Fixed.
Comment 19 Philip Chee 2011-09-16 01:29:42 PDT
Pushed to comm-central
http://hg.mozilla.org/comm-central/rev/5298d97973c4

Note You need to log in before you can comment on or make changes to this bug.