5

Occasionally, when I transition from one tab to another, the Firefox window loses focus. This is especially notable when I switch or close tabs via keyboard shortcuts. For example, I can be closing a bunch of tabs with Ctrl+w and suddenly it stops working. I have noticed that the Firefox window title is grayed out, indicating that the window has lost focus. Alt tabbing or clicking the window regains focus, but this is disruptive to the browsing experience.

To test if another application is stealing focus from Firefox, I kept this line running in a terminal

while true; do sleep 20; xdotool getwindowfocus getWindowname; done

which prints the name of the currently active window to stdout every 20 s. When Firefox loses focus, no window title is printed (just a newline), indicating that there is no other application that steals the focus from Firefox. Firefox is the only application that displays this behavior.

I am on Firefox 47.0 on Antergos (Arch derivative) Linux with Gnome 3.20.2 and kernel 4.6.2.1. Why does this happen and what can I do to make Firefox stop losing the window focus?

  • Extremely frustrating... Even worse, it can provide focus to the wrong window, and then when you are clicking in one window, another active window takes the mouse click, when it is invisible. This can also be used by malware to have you click on one screen, only to really click in a separate window or tab, – DaaBoss Jun 18 '16 at 0:29
  • 1
    By any chance do you have a touchpad? This is a common side effect of getting your hands too close to the touchpad if it is overly sensitive; you may be more prone to doing that when typing certain key combinations, so the coincidence points to the keyboard command. – fixer1234 Jun 18 '16 at 1:06
  • Thanks for the suggestion. I do not think that accidental touchpad clicking is the issue, since this only happens with Firefox and xdotool reports a blank window title, suggesting that no other application has been focused. – joelostblom Jun 18 '16 at 3:17
  • 1
    Do you have installed the Flash add-on ? You could try starting Firefox in safe mode to see if this is caused by an add-on. – harrymc Jun 28 '16 at 7:21
  • 1
    Please provide a list of your addons. I had a similar issue, and I discovered it was the Add-On "Tab Scope" causing issues for me. – Christoph Terasa Jun 28 '16 at 7:23
2
+50

Firefox losing focus is usually caused by one (or more) add-on(s).

This is easily tested by running Firefox in safe mode. If the problem then disappears, then one can turn off add-ons selectively, until the guilty add-on(s) is(are) found.

There have been reports about the Flash add-on, and as the poster has found out, a combination of the add-ons ThumbnailZoomPlus and Gnome3 can also cause this problem.

0

Focus may be lost if one of the tabs has a page that auto-refreshes or it tries to spawn adds/other new tabs or make any type of background action

Note that Opera seems to have found a solution to counter this type of behavior since quite a few versions ago, so pages trying to do various actions cannot cause focus stealing. I have 50++ tabs open at all times.

As for FF, try saving your tabs file, uninstall it, make a cleanup for all the temp files, reinstall the latest version and then put your tabs file back. Re-test to see if the behavior still persists.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.