5
1
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 – 2016-06-18T00:29:29.480
1By 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 – 2016-06-18T01:06:07.120
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 – 2016-06-18T03:17:43.210Did you try changing the value of
dom.disable_window_flip
underabout:config
? If not, try toggling it's value. – Michael D – 2016-06-28T03:24:27.0731
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 – 2016-06-28T07:21:35.9901
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 – 2016-06-28T07:23:37.027Thanks for the suggestions! I did not expect an addon to be able to steal focus and I was convinced that I had been using Firefox with these addons for a while without seeing the issue. However, it turns out that it is the combination of the addon ThumbnailZoomPlus and Gnome3 that causes this problem. The reason focus is suddenly lost when closing tabs must be that the mouse ends up on an image in the new tab when the previous tab is closed. @harrymc Since you posted first, if you post an answer about the addons, I can fill it out with details and give you the bounty.
– joelostblom – 2016-06-28T15:09:03.217@MichaelD I tried toggling
dom.disable_window_flip
from 'true' to 'false', but it had no effect. – joelostblom – 2016-06-28T15:10:15.903Answer posted, as requested. – harrymc – 2016-06-28T20:41:14.503