Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

firefox -new-tab steals X11 focus as of 13.0

  • 1 reply
  • 9 have this problem
  • 1 view
  • Last reply by damion2

more options

When I use "firefox -new-tab anyurl.com" it steals input focus despite leaving the mouse pointer in the xterm I typed this in.

It did not do this in 12.0 or any version I've known before.

Interestingly google-chrome has done this for some time. So it could be that firefox has started using some similar X11 based libs (gnome/gtk/3d based?) perhaps to speed up acceleration.

The window manager I use is wmx but this also happens on evilwm, twm and probably many others that can be used with follow-to-focus.

I suspect that this change is actually intentional, catering for some Unity feature or something like that, however I couldn't see any flag to firefox for suppressing it and I find it extremely upsetting to now find Firefox doing what Chrome does with my mouse/keyboard focus.

When I use "firefox -new-tab anyurl.com" it steals input focus despite leaving the mouse pointer in the xterm I typed this in. It did not do this in 12.0 or any version I've known before. Interestingly google-chrome has done this for some time. So it could be that firefox has started using some similar X11 based libs (gnome/gtk/3d based?) perhaps to speed up acceleration. The window manager I use is wmx but this also happens on evilwm, twm and probably many others that can be used with follow-to-focus. I suspect that this change is actually intentional, catering for some Unity feature or something like that, however I couldn't see any flag to firefox for suppressing it and I find it extremely upsetting to now find Firefox doing what Chrome does with my mouse/keyboard focus.

All Replies (1)

more options

This script was adapted for my workaround for chrome's lameness, now needed on Firefox. This is very brittle, it sort of works a lot of the time but it's not a proper solution.

For some reason the hashes at the start of each line to comment or make up the pling path turn into numbers in this edit box. But you get the idea


  1. !/bin/sh
  2. This lame kludge is necessary because firefox now plays sillybuggers with
  3. my window manager. I've also tried several times but failed to get
  4. xdotool to work exactly how I want, so I have to run it 4 times!
  5. It's pretty self documenting, but I've added a few notes
  1. 1st store details of what state stuff is in.

eval $(xdotool getmouselocation --shell 2>/dev/null )

  1. This doesn't set the window to be the focused terminal, but I need X and Y

export X Y

export WINDOWID=$(xdotool getwindowfocus -f 2>/dev/null )

  1. echo $WINDOWID $X $Y
  1. Do the actual opening of new tab on $1. This used to work fine in firefox and only
  2. did this in chrome until ff13.0

(firefox $1 >/dev/null) & 2>/dev/null

  1. Focus and fill out the previously focused window, I had issues with xdotool
  2. not working as expected when bouncing the mouse around.

sleep .2

xdotool mousemove -sync --window $WINDOWID 0 0 2>/dev/null

  1. I added both --sync and sleep .2 but not sure which helped the most

xdotool mousemove 0 0 mousemove restore mousemove $X $Y 2>/dev/null

  1. The above mess is because I want the window border filled out. I could just
  2. focus the window and have the pointer restored to where it was.
  1. The following is for the rare times firefox* is slow and I don't gain focus
  2. They'll need to be backgrounded.

(sleep 1 ; xdotool mousemove -sync --window $WINDOWID 0 0 2>/dev/null ; xdotool mousemove 0 0 mousemove restore mousemove $X $Y 2>/dev/null) &

Modified by damion2