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?

9
  • 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, 2016 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, 2016 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. Jun 18, 2016 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, 2016 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. Jun 28, 2016 at 7:23

3 Answers 3

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.

0

I had this problem, and even tried removing Flash completely... Didn't work. After much hair pulling and near total exasperation, because it became almost impossible to use FireFox, I finally nailed the problem down to the WiFi card. (TP-Link Wireless.) TP-Link likes you to use their configuration utility, but from what I have found it is definitely buggy. I let the OS take control of the card (ie ditched the TP-Link utility) with the result that I have no more mouse problems. It wouldn't hurt to try this if you continue to have this problem after trying everything else.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .