SM2.1 How to disable tab scroll with mouse wheel?

User Help for Seamonkey and Mozilla Suite
Mc.
Guest

SM2.1 How to disable tab scroll with mouse wheel?

Post by Mc. »

I can't find any setting to disable the newly introduced tab scrolling with mouse wheel, to avoid unintended scrolling (jumping) to another tab, when I touch the mouse wheel.
User avatar
therube
Posts: 21703
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by therube »

I find it annoying too.

Maybe something here, [url=http://kb.mozillazine.org/About:config_entries#Mousewheel.]Mousewheel.[/url] ?

(The board is breaking the link. The closing dot (.) in the URL is important for the jump to the "anchor" to work.)
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
vladmir
Posts: 319
Joined: October 18th, 2004, 9:47 am

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by vladmir »

Nobody knows.

Turn off mouse scroll wheel, tab scrolling in the tab bar
viewtopic.php?f=38&t=1736255
Mc.
Guest

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by Mc. »

vladmir wrote:Nobody knows.

Philip Chee might know, though ;-)
SeeBug 643294.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Err, great ... so, how do you override a single handler (event="DOMMouseScroll" phase="capturing") in a binding (id="tabbrowser-tabs"), e.g., using the userChrome.xml extension? The install.rdf of that extension doesn't include SeaMonkey, but should be straightforward to copy-paste.

One could probably create a complete copy of the binding as a userChrome.xml definition with that handler omitted, or maybe it's possible to just extend the existing binding overriding the handler with an empty one, but this looks like a little bit of try and error to make it work... :crazyeyes:

Edit: https://addons.mozilla.org/seamonkey/addon/tab-mix-plus/ redirects to Firefox, thus it's not declared compatible with SeaMonkey.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

As a quick guess (completely untested!), the following might work as a userChrome.xml definition:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <binding id="tabbrowser-tabs-noscroll"
           extends="chrome://navigator/content/tabbrowser.xml#tabbrowser-tabs">
    <handlers>
      <handler event="DOMMouseScroll" phase="capturing"/>
    </handlers>
  </binding>
</bindings>


assuming that handlers can be overridden in this way, combined with the following in userChrome.css:

Code: Select all

.tabbrowser-tabs {
  -moz-binding: url("chrome://userchrome/content/userChrome.xml#tabbrowser-tabs-noscroll") !important;
}


For the User Chrome extension, add an entry to install.rdf for SeaMonkey with this UUID (taken from DOMi):

Code: Select all

<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Well, that didn't work. :-( It's failing already when trying to simply open a new tab:

Code: Select all

Error: this.tabContainer._handleNewTab is not a function
Source File: chrome://navigator/content/tabbrowser.xml
Line: 1529


That's in the "tabbrowser" binding, apparently the extending part didn't work and the method definitions for "tabbrowser-tabs" are gone entirely despite supposedly being inherited from the underlying base binding... :-k

Anyway, maybe a good starting point for anyone who wants to pick this up. The other option (for experienced users) is obviously to just hack omni.jar and to remove the "DOMMouseScroll" handler from "tabbrowser-tabs" manually.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

It appears that the User Chrome extension itself may not be working correctly, possibly related to the switch to omni.jar as common JAR file. It seems to be searching for userChrome.xml as part of the extension itself. Typing in the chrome: URL from the userChrome.css file manually gives me the following error:
The file jar:file:///C:/Users/xxx/AppData/Roaming/Mozilla/SeaMonkey/Profiles/xxxxxxxx.default/extensions/chrome@user.xpi!/chrome/userChrome.xml cannot be found.

Thus, it may be ignoring the "../.." part in chrome.manifest for some reason. Making it "../../../.." didn't help either.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Ok, so as a last attempt I've added chrome/userChrome.xml directly into the extension and it is now found when directly entering the chrome: URL, so that part worked, and it should be found with the userChrome.css code now. It's still happily scrolling tabs though, thus the handler-overriding part still didn't work out for some reason. I'm giving up at this point...
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

One subproblem solved thanks to Bozz: To allow chrome.xpi install "the old way", go into about:config and toggle extensions.alwaysUnpack so that it becomes "true", then the userChrome.xml file can go into the "chrome" folder again and is properly found there.

It appears to me that the <handler> definitions are executed for both the code of the base binding as well as of the extending binding. For example, adding "<![CDATA[throw(9999);]]>" as the executable content to that handler will still execute the tab scrolling and throw an "uncaught exception 9999" from the additional code in the extended binding. Thus, it may not be possible to override handlers with such custom bindings in general.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Hah, I've got an "evil hack" utilizing that parallel behavior by simply compensating for the action in the main binding with a counteraction in the extended binding (copied from Phil's patch and reversed):

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <binding id="tabbrowser-tabs-noscroll"
           extends="chrome://navigator/content/tabbrowser.xml#tabbrowser-tabs">
    <handlers>
      <handler event="DOMMouseScroll" phase="capturing">
        <![CDATA[
          this.advanceSelectedTab(event.detail < 0 ? 1 : -1);
          event.stopPropagation();
        ]]>
      </handler>
    </handlers>
  </binding>
</bindings>


In result, the tab scrolls one to the left and then immediately to the right, or first to the right followed by an immediate to the left. This works for all intermediate tabs, for the left-most tab you can have one scroll to the right though; and, for the right-most tab, one scroll to the left. That probably could be accounted for by really checking on which tab we are and which action is to be performed, thus not counteracting a "no-op" action of the main binding because it's the first or last tab.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Here yet another not quite working solution. This one doesn't try to avoid handling the events but basically just removes the action defined for "this.advanceSelectedTab()" so that the events are practically ignored. Unfortunately, it seems to affect more than desired and has some unexpected effects (uneven tab sizes, no [x] closing box, etc.), so that's not usable in this form yet either, but here the code:

userChrome.css:

Code: Select all

tabs {
  -moz-binding: url("chrome://userchrome/content/userChrome.xml#tabs-noscroll") !important;
}


userChrome.xml:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <binding id="tabs-noscroll"
           extends="chrome://global/content/bindings/tabbox.xml#tabs">
    <implementation>
      <method name="advanceSelectedTab">
        <parameter name="aDir"/>
        <parameter name="aWrap"/>
        <body/>
      </method>
    </implementation>
  </binding>
</bindings>
Last edited by rsx11m on June 24th, 2011, 6:06 pm, edited 1 time in total.
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Ok, this is better. 8-) The suite's "tabbrowser-tabs" extends in tabbox's "tabs" itself, thus extending the former rather than the latter (even though the latter inherits the "advanceSelectedTab" definition from the former) restricts the change to the actual tabbrowser tabs and won't disable the suite-specific "tabs" extensions. In addition to the mouse wheel, this solution also prevents navigating the tabs with the cursor-left/right keys, though.

Suggested solution:

userChrome.css: (updated per Mc.'s feedback on tabmail issues)

Code: Select all

#browser .tabbrowser-tabs {
  -moz-binding: url("chrome://userchrome/content/userChrome.xml#tabbrowser-tabs-noscroll") !important;
}


userChrome.xml:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE bindings>
<bindings xmlns="http://www.mozilla.org/xbl"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  <binding id="tabbrowser-tabs-noscroll"
           extends="chrome://navigator/content/tabbrowser.xml#tabbrowser-tabs">
    <implementation>
      <method name="advanceSelectedTab">
        <parameter name="aDir"/>
        <parameter name="aWrap"/>
        <body/>
      </method>
    </implementation>
  </binding>
</bindings>
Last edited by rsx11m on June 25th, 2011, 9:33 am, edited 2 times in total.
Mc.
Guest

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by Mc. »

With this code tab bar is not visible at all for me, even with just your code in userChrome.css (and userChrome.xml in the profile).
rsx11m
Moderator
Posts: 14404
Joined: May 3rd, 2007, 7:40 am
Location: US

Re: SM2.1 How to disable tab scroll with mouse wheel?

Post by rsx11m »

Did you hack and install the chrome.xpi extension as described? Without it, the userChrome.xml isn't effective, and the userChrome.css redirect points to a non-existent binding (hence no tabs at all).
Post Reply