Firefox should not steal focus when told by another application to open a link

Bug #272171 reported by mmertens on 2008-09-19
30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubufox (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: firefox-3.0

I have Kubuntu 8.04, firefox 3.0.1 and Evolution 2.22.3.1

As very many people, I subscribe to a lot of lists and newssletters. These have mostly a title for its news and a link to the whole article. When I click on the links, Evolution alwasy goes to firefox while opening a tab and I have to switch back with the icon on the task bar, as many times as I click on links. Correct should be that I can click on all links of interest and then I call firefox's window to see what I want.

Cordially,

Manfred Mertens

ProblemType: Bug
Architecture: i386
Date: Fri Sep 19 11:18:47 2008
DistroRelease: Ubuntu 8.04
NonfreeKernelModules: nvidia
Package: firefox-3.0 3.0.1+build1+nobinonly-0ubuntu0.8.04.3
PackageArchitecture: i386
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=es_BO.UTF-8
 SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-19-generic i686

mmertens (mmertens) wrote :
Chris Coulson (chrisccoulson) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

* Is this reproducible?
* If so, what specific steps should we take to recreate this bug? Please be specific - specify exactly how you have Evolution set up etc

This will help us to find and resolve the problem.

Changed in firefox-3.0:
status: New → Incomplete

El vie, 19-09-2008 a las 19:19 +0000, Chris Coulson escribió:
> Thank you for taking the time to report this bug and helping to make
> Ubuntu better. Please answer these questions:
>
> * Is this reproducible?
> * If so, what specific steps should we take to recreate this bug? Please be specific - specify exactly how you have Evolution set up etc
>
> This will help us to find and resolve the problem.
>
> ** Changed in: firefox-3.0 (Ubuntu)
> Status: New => Incomplete
>
If your are connected to the Internet, this occurs every time your have
an incoming message in Evolution and you click on an a link to a
webpage. Then you are pushed away from Evolution and taken to the
Firefox window where the link is charging. If you have f. i. many links
in a newspaper list, you have to get back to Evolution for every link
you click.

Regards,
Manfred

I'm confirming this because I have it happen too, but I think it's a wishlist bug. I think the reason it behaves like this is because there is the assumption that if you clicked it, you want to look at it, and because it would otherwise look to users as if the links weren't being acted upon.

Changed in firefox-3.0:
status: Incomplete → Confirmed

By the way, I can only confirm this when the application telling Firefox to open a link is on a different workspace than Firefox. If they're on the same workspace, focus doesn't change. It's not just Evolution. I can reproduce it with irssi.

Daniel T Chen (crimsun) on 2008-09-19
Changed in firefox-3.0:
importance: Undecided → Wishlist
Chris Coulson (chrisccoulson) wrote :

Mackenzie - I can't actually reproduce this bug at all on my machine. For me, Firefox never steals focus when I click on links in Evolution, regardless of which workspaces the two applications are on.

I'm not sure that this is a Firefox bug as opposed to a window manager bug. This behaviour is actually configurable in Compiz (focus stealing prevention) by changing the gconf key "/apps/compiz/general/screen0/options/focus_prevention_level" to a value of between 0 (Off) and 3 (Very High). A value of 0 means that windows will always steal focus. A value of 3 means that windows will never steal focus.

The default value is 1. With this setting, I can't get Firefox to steal focus when clicking on a link in Evolution. If I set it to 0, then Firefox always steals focus.

I don't think Metacity has an equivalent setting.

Mackenzie Morgan (maco.m) wrote :

I haven't looked in Compiz's focus stealing prevention settings. I know using Compiz and Firefox, Firefox doesn't let go of focus when the workspace changes, so the window on top of which the mouse sits doesn't get focus even when using focus follows mouse.

I don't use Metacity, but I know with the only change to Compiz's focus being focus-follows-mouse instead of click-to-focus and with Xmonad's default tiling algorithm, Firefox steals focus.

Yleeyas (yleeyas) wrote :

Same thing was happening to me with Thuderbird links opening FF3.0.1 tabs, and FF stealing focus.
A solution which worked for me is to go into FF about:config and set preference: 'browser.tabs.loadDivertedInBackground' to 'true'.

Does this help?

mmertens (mmertens) wrote :

Thanks for the comments and support. I'm not very technical with Linux, but I changed to KMail and then all worked fine. Ergo, Evolution was stealing the focus.

Regards,
Manfred

ubuntu_demon (ubuntu-demon) wrote :

I can confirm this bug.

Here's the workaround :
https://bugs.launchpad.net/ubuntu/+source/firefox-3.0/+bug/219812/comments/2

browser.tabs.loadDivertedInBackground should be set to true

It should be trivial to change this value in ubufox.

ubuntu_demon (ubuntu-demon) wrote :

I created a debdiff to fix this issue in intrepid's version of ubufox. This is my first debdiff. I used this guide :
https://wiki.ubuntu.com/PackagingGuide/Recipes/Debdiff

ubufox (0.6~pre+bzr141-0ubuntu2) intrepid; urgency=low

  * fix LP: #272171 - Firefox should not steal focus when told by another
    application to open a link

 -- Roald Hopman <email address hidden> Fri, 17 Oct 2008 11:22:41 +0200

schiebe (schiebe) wrote :

Great, the "false/true"-Workaround works fine for me (Evolution, Liferea, etc)

Regards

Ilmari Vacklin (wolverian) wrote :

This seems more important than "wishlist", though I think the proper solution would be to add a configuration option to Firefox's settings for this.

To reproduce, I have to simply click a link from gnome-terminal. Firefox will always steal focus.

The fix suggested works, but also changes the behaviour in that the opened tab is no longer switched to inside Firefox.

Jamie Dimmel (jedimmel) wrote :

I have just upgraded to 10.04 w/Firefox 3.6.3 and first encountered this issue of Firefox "stealing" focus. This is EXACTLY what it was doing in 9.04 and is supposed to be the way anyone would expect it to act: you perform an action (click a link) and expect a result (link is shown). Simple cause and effect. This is now broken in 10.04. I can click a link and then have to manually change to Firefox to follow the link. Above the 'fix' (which is actually not a fix but a breaking) is to edit the 'browser.tabs.loadDivertedInBackground' entry in about:config but that does nothing for 10.04/3.6.3 as links opened in Firefox stay in the background no matter how that entry is set. Please follow logic and reset links to open new windows and bring them into focus.

Jamie Dimmel

I just wanted to say I found the comments in this (old) bug so very helpful. I am one on the "opposite" camp, though ... I do want Firefox to open and display the links I click on in other apps. And, I know it did used to work that way ... not sure when it changed. Fortunately, I use compiz and (after reading the comments in this bug) found "Focus Prevention Level" was set to "low". I changed it to "off" and once again, pages displayed when I click on their link! So, while not a "fix" for original complaint, I really appreciate the comments.

AlainKnaff (kubuntu-misc) wrote :

This just happened to me this morning, after clicking on a couple of links in a message in Thunderbird.

After setting Focus Stealing Prevention on Firefox' window from "Normal" to "High", this behavior stopped.

But unfortunately, with "High" now I occasionally get password prompts or similar dialog box which pop up behind firefox, and can easily be missed.

AlainKnaff (kubuntu-misc) wrote :

Fount it. There is a setting browser.tabs.loadDivertedInBackground in about:config , just set this to true, and firefox won't steal your focus any more when loading links in background.

(Thanks to this site http://www.techsupportalert.com/content/how-stop-firefox-stealing-window-focus.htm for pointing this out)

However, it won't highlight the window in the window list either, making it hard to locate the window if you have many desktops.

But maybe, this is enough to point some developer into the right direction how to fix it properly (or how to explain to us what is going on behind the scenes, so that it can be fixed properly in the window manager, if it is the window manager who screws this up)

In Firefox 17 the setting browser.tabs.loadDivertedInBackground works no more.

Really annoying!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers