Written by smenjas the 29 Feb 08 at 01:34.
Category: Usability.
Related project:
Nothing/Others.
Status: Implemented
Rationale
I'm constantly frustrated by applications stealing my focus. There should be some way for me to ensure that when I begin typing somewhere, an overzealous application will never pop up in front of what I'm working on.
I realise this isn't quite what you were looking for, but there is already a "no focus" option in Compiz Fusion. You can access it through CompizConfig Settings Manager > Window Management > Window Rules.
Estesark: I use Compiz on my home computer, and although I have that feature turned on I still find that applications steal my focus. Maybe I'm not doing it right.
Unfortunately that's not always an option. At work I cannot enable Compiz, I'm guessing because of video card issues.
This should be standard on all window managers. Otherwise they're not really managing my windows, they're letting my windows manage me!
this is a major annoyance, especially for those of us who prefer sloppy focus. things are certainly far better on linux systems in general than on other deskops, but i still deal with unwanted focus ambushes on a daily basis.
in my opinion, no window should have keyboard focus unless 1) i manually move the mouse pointer into it or 2) it is the only window visible.
I was going to post this idea ... it is especially applicable with slow starting applications; and I have found myself typing a password into another application without realising it simply because focus is transferred but the window is not yet showing itself...
This is also a security issue. Think of typing a password while looking down to the keyboard. Whoops you wrote it into some idiotic javascript popup window and sent to millions of people.
Software stealing focus should be handled as critical security vulnerabilities. Always.
i run two X displays. i generally don't have a problem with focus stealing on any one of the two, but an application on :0 finishing loading frequently steals focus from my terminal on :0.1, which is extremely irritating.
@rawsausage:
Cannot agree more!! Focus-stealing software is a critical security threat - whenever it's seen, fixing it should take the highEST priority over any non-critical-security bugfixes.
If I could vote only ONE idea up multiple times, this will get 9999 votes.
Focus stealing is a big part of what makes Windows such a torture. It also is a security risk as per rawsausage above. Such a bug does not belong in Ubuntu.
This is also an issue with Windows system tray popups. Torture case:
1) You are reading a big PDF on-screen
2) you have your cursor in the bottom right corner
so you can click and scroll down whilst reading
3) you click
4) a GMail notification has popped under (and STOLEN
FOCUS)
5) Firefox pops up with the GMail I just accidentally
clicked on
6) concentration is broken, world peace is never achieved.
My Experience: I was chatting with my friend in GMail inbuilt chat feature as I had not logged in the gmail account thought Pidgin.
I was running pidgin and logged in to Yahoo. While typing in gmail chat , suddenly a pidgin chat window opens up and i typed in it and hit enter. I type quite fast and before I could get that I had typed in pidgin and hit enter, its all done. Now I had to tell him what had happened.
I think windows shouldn't steal focus, but still be able to noitfy you in some obvious yet non-obtrusive way. Like with Pidgin, I'd like to have the window pop up on a new message, but not gaining full focus, so I can see it, but still the window I'm writing in is still active. This might be tricky due to window sizes, but there is probably a good way to implement this.
When I'm installing updates while chatting in pidgin, that window needs to leave me alone _by default_. Flash in the window list, I'll get to it when I get to it.
As ethana2 said, the Update Manager is particularly guilty of this, and seems to steal focus three or four times during a single round of updating (!).
you are typing your login and password and something like Pidgin grabs focus.. A co-worker with a sence of humor could just look over your shoulder and wait for that moment to msg you and steal your password. ;-) yes funny, but not funny with serious data.
Or ... Creditcard numbers..
Or when your boss msg you just when you tell a friend that you hate the man.
can't believe I can only +1. Would love to +(amount needed to make sure that the full weight of canonical fixed it next as top priority). No other bug bugs me more.
I effectively can no longer multi-task whilst Update Manager is running. Very annoying! :(
Although due to number of updates the above effects me the most, the security aspect already mentioned should be enough reason to address this, as default behaviour too.
It should be classed as a security vulnerability IMHO.
Be careful with this one. At work this drives us crazy (stuck with RH4EL). We had to set focus stealing prevention to "none" since some applications used to open their menus and modal pop-ups below focused window !
My idea #18912 has been set to be a duplicate of this idea, can I change this?
I would like to remove the duplicate status of my idea #18912 as I don't think my idea is a duplicate of this one.
I think already running applications stealing focus and a newly launched application stealing focus are two distinct scenarios that should be handled separately.
But I should point out that implementing solution #1 (to this idea) will not solve the problem I present in idea #18912. And, conversely, implementing the solution to idea #18912 (present here as solution #3) will not solve the problem presented here in idea #400.
I just think it's a bit confusing moving the solution to idea #18912 to idea #400 since it does not solve the problem presented in idea #400.
For that to work I think the rationale from idea #18912 should be merged with this idea as well (just as the solution to #18912 has been moved to here).
But I should point out that implementing solution #1 (to this idea) will not solve the problem I present in idea #18912. And, conversely, implementing the solution to idea #18912 (present here as solution #3) will not solve the problem presented here in idea #400.
That's why solutions #1 and #3 are separate from each other. You can vote +1 for both.
This is very annoying, enough to consider moving distro. As many have also said it is a security risk also. Many times I have sent my su password to a chat buddy!
This workaround prevents selected menu items and panel buttons from stealing focus under Gnome-Metacity.
1) Prevent applications launched from the terminal from stealing focus: launch gconf-editor, navigate to apps --> metacity --> general and set "focus new windows" to strict.
2) Pretend that menu items and panel buttons are launched from terminals, by modifying their "command" field. Some applications will not return the prompt immediately, therefore a further step is needed in the form of a script.
Where /bin/bglaunch.sh is the following script, which launches the application in background:
#!/bin/bash
nohup $1 >/dev/null &
Security is not guaranteed, plus it requires a little work for every program whose behaviour must be changed (it's easy to write a sed script which changes every link at once, though), but I find it very handy for those few slow apps that take ages to start.
PLEASE FOR THE LOVE OF ALL THAT IS HOLY IMPLEMENT THIS. I have no end of pain for the number of applications that are constantly popping up to get my attention. NOTHING is more important to me than the thing I'm *currently* doing. The computer is there to serve me, not the other way around.
amaranth(Ubuntu developer)
wrote on the 31 Oct 09 at 21:43
We do obviously have focus stealing prevention (for a couple years now) so at this point your best bet is to file specific bugs for applications that steal focus. We would need detailed information on what application stole focus, what you were doing when it happened, etc.
It is possible we have bugs in the focus stealing prevention already implemented but it's also rather easy for applications to completely bypass this so it could be the application deciding it needs focus no matter what.
"It is possible we have bugs in the focus stealing prevention already implemented but it's also rather easy for applications to completely bypass this so it could be the application deciding it needs focus no matter what. "
Maybe I don't understand, but I assume there's some function that applications can call when they think they need the focus to be on them. Why can't metacity just flash their taskbar icon instead of actually giving them focus? I thought the whole point of a window manager was that it could manage windows.
the number one reason I started using Linux was because I assumed this would be doable since I don't recall this happening in the past on Unix. Next I shall try KDE. After that I will try Solaris.
The application that gets me the most is Matlab since I may be running something for several seconds to minutes in the background. Then it leaps up while I'm in the middle of typing somewhere else. Then after I tab back it jumps up again to complain about the garbage I accidentally entered.
freeguide is a huge culprit. It is slow to start, e.g. over one minute. So after a few seconds, by which time I'm back typing in a gnome-terminal, it pops up its "banner" window, taking focus. I minimise that and continue in gnome-terminal. A minute later, its finished loading and steals focus again as it pops up its main window.
"We do obviously have focus stealing prevention (for a couple years now) so at this point your best bet is to file specific bugs for applications that steal focus. We would need detailed information on what application stole focus, what you were doing when it happened, etc.
It is possible we have bugs in the focus stealing prevention already implemented but it's also rather easy for applications to completely bypass this so it could be the application deciding it needs focus no matter what."
All aplications stilling focus :( If there is some stilling focus prvention it isn't work at all :(
This situation is wery annoying ... I hope You solve this soon ...
This needs to be addressed! I was typing in a password in another application when I was waiting for gwibber to open. Guess what happened? As I was typing my password in another application gwibber opens and steals the focus so now I am typing my password in gwibber. By the time I pressed enter, it was too late. My password was posted to facebook for all to see, resulting in time lost changing passwords and quickly deleting a facebook post.
Then thumbs up for #8. Its so darn annoying. especially when on a bad internet connection and your typing fast without paying attention to the screen. The fucking internet password pops up and before you know it you have typed. "have a nice day, i love" as a password for the wireless internet and hit the enter key. Then your fucked and have to go to the next room to get the password again. Or maybee you don't have the password anymore(that sucks)
Focus stealing should be *absolutely forbidden* if user has clicked or typed inside any window (but the parent window as seen by the X server, to allow a window to open dialogs etc) within 2 seconds (user adjustable limit).
A window asking for a focus should only get "attention needed" status and *possibly* be raised second to top position in window order to make it easier to switch to it.
On one hand we have the *mere inconvenience* of not knowing whether an installation has started or not (à la Windows 7 UAC dialogs).
On other hand we have the security issue of accidentally sending a password out through chat (mentioned several times in the comments) or data loss (see below).
And we ought to have a discussion about which is more critical than the other? Really?
I'm commenting here because I started shutting down Open Office, went back to the terminal and while I was working in the terminal got a dialog asking me whether I wanted to save a document or not. I can't tell whether I won the "focus lottery" because I accidentally dismissed the dialog while navigating in 'less' in the terminal.
It is a tough one. One option is to change the sudo authentication window to be the same as windows (a click, rather than typing a password). This is actually more secure if you lock it down because hackers can't emulate a fake sudo prompt and steal the password. Or the option at least...
For terminal though, continue doing it the way its done now possibly
I agree with all comments point toward security issues on this one. I also have experienced the "accidentally closing something important without saving due to focus stealing".
I +1 the idea that we can +(as many as needed to get it fixed, now) on this ticket.
The compiz solution doesn't work when you are using netbook remix for instance.
KIAaze(Idea reviewer)
wrote on the 4 May 11 at 07:53
I am currently upgrading from 10.10 to 11.04 and was typing something.
A window shortly popped up exactly when I pressed enter to create a new line and disappeared right away.
I suppose it was asking me about some configuration file and what I wanted to do about it, but now I can't know anymore. :/
I hope everything goes well...
Focus stealing should be forbidden! And if there is focus-stealing, there should at least be some timeout or something to prevent actually using the focus-stealer for a few seconds.
(like with the win UAC where the screen slowly goes dark to only leave one window. Although I have no idea if you can use it while it goes dark.)
cheesehead(Brainstorm admin)
wrote on the 19 Feb 12 at 02:50
Between the Compiz settings, notifyOSD, and Unity, the system seems to do a lot less stealing so I'm marking this Implemented. (We all knew it was a multiple-solution problem)
If you discover a system process or application that still steals focus, please file a bug report.