firefox does not take keyboard focus

Bug #584513 reported by Keith Grizzell
280
This bug affects 5 people
Affects Status Importance Assigned to Milestone
firefox (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: firefox

This seems to affect only firefox, and it happens every time. To reproduce,

1) Open gedit. Without clicking anywhere, type something to make sure it took the keyboard focus (as it should).
2) Open firefox. Without clicking anywhere, type something. Notice that what you type doesn't go to firefox, but rather still goes to gedit.

Additionally, I have noticed that if a firefox window has the keyboard focus and you open a new firefox window, the new window will take the focus automatically. It is only when another program has the focus that firefox fails to steal the focus. (I also tested with kile and gnome-terminal in place of gedit, both yielding the same effect.)

Note: I marked this as a security vulnerability due to the possibility that one might type information intended to go into one program (firefox) with it inadvertently going to another program (e.g. gnome-terminal), in which case one might end up running unintended commands. (Also, I do not recall this behavior in previous versions of Ubuntu, so it seems reasonable for people to expect it to work as I expect it to work, thus making this a valid security issue.)

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: firefox 3.6.3+nobinonly-0ubuntu4
ProcVersionSignature: Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-generic x86_64
Architecture: amd64
Date: Sun May 23 06:15:14 2010
EcryptfsInUse: Yes
FirefoxPackages:
 firefox 3.6.3+nobinonly-0ubuntu4
 firefox-gnome-support 3.6.3+nobinonly-0ubuntu4
 firefox-branding 3.6.3+nobinonly-0ubuntu4
 abroswer N/A
 abrowser-branding N/A
InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release amd64 (20100427.1)
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: firefox

Revision history for this message
Keith Grizzell (grizzell) wrote :
visibility: private → public
Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

Same problem here. Another easy way to reproduce, is to add a Firefox launcher to the panel, then click on an empty space on the desktop and start Firefox with the launcher.
Same happens when I click on a link in any program (Liferea, Gnome-terminal, ...), Firefox will open, but beneath all other windows and won't have focus neither.

Sometimes (very little) it does work. Mostly when starting from the menu (Applications=>Internet=>Firefox), but it is very unpredictable.

Revision history for this message
Keith Grizzell (grizzell) wrote :

Yes, when I turn off desktop effects, I see the firefox window is coming up beneath the window that had the focus beforehand. I do not get this behavior on another computer of mine, also running Lucid. So, let's see if we can figure out what the computers doing this have in common...

I'm not an expert, but it seems like there's probably just some setting being messed up somewhere, somehow, possibly by a script from some package being installed. Operating on that theory, we can rule out the base system packages as being the immediate cause of the problem...

Could everyone experiencing this problem please run

dpkg -l &> package_list.txt

and then attach the file package_list.txt (which will then contain a list of packages installed on your computer)? Then we'll see what those computers have in common but my computer not experiencing this problem doesn't

Revision history for this message
Keith Grizzell (grizzell) wrote :

Also, I've started noticing a giant blinking cursor on some web pages (seemingly random at this point). Anyone else getting a symptom like that?

Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

Forgot to say that I don't use the desktop effects.

My package list is attached. I only have one Lucid computer, so it would be nice if you could compare the packages.

Haven't seen the big blinking cursor yet. Do you have a website example where it happens?

Revision history for this message
Keith Grizzell (grizzell) wrote :

FYI, After seeing bug report 107247, I now know how to fix the giant blinking cursor. (In firefox, somehow "Edit" > "Preferences" > "Advanced" > "General" > "Accessibility" > "Always use the cursor keys to navigate within pages" had become checked. I unchecked it, and the blinking cursor that appeared pretty much everywhere (and occasionally in giant form) went away. Apparently that's a feature called "caret browsing".)

Thanks, Timo - I'll start comparing the lists and see if I can glean anything from the similarities and differences.

Revision history for this message
Keith Grizzell (grizzell) wrote :

I compared the lists to come up with a list of packages that are installed on both computers experiencing the problem (Timo's and mine), but that are not yet installed on my computer that is not experiencing the problem. I'll try installing certain packages, going with ones I know interact with firefox first (like all the java packages), to see if any package breaks the working computer. For anyone interested, the list of possible suspect packages is attached.

Revision history for this message
Keith Grizzell (grizzell) wrote :

Timo- on a whim I tried removing an extension from firefox (Adblock Plus), after which the problem seemed to vanish. I have since re-installed the extension and tried my best to recreate the problem, but to no avail! (I didn't take notice of the Adblock Plus version number before I removed it, but I initially installed it less than 27 days ago, when the current version, 1.2, was released.)

Please let me know if a) you have that firefox plugin installed, and if so, b) if removing it fixed the problem, and if so again, c) if it remains fixed after reinstalling the plugin.

Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

Should have thought about that earlier :-).

Yes, it works now, but I didn't have to re-install Adblock Plus. Just disable and enable it again in the Extra=>Addons dialog was enough.

Thanks for your help.

Changed in firefox (Ubuntu):
assignee: nobody → Keith Grizzell (grizzell)
status: New → Invalid
Revision history for this message
Keith Grizzell (grizzell) wrote :

Final conclusion: it seems to be a problem with the Adblock Plus addon and hence not a firefox bug. Try disabling, then re-enabling it, or failing that, uninstalling, then re-installing it.

Changed in firefox (Ubuntu):
assignee: Keith Grizzell (grizzell) → nobody
status: Invalid → Fix Released
Revision history for this message
Timo Vanwynsberghe (timovwb) wrote :

Ignore my last comment, the problem came back.

This time I uninstalled the addon and then re-installed it, but that didn't help either. I had to uninstall it, then remove the preference file and install it back again. Now it seems to work fine (for now).

But yes, this is definitely something with Adblock Plus, not with Firefox in particular.

Changed in firefox (Ubuntu):
status: Fix Released → Invalid
Revision history for this message
Keith Grizzell (grizzell) wrote :

After some extensive searching, I've concluded that this is probably not a new issue, and in fact may be five years old. That being said, I don't ever recall having this problem in the previous versions of Ubuntu that I was using on any of my computers (incl. 9.04 and 8.10). It is a problem in that it happens on a fresh install, and in that the behavior is not what happens in Windows (not that that is a good litmus test) nor what should logically happen. To reproduce, all one has to do is the following:

1) Start a first instance of firefox. Notice you can type in it.
2) Switch to another program.
3) Start a second instance of firefox. Without clicking in it, notice you cannot type in it. (In fact, with desktop effects off, the second window appears behind the other program.)

Now since I am explicitly starting the second instance, I expect the focus to go there immediately. This contrasts with the usage scenario where one might not want it to steal focus when in another application and clicking on a link.

I am still researching the issue, which may, in fact, be a metacity issue (I get the same exact behavior with Google chrome and with SeaMonkey, though I do believe they all share a good deal of code). I plan to leave this particular bug marked as invalid since I screwed up in assigning the statuses to it before. I plan to run a few tests, and I will either find the correct bug this really duplicates, or I will write a new bug report (especially if this turns out to be a regression), and I will post a link in the comments here at that time.

FYI, I am planning to install Jaunty in a VirtualBox and see if that behavior was there (and I was just blind?!) or not.

Revision history for this message
Ben Calot (lobacten) wrote :

You could not have been blind, this is by far the most infuriating bug I have ever experienced. Since recently upgrading to 10.04 I have had this bug and I would sacrifice many small children to get rid of it.

I usually experience this bug when opening a new Firefox instance while in Komodo Edit (thus causing me to type into my code buffer by accident). I can verify that it is not Firefox specific, as it also happens in Google Chrome.

Please let us know what you find, I gotta fix this one way or another.

Revision history for this message
Lars Egeberg Hansen (oakmount) wrote :

I experience exactly the same but I don't have Adblock Plus installed.

Yesterday a had a strange experience. If I deactivated all my 5 addons I could make it work once. After that it was back to "normal". This morning a deactivation doesn't change a thing :-(

My Addons are:
 Foxy Proxy Standard 2.19.2
 IBM CCK 2.0.3 (Internal IBM Addon)
 IBM Really Simple Sign On 2.0.7 (Internal IBM Addon)
 Slashy 1.8.0
 Ubuntu Firefox Modifications 0.9rc2

And now, when times allows, I will try to uninstall them all and install them again one by one.

Revision history for this message
Keith Grizzell (grizzell) wrote :

I believe I have provided a much better description including when it happens vs. when it doesn't in the new bug report #589116. Please check out that report, and if you can replicate the problem following the steps listed, feel free to change the status to Confirmed. (I am marking this report as a duplicate of the new one.)

Revision history for this message
Florian Hirschberg (fhirschberg) wrote :

I have exactly the same problem as the original bug reporter.

Ubuntu 12.04.2 LTS
x86_64

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.