github email rss
Fix the new firefox quantum bar in gentoo
Nov 1, 2020
3 minutes read

Mozilla have changed how the address bar selection works in the last few versions of Firefox (>=75) for Linux.

Up to Firefox 74, a single click inside the address bar would just place the cursor where the user clicked. Double click would select a word, and three clicks the whole address bar text.

And then, on 75, a single click selects the whole text, a double click the word, and three clicks the whole text (again). If you want to just place the cursor somewhere to edit the address, the best workaround is to wait a bit after the single click, and single click again.

According to Mozilla, this change is to make Firefox consistent across all architectures, and of course Chrome does it, so Firefox should too… Having it as an option is said to complicate the code base. So according to Mozilla, because mac and windows folks have used web browsers like that since forever, Linux folks should do too… So then why don’t we start a port of windows/mac ui to linux and call it a day ?

At first I didn’t mind, in fact I thought it was kinda okay. But the bummer is that on single click (which selects the whole text), the text doesn’t get copied in the clipboard. You have to three click to do so. This annoyed me enough while I was being an outlaw the other day trying to download some youtube videos with the it-disrupts-the-way-WE-want-the-web-to-work youtube-dl tool.

Anyway. There is a patch to revert this thing.

Gentoo (which of course is the coolest distribution of linux ever), has a way to apply user patches to ebuilds from the tree. To do this:

  • Create an /etc/portage/patches/ directory if it doesn’t exist.
  • Inside that, create a www-client/firefox-78.4.0 directory (current portage version is 78.4.0 and the patch will only be applied to that. For new versions you must create a new one. You can have a just www-client/firefox without version directory, but it’s not certain that the patch will work for all versions).
  • Place a file there called whatever you like (but ending in .patch or .diff) with the following contents:
#$ ~/.local/bin/mozregression  --bad=75 --good=74
#...
#13:01.16 INFO: Narrowed integration regression window from [4c6c850d, 9d574c79] (4 builds) to [19e18bbe, 9d574c79] (2 builds) (~1 steps left)
#13:01.16 INFO: No more integration revisions, bisection finished.
#13:01.16 INFO: Last good revision: 19e18bbee3c321ed9f978c621986e11c9494cdf4
#13:01.16 INFO: First bad revision: 9d574c79405dced5b1157513843ae3b68d0188b4
#13:01.16 INFO: Pushlog:
#https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=19e18bbee3c321ed9f978c621986e11c9494cdf4&tochange=9d574c79405dced5b1157513843ae3b68d0188b4

diff -r 078326f48100 browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarInput.jsm Tue Apr 14 06:41:42 2020 +0000
+++ b/browser/components/urlbar/UrlbarInput.jsm Tue Apr 14 16:01:40 2020 +0200
@@ -1957,6 +1957,8 @@
         if (event.target.id == SEARCH_BUTTON_ID) {
           this._preventClickSelectsAll = true;
           this.search(UrlbarTokenizer.RESTRICT.SEARCH);
+        } else if (event.target == this.inputField) {
+          this._preventClickSelectsAll = true;
         } else {
           this.view.autoOpen({ event });
         }

And emerge Firefox as usuall! Check for User patches applied. at the start of the emerge, to see if it’s ok.


Back to posts