Has this ever happened to you? You're merrily typing away in some application, minding your own business, when-- suddenly-- a dialog pops up and steals the focus from you.
At best, your flow is interrupted. You'll have to switch back to the window that you were using, figure out where you were, and resume your work.
But it can be worse. So, so much worse. If you happen to be typing something that can be interpreted as an action by that dialog-- and remember, pressing the space bar is the same as clicking a button when it happens to have the focus -- you could suddenly and very much accidentally be in a world of pain. Like this poor, unfortunate soul, who recently posted a plaintive comment to my XP Automatic Update Nagging post.
Great news! Microsoft developed a solution to this problem! Microsoft's most talented programmer figured out how to make "Reboot later" mean "Reboot when user says reboot". It only took some tweaking to 1 line of code, 180 days for approvals from 80 managers, 80 resource files for different languages, and 18 days for testing in one of the languages. It worked.The programmer opened a SourceSafe^H^H^H^H^H^H^H^H^H^H^H Team Foundation window in order to check in the fix. An expert programmer, she was used to using the keyboard. She didn't click her mouse on the "OK" button, she just hit the Enter key.
The "Reboot now" / "Reboot later" prompt flashed so briefly, she didn't even notice it. She thought she hadn't pounded the Enter key hard enough. Looking at Team Foundation's "OK" button still waiting there for her to hit the Enter key to check in her work, she hit the Enter key again.
The check in started. The check in got killed while her workstation rebooted. There we remain today, with the check in half-in and half-out, unusable, with no good copy of the code. So that's why the fix was never released.
It's a perfect example of how stealing the user's focus can lead to catastrophic results if the user is particularly unlucky. Unfortunately, this burden falls heaviest on us keyboarders.
Another classic example is the IE download notification window, which loves to pop up, steal the focus, and tell you the great news: your download is complete! Oh, and your newly downloaded file is copying to its destination! Hooray! Unfortunately, this very same download notification dialog also contains a "Cancel" button. Guess which button just so happens to have the focus when this pops up? Why you'd want to cancel a download after it is complete is a mystery to me, but I've inadvertently pressed the space bar on this dialog more than once.
Stealing focus from the user is never acceptable. I can't imagine any circumstance where this would be desirable or even defensible behavior. Modal dialogs are bad enough, but this is even worse-- it's almost a system modal dialog, so self-important that all work must cease as the user is forced to pay attention to whatever earth-shattering message it urgently has to deliver. It's an extreme form of stopping the proceedings with idiocy. I'm not the first person to complain about this, of course. Fellow members of the "Don't Steal My Focus" club wrote about this back in 2002, again in 2005, and a few months ago. It's not exactly an unknown or new problem. So why do we have to keep talking about it and dealing with it? What gives?
The strange thing is, there are provisions built into the operating system to protect us from badly written, focus stealing applications. The ForegroundLockTimeout registry setting is expressly designed to prevent applications from stealing focus from the user. The OS silently converts that inappropriate focus stealing behavior into friendlier, less invasive taskbar button flashing, which is the subject of the ForegroundFlashCount registry setting.
I've seen this work. Most of the time, it does work. This setting is enabled by default in Windows XP and Vista. And yet, applications are occasionally able to steal the focus from me and screw up my flow. I'd say it happens a few times a week on average. It's perplexing. I'm wondering if it's because badly behaved programmers abuse the "Always on Top" window flag in a misguided attempt to get the user's attention. I suppose as long as there are bad programmers, there will be some unorthodox way they can devise to steal the focus from the user. At some level, sufficiently advanced incompetence is indistinguishable from malice. Maybe we'd have better luck educating programmers on the evils of focus stealing and, more generally, the futility of unnecessary notifications the user isn't going to read anyway.
But in the meantime, please don't steal my focus. I'm using it right now. Really. I am.
Speaking of IE and stealing focus. That has to be my current biggest pet peeve about any software that I use routinely. I have to assume I am not the only person who has participated in the race where you are trying to type something in the IE address bar while it is loading a web page. If you are quick enough to get it all typed in before the new page starts loading, if not you will have to repeatedly click back on the address bar to take the focus off the loading page. Combined with the unfortunate UI design choice in IE7 to make the stop button tiny and in a place that is hard to spot it makes for a frustrating experience. I still haven't tuned my motor skills to find and click that browser stop button quickly. Aren't stop buttons supposed to be giant red buttons that you can't avoid looking at if you wanted to?
JohnFx on December 5, 2007 7:27 AMI often discover, usually just as I press Enter, that half the text I thought I'd typed in the search box at the top of Firefox has ended up in the address box instead. Dunno what's up with Firefox to steal focus between UI components like this, but it's damn irritating.
I hope the authors of Pidgin are reading this.........
Stupid thing steals focus like crazy; it's rather embarassing when I'm typing code in an IDE, and find myself sending it off to someone in an IM instead!
I have to admit though: It's almost funny when they know nothing about coding, and think their PC just went berserk. ;-)
Computer Guru on December 5, 2007 7:37 AMThis reminded me of something I saw on something awful:
http://img248.imageshack.us/img248/9930/qirexho2.jpg
(slightly edited to be family-friendly)
Yes, KDE did get it right. Or more accurately, kept the old, correct, behaviour from prior window managers.
It's kind of depressing that the vast majority of computer users (Windows and Mac) have to put up with such moronically mis-designed window management schemes that aggravate and confuse them every single day. The fact that MS apps can steal focus on OSX means that OSX is half-baked, not just that MS apps are crappy.
There's a delicious irony that X, not exactly known through the years for its "user-friendliness", gets this important thing right where the mainstream OS's get it so wrong.
Oh well, there's hope yet for Windows yet if MS ever decide to do what Apple did and just run win32 binaries in little VM's, and do one better and implement a sane X-style window manager to contain them.
yipyip on December 5, 2007 7:44 AMThere is related problem in browsers:
Applications should not change the contents of a textbox while a user is typing in it, caret should not be moved away from the textbox either.
Example 1:
You point your browser at Gmail, and as soon as the username and password fields appear, you begin filling them in, but while you are in the middle of that, auto-fill-passwords kicks in and screws up your shit... you may find yourself typing out your password in a non-censored textbox.
Example 2:
Typing into the main address bar of a browser while it is loading a page...
They have a fix for this: Linux! Seriously, in KDE (probably Gnome also) you can toggle the level of focus stealing. Mine is at the highest level (of non-focus stealing) so that even when you open a window, it's put in the background, so that it loads and patiently waits for it's master the way a good computer program should. Not like in Windows, where if I open 4 firefox windows I get interrupted 3 times as each one opens.
This focus problem is probably my single greatest pet peeve in Windows computing.
Jeff on December 5, 2007 7:57 AMJavascript alerts. I even have a solution to it, though it involves sidebar bloat.
Montana Rowe on December 5, 2007 8:18 AMMatlab is one of the most annoying applications in this respect. If you are running a long script that generates any graphics, it will steal the focus EACH TIME it generates one. If you've done any serious matlab work, you know that there are often jobs that run for great lengths of time. During the time it is generating graphical output - it will continually engage the user in a tug-of-war for the focus. But that's not the most annoying behavior.
If a script errors out, it WILL NOT return focus to the application (unless the debugger stop on errors is enabled). The one time you really want to be bothered - it won't bother you.
Marc Passy on December 5, 2007 8:24 AMTo me, it's not just pop ups and dialogs.
I know my computer is slow at certain applications (read Office).
So I'm normally just working in my browser and I (want to) start Word in the background, I click on the icon in the start menu and go back to whatever I was working on.
But no, Word has to pop up and stay in focus all the time and freeze for a couple of minutes (while not using any CPU or HDD). Usually stealing focus for a portion of the time from any other app.
MLeo Daalder on December 5, 2007 8:27 AMOr when you are typing a document, and that means hitting the space bar every second or so, and up pops a dialog that disappears.
And the update dialog that reboots by default is particularly gross.
Happened To Me Too on December 5, 2007 9:18 AMThe all time classic is "Click OK to restart you computer"
It's so important that you reboot now that you get no other options
However you can just move it out of the way and carry on so it obviously is not that important after all?
Why do they give you no other button if there truly is no other option ,or have a reboot later option if that is applicable
This is simply bad design, Is it important or not? If it's not obvious then it is badly designed
Jaster on December 5, 2007 9:34 AM
"Never ascribe to malice, that which can be explained by incompetence."
-- Napoleon Bonaparte
"At some level, sufficiently advanced incompetence is indistinguishable from malice."
-- Jeff Atwood
So..in language we can all understand:
incompetence ~= malice
incompetence == malice for really large values of 'incompetence'
I'll never forget that time Skype stole the focus from me. I had just initiated a remote desktop and was just about to type my password in, when a skype chat message popped up and I typed my password in to a co-worker.
My password was orange, and now he knows it.
Marty on December 5, 2007 9:41 AMDavid Avraamides wrote:
"I call bullshit on your anecdotal story: why wasn't the local copy of the source code on the developer's machine still good? And if it was half checked in, then those files just won't be updated on the next checkin."
You're half-right. The story was bullshit, but it wasn't anecdotal, it was rhetorical. Furthermore it was recursively rhetorical, and it included an auxiliary jab about checkins, and it borrowed a line from an old science fiction story where a magician was stuck halfway in and halfway out of a Klein bottle.
So it was bullshit. There must be some other reason why a fix exceeds Microsoft's programming capabilities.
Rhett Torek (aka The Fix) on December 5, 2007 9:43 AM@jeff
Linux suffers from this as well. The focus-stealing-prevention settings in Gnome do not work. Perhaps KDE is better, from the sounds of some others here.
Pelle on December 5, 2007 9:53 AMSwitch to Mac OS X :-)
it does that too.. iTunes comes to the front often on things like detecting an iPod
The problem with Windows is that it's OK to steal focus some time, but something should be done for the keyboard accelerators for the buttons should be.
Windows Update it not too bad.
*** the cases that drove me to Firefox : ***
1) Download a file with IE 6
2) after it's downloaded to the cache, it copied it to the 'right location;
3) Focus-stealing progress bar shows up WITH THE CANCEL BUTTON GETTING THE FOCUS
4) Result: copying is cancelled, you have to find back where you were and download the file again
All the damn progress bars on Windows have keyboard focus on the Cancel button!!
In Vista this is a little bit better. But not much. It's
still the same principle. You can now tell it to remind you up
to 4 hours later. But still not "Never!". I really don't see why..
Windows Update has to force people to reboot, otherwise they never do. They keep putting it up to later and never get the critical security installed.
ulric on December 5, 2007 10:02 AMOutlook is the absolute worst offender (after the Automatic Updates).
I'd love to hammer the thumbs of the guy responsible for that one.
Brianary on December 5, 2007 10:04 AMoops, the IE download example is already in the article, my apology
ulric on December 5, 2007 10:06 AMa focus stealing scenario :
one evening,i was really tired but due to my zeal to learn c# i started reading an e-book.Then i got to the c# OOP part which i was eager to read.....out of nowhere this pop-up pops up :AVG Anti virus -updating (WTF!!!!).It drifted my focus from what i was reading such that after minimizing it i couldn't make sense out of the e-book i was reading .I just shut down the pc and went to sleep .freaking focus thieves.
one time i had a massive query i had constructed for use the next day. that evening windoze did an update and rebooted so the query was gone forever. so much for automatic updates.
Mike P on December 5, 2007 10:10 AMi pretty much hate all anti-virus programs. they're more of a hindrance than help.
Jin on December 5, 2007 10:16 AMAbout IE:
I always check the checkbox on the download dialog, so that it just quietly completes. But I still get the annoying "copying files" dialog... I've already downloaded the file to the SAME partition, why does it have to COPY the file to the destination, when it could have moved it in less than a fraction of a second...
N on December 5, 2007 10:17 AMis this ForegroundLockTimeout you speak of the reason that miranda doesn't pop up message windows for me? i've always been annoyed that new instant messages don't pop up on top, even when i have expressly told them to do so.
cowgod on December 5, 2007 10:35 AMinstead of prompt box that appears on the screen why not make it like google pop up. It only goes on the lower right screen and it doesnt grab someones focus though it gets attention which is obviously its purpose.
try this programmer. try this.
damien boy on December 5, 2007 10:36 AM@ fly.floh :
Even Firefox does it when a download is over.
It is annoying when you try to load many files.
The one that annoys me most is Firefox's Automatic Updates, which seem to be once a week. You know the dialog, the one that makes you install the update "Now" or "When you restart". No option for "Never", mind you. Call me a control freak, but that's not cool.
Ironically, as I typed this, the Outlook Meeting reminder stole my focus twice.
Rick on December 5, 2007 10:51 AMSome caveats.
If I have an app running full-screen, it's because I want to give it my full attention. I'm really surprised Windows allows this.
It's quite rare, but I *have* been kicked out of full-screen games when a poorly written app forcefully pushes itself to the top. I'm pretty sure this isn't an easy thing to do-- that takes a special level of incompetent programming.
I have to assume I am not the only person who has participated in the race where you are trying to type something in the IE address bar while it is loading a web page. If you are quick enough to get it all typed in before the new page starts loading, if not you will have to repeatedly click back on the address bar to take the focus off the loading page.
To be fair, we can't blame this entirely on IE. If there is JavaScript setting the focus to an element on the page (eg, Google search box) then the focus will be shifted as you describe. There is an argument from some usability folks that web pages should never explicitly set focus because the user doesn't expect this.
Jeff Atwood on December 5, 2007 10:52 AM It's quite rare, but I *have* been kicked out of full-screen games
when a poorly written app forcefully pushes itself to the top. I'm
pretty sure this isn't an easy thing to do-- that takes a special
level of incompetent programming.
And the windows "you really do wan to reboot now you fool" dialog is one of the ones that will do it.
Jess Sightler on December 5, 2007 10:59 AMI concur
Billkamm on December 5, 2007 10:59 AMAn awful one is when you get a login box popped forward, with the password field highlighted -- with a saved password. If you don't know the password, it's a terrible feeling when you type 'lol [enter]' into that box and wiped out the saved one.
Scott on December 5, 2007 10:59 AMRe: Slow, bloated apps starting in different workspaces.
Mac does this too. It's freaking annoying. FF is the worst. One of the reasons I think I don't experience any problems with focus stealing in Mac is my usage pattern. I run six workspaces, with my Mail, FireFox, a terminal screen, Wireshark and iTunes open, with the sixth reserved for short use apps. I spend almost all of my time CTRL up / down between my browser and terminal.
Paul on December 5, 2007 11:05 AMI used to have this problem. Recently switched to a Mac and don't have it any more. I still use Windows Messenger as it seems to be the de facto IM client in SA, and even when I disconnect my NIC to cross over to a machine I'm building, all that happens is a notification behind my terminal window and an angry Messenger icon jumping up and down in the dock. I can live with that. Focus stealing is the devil.
Paul on December 5, 2007 11:10 AMI have seen this happen many, many times. The most memorable example was at a university symposium where a visiting professor was showing a Powerpoint presentation and a huge antivirus software update slid up the projection screen like a piece of radioactive toast. A hundred PhDs and academics sat there staring at it. The visiting professor was using a wireless clicker and did not have keyboard access. She tried to use the cursor keys on the clicker to get rid of it but, of course, the updater interpreted that to mean "go ahead and download GB of updates and restart the machine".
The entire symposium was blocked for several minutes until a tech turned off the screen and the professor continued the lecture without the presentation.
Richard Hough on December 5, 2007 11:15 AMThis is one of my pet peeves with Windows. It's so much less of a problem on OS X that when I first switched I thought the issue was gone. There is no way all the app devs are going to fix this. It must to be fixed at the OS level.
One of those little things that drives people nuts and affects user experience. The worst is typing and getting a pop up that sends your characters to a box. Why can't there be a user lockout for certain activities?
This kind of thing will never be fixed in the current Windows code base. It's a Version 2 item for when MS wants to copy Apple's OS switch and license or rewrite their whole UI.
Stephen on December 5, 2007 11:28 AMAmen brother. This makes my top 5 list of Windows annoyances.
There's another one I would consider adding, though I'm not sure how common it is. When I click on certain applications on the taskbar that don't have focus, and those applications are not minimized, they get focus *and* minimize. Then I have to click the taskbar icon again to see the app I was trying to see. Argh! (maybe it's poor programming on the developer's part, I don't know... but maybe the OS shouldn't let this situation arise?)
Mike Strother on December 5, 2007 11:34 AMHallelujah! Preach it brother Jeff. I've been screaming about this for years. It happens more often in Windows than in Gnome/KDE, but it is the single greatest annoyance using GUI operating systems.
I've almost decided to go exclusively command line just because of this issue. I'm going to print out your blog post and put it up in my office.
David on December 5, 2007 11:56 AMIt's quite rare, but I *have* been kicked out of full-screen games when a poorly written app forcefully pushes itself to the top. I'm pretty sure this isn't an easy thing to do-- that takes a special level of incompetent programming.
The AIM messenger is very good at that particular trick. Even games that I can't even Alt-Tab out from, it can take them all down when someone pops up a new message window.
Kal_Torak on December 5, 2007 12:03 PMfirefox is another culprit of changing focus by default to components you do not intend to use.i had google as my home for firefox,when i start up firefox (while the home page is still loading)and start typing an address in the address bar ,the focus shifts from the address bar automatically to the loaded google search engine leaving the address incomplete and continuing it in the search engine if i don not notice and change the focus to the address bar.that is so annoying!
gogole on December 5, 2007 12:27 PMBTW my home page is set to blank .that solve that annoying problem.
gogole on December 5, 2007 12:30 PM*solves
gogole on December 5, 2007 12:33 PMNo kidding, I was thinking about this the day before this blog post. I really really hate apps stealing focus, it's why I disable features I can that steal focus, like MSN's nudges, which piss me off most (why they ever added that is beyond me, I thought MSN Messenger was developed for admins to use to message each other or sumat? Not to have conversations, and then get into a hissy fit when the person doesn't reply back for a whole 5 seconds).
I don't get so annoyed when the program doesn't steal focus, but still pops up on screen, like new XFire messages, even though they're not perfect, from the fact you then have to switch to them, to close them anyhow.
"There we remain today, with the check in half-in and half-out, unusable, with no good copy of the code."
I'd say the issue isn't about focus-stealing dialogs (which are indeed a nuisance with wich I fortunately don't have to deal with on my Linux desktop) but the fact that they're using a pretty crappy code revision system that doesn't care about atomic commits. Serves them good. Bad decisions tend to come bite you when you least expect it.
[Editor's note: I wondered about that too, as TFS uses a two-phase commit system. The original commenter, Rhett Torek, noted that his post was a parody and not an actual event.]
cpinto on December 6, 2007 1:14 AMRecently I heard someone recommend that you simply file a bug report for the application that stole your focus.
They were talking more about open source projects in active development, but there is no reason you can't do it for any application. Providing it is actually possible to submit a bug report...
Is not being able to submit a bug report a bug in itself?
Stephen on December 6, 2007 1:27 AMDon't use IE. Don't use Windows, duh.
ff on December 6, 2007 1:32 AMKenW: I in no way implied that Microsoft is prefect. I have been reading this blog for quite a while and always felt it was fair in its criticisms.
The second paragraph in this post is pure FUD. I once kicked the power strip in the middle of a check in, after starting up my computer I checked it in again without error. Really thats what prompted my first post, now i think I may have been a bit harsh. One bad commit doesn't negate hundreds of good ones.
I apologize to Jeff.
I agree 100% with everything else KenW said, couldn't have put it better myself.
Oh boy, I never realized that this was such a big problem for so many!
Wondering on December 6, 2007 2:08 AMBitDefender is shocking for this.
You can be watching a film full screen with BitDefender running in the background when suddenly it decides it needs to bring its auto-update progress box to the front and 'Restore' media player to running in a window.
For each update, this happens twice !
Truly appalling software design.
matt on December 6, 2007 2:33 AMBrilliant.
And I just thought it was me quietly going bananananas.
Attention-whore apps are *especially* frustrating if you're confined to a so-called low specification (win) machine: you can't even try to predict when the various processes will kick off and leap out of nowhere to kill/crash/delete/send whatever really shouldn't be killed, crashed, deleted and/or sent.
daintree on December 6, 2007 2:53 AMYou forgot to mention the ridiculous info bubbles like:
"Your document has been sent to the printer"
"Network connection has been established"
"Your computer is not protected"
"blablabla"
...
Do we need this information? I guess some programmers do think that there functions are awesome and want the world to know. They probably tell there mates "hey you know that incredibly annoying info bubble, it's mine"
One of the many frustrations that made me switch to mac/linux.
Dobby on December 6, 2007 3:36 AMThere's nothing like the panick you feel when you have to play the "reach the save button before the computer restarts" game every time you accidentally click the "restart now" button...
N on December 6, 2007 3:38 AMThe worst culprit for this that I deal with on a daily basis is Sonic Scenarist. When you're outputting a project to DLT, if the tape needs changing it'll popup up a dialogue in front of whatever app you're using asking you to change the tape, but you'll also be unable to switch focus back to that app you were using until the tape is available, which can take up to 2 minutes. Stupid.
edheaded on December 6, 2007 3:59 AM[KenW ] So you were watching "that XXX torrent file you just downloaded" on "a workstation at work"? Is that a terribly good idea? And does your employer know about this?"
hold your horses KenW - it was a joke, or more like it was a warning to the 'internet audience' (using the computer primarily for prOn) of the possible consequence.
I know though that sentence sounded like I am watching XXX videos at work, but blame that on my English as a second language. And elieve me, buddy I am so busy I don't have time to wank at home, yet alone at w
elijan sejic on December 6, 2007 4:16 AM"Thinking about it, what computers are up for days at a time?"
My computer is rarely rebooted, I hibernate.
I second the idea that a Growl like system would save a lot of this. Then again it's possible to do something similar with balloon tooltips but they're underused too.
[ICR] on December 6, 2007 4:31 AMTo everyone Bitching about the 5 minute forced restart. If I'm not mistaken, this setting only applies if you're receiving updates from an SMS Server, and the system policy is to force a reboot. If this is happening on your home computer then something is borked, as in all my years of using XP, I've never seen that.
Brian on December 6, 2007 5:46 AMYes it can be worse.One word - Norton bloody antivirus (actually three). Besides being attention whore app and crappy antivirus, Norton is also confidentley "OK" with your choice of restarting the computer. Its like living in Soviet Russia - where computers reboots you.
The problem is that in the midle of a work, OK button seems just confirmation button for a message that INFORMS you that the updates are complete (like, for example AVG has) However, after you press enter (just to get rid of the bastard) your next thoughts are 'Shit...Did i save that last bit?". Chasing the app and pressing ctrl+s combo after that can be fun though. Not good if you were wacthing that XXX torrent file you just downloaded.
And don't look me like that for using Norton - it's a workstation at work.
elijan sejic on December 6, 2007 5:55 AMThis used to be a decent blog. Now its turned into another bash Microsoft for page hits blog. Enjoy your new ad revenue from the Reddit/Digg crowd.
MiddleMan on December 6, 2007 6:30 AMStealing focus is vital in online poker where you can be surfing etc but when its your turn to move the software pops to the front of the screen.
If not you won't know when its your turn !
Apart from that apps should never steal focus.
Mike Time on December 6, 2007 6:42 AMThe worst I've experienced for doing this was notification application for a music event. It stole the focus just after my bluetooth mouse batteries died. It stopped me from accessing the application for installing bluetooth devices nor could I save any of my programs. In my rage I repeatedly press the power switch and thus broke the case.
Another hate of mine is unnecessary system tray icons. They are usually the same applications that decide they should be started when the machine is booted up thus making it 5 minutes before the machine is usable.
Paul on December 6, 2007 6:59 AMI've been upset about this for a while. The Windows Update nag box is the biggest offender, though. I can't believe that Microsoft allowed it to work that way.
IM clients are another problem. I'm not sure if it's the use of the flashing task in the task bar or not. But, those new windows (especially in older versions of IM clients) would often pull you out of a full-screen application.
I can see when you may want apps to steal focus. But, I think that they should be allowed to do so only after you are notified of the first attempt and given a choice: "Allow this application to steal focus?" "Always allow this application to steal focus." "Do not allow.." etc.
Sean on December 6, 2007 7:24 AMStolen Focus:
I'm typing away blissfully, and from the corner of my eye I see a window come and go, stealing my last few keystrokes. Even worse is when I'm not sure which window popped up and what did I just tell it to do?
For the disabled PC user, every mouse click and keystroke can be a major effort or literal pain. So disabled users will often go to great lengths to automate repetitive tasks and minimize the steps required to perform each task. This includes the use of macros, voice recognition, mouse and keyboard utilities, and special hardware such as head-controlled mice and programmable button boards.
But in spite of these efforts, disabled PC users are often confounded by all-too-common problems found in today's Windows and Web applications.
Following are 20 problems with PC software that may be minor nits for many users but can be a huge problem for the disabled.
http://www.devtopics.com/pcs-and-the-disabled-20-molehills-that-become-mountains/
DevTopics on December 6, 2007 7:48 AMThis is especially hilarious if you're the kind of person who enjoys videogames, like me. Especially if the games you like are memory-hungry ones that provoke minute-long bouts of memory swapping whenever you switch out of them from fullscreen mode. I can't tell you how many times my IM application of choice has screwed over a game of Team Fortress 2 by forcing it to minimize out of the blue in favor of a one-line message from a contact. At the best of times, it results in spending the better part of a round just trying to get back to a playable state; at the worst of times, it takes the entire operating system down with it.
Tip from Simon Peyton Jones' site:
http://research.microsoft.com/~simonpj/win32-cheat.html
"Microsoft Powertoys is a bunch of small but useful tools. Ones I've used or had recommended include:
* TweakUI: a control panel that lets you alter aspects of the Windows user interface. The ones I like are:
o File-name completion in the cmd shell.
o Stopping popup windows stealing focus, so that your input goes to the new window."
Herrmann: Sadly, it doesn't do a good job at it. Even after installing TweakUI and toggling that setting, Pidgin still steals focus all the time.
Peter C O Johansson on December 6, 2007 9:00 AMHey orange, this is for you:
Happened to my wife yesterday - she was trying to use the BART
website to print herself a one-day parking pass. She was using
an OSX 10.4 powerbook with FireFox and choose Save As PDF.
Unfortunately something went wrong with Firefox at that moment
and another modal dialog appeared.
This dialog unfortunately obscured the first one but for some reason
did not have the focus. She freaked out because now she couldn't
safely quit the application and she was afraid that she wouldn't
be able to get back to the site without having to pay again.
Luckily the number for her parking pass was visible on the screen
so she recorded that and called the help line.
I don't think this is a browser issue, and I think the only solution
is to insist that all modal dialogs implement the ESC key as Cancel.
The vi editor got this right 30 years ago: you should always be
allowed to press ESC to get out of whatever mode you're in.
Focus-stealing is bad enough but ... Microsof'ts source code control CORRUPTS FILES when the OS requests a restart in the middle? And no one sees anything wrong with this?
An OS restart request is just that: a request. Any app worth its salt should check the "dirty" state, pop up a "save" confirmation (or if it is in the middle of a critical operation stall until that finishes), and wait for the user to hit "save" AND commit everything to disk before telling the OS it is done by shutting down.
I've seen this work on Windows, so I know it's not an OS X only thing. It's just bad programmers not properly reacting to OS messages.
As for those saying it doesn't happen on OS X: it does. Prime candidate is my workplace-required Norton Antivirus, which pops up its "live update" window whenever and wherever it pleases. I also notice that ChronoSync occasionally "borrows" focus (it doesn't pop to the front, and the keyboard doesn't trigger its "Abort" button, but it does interrupt the flow of writing for a word or two at a time, intermitently). It's just that most OS X developers use the less-invasive methods for getting a user's attention (bring up an alert sheet which bounces the dock icon) ...
Anyway, back to the original topic: does IE still not care that you have a long missive typed in a text field when asked to restart? I know Firefox and Safari have long-since discovered that, more often than not, the thing I've been typing is relevant to me and I don't want to just shut down the app without submitting it ...
Tom Dibble on December 6, 2007 9:37 AMSwitch to GNU/Linux. Most window managers do a perfect job at focus stealing prevention ;). I use KWin ATM. No app has ever stolen my focus.
Paul on December 6, 2007 10:48 AMMike P: "one time i had a massive query i had constructed for use the next day. that evening windoze did an update and rebooted so the query was gone forever. so much for automatic updates."
Sorry, Mike, but if you took the time to write a "massive query" to use the next day, and then walked away for the night without saving it first, that isn't a Windows problem; that's an incompetent user problem.
You can't blame "windoze" for your own stupidity. Blame Windows for the things it does wrong (like the dialog we're discussing here). But don't blame it for what isn't it's fault.
Brian: "To everyone Bitching about the 5 minute forced restart. If I'm not mistaken, this setting only applies if you're receiving updates from an SMS Server, and the system policy is to force a reboot. If this is happening on your home computer then something is borked, as in all my years of using XP, I've never seen that."
If you're running XP and *not* seeing this, you have automatic updates turned off, or don't have an internet connection on your machine. I'm using a fresh install of Windows XP Media Edition (which is XP Pro with a handful of media enhancements added) with SP2; until I found out you could fix this issue using Group Policy Editor, it drove me nuts.
elijan sejic: "Not good if you were wacthing that XXX torrent file you just downloaded.
And don't look me like that for using Norton - it's a workstation at work."
So you were watching "that XXX torrent file you just downloaded" on "a workstation at work"? Is that a terribly good idea? And does your employer know about this? g
MiddleMan: "This used to be a decent blog. Now its turned into another bash Microsoft for page hits blog. Enjoy your new ad revenue from the Reddit/Digg crowd."
I don't see it that way. There's nothing wrong for criticizing MS for things it does wrong; the problem is with the "Reddit/Digg" and /. crowd that insists on bashing MS for everything, even things it has no control over (see my response above to Mike P for an example). Your post is another example of a totally ludicrous post (as bad in a different way as Mike P's), as you seem to think that MS is absolutely perfect and should never have a negative thing said about them.
However, if you feel that negative about Jeff's posts here, I'm sure he'll be glad to refund the membership dues that you paid in full, and you can simply delete the bookmark you have to codinghorror.com.
And Jeff? If the refund is an issue for you (like say you spent that vast amount you collected from MiddleMan already on your mortgage or something), drop me a note and I'll chip in to help you out. g
KenW on December 6, 2007 11:07 AMMike Time: "Stealing focus is vital in online poker where you can be surfing etc but when its your turn to move the software pops to the front of the screen.
If not you won't know when its your turn !"
If you're playing online poker, you should play online poker and not do something else. That way you'll know when it's your turn, and won't need focus to be stolen.
Besides... Are you suggesting that Microsoft somehow create an API call that can *only* be used by online poker games to steal focus, but not be used by other applications? How exactly would that work? Would the poker game have to register with MS in order to get the information about the API? If so, what's to prevent them from using the API in another type of application as well?
Or do we have the poker game creator get the game's name embedded into Windows itself, so that the kernel can reject calls to the API unless the game is on the list? In that case, what happens if Vista contains the list now, and tomorrow you create a new poker game - how do you get added to the list so you can use the API? Do you wait until the next service pack for Vista? What if you've missed the deadline for that? Do you wait for the next release of Windows? Vista was only five years late.
You can't allow one type of program to do something that others can't. For instance, you can't let one video driver do something that all other video drivers can't do.
Peter C O Johansson: "I can't tell you how many times my IM application of choice has screwed over a game of Team Fortress 2 by forcing it to minimize out of the blue in favor of a one-line message from a contact. At the best of times, it results in spending the better part of a round just trying to get back to a playable state; at the worst of times, it takes the entire operating system down with it."
As I said before and now say again, that's not Windows' fault. It's yours, for leaving your IM application running while you play such a resource intensive game, thereby allowing it to interrupt.
It's fine to hammer on MS and/or Windows for things they do wrong, but you can't blame your own screwups on them.
Tom Dibble: "An OS restart request is just that: a request. Any app worth its salt should check the "dirty" state, pop up a "save" confirmation (or if it is in the middle of a critical operation stall until that finishes), and wait for the user to hit "save" AND commit everything to disk before telling the OS it is done by shutting down.
I've seen this work on Windows, so I know it's not an OS X only thing. It's just bad programmers not properly reacting to OS messages."
Well, you're mostly right. g A well-behaved application will *request* a restart, and if any running process says "No", the restart request is denied.
However, the Windows API does allow that request to be phrased as a requirement; that's done using the same API function (InitiateShutdown) with the SHUTDOWN_FORCE_OTHERS, SHUTDOWN_FORCE_SELF and SHUTDOWN_POWEROFF (and possibly the SHUTDOWN_GRACE_OVERRIDE) flags. That means that an ill-behaved application can force you to restart, even if you don't want to do so. I suppose this was done so that the OS itself could force a restart, but MS couldn't restrict it to only being used by the OS, as with some of the parameters it is quite useful from a systems/network administrator standpoint.
KenW on December 6, 2007 11:39 AMThis is one thing unix has gotten right for over 30 years. Sloppy focus all the way!
Brett on December 6, 2007 11:48 AMThis has always pissed me off... I dunno how many times i've IMed my friends chunks of code by accident. The IM client I've been using the last couple years, Adium, has a preference for its incoming-message-focus behavior which has been helped keep my blood pressure nice n low =)
Arin on December 6, 2007 12:50 PMImagine what ?
Yesterday I got a requirement to work on which talks about EXACTLY this. In fact, the requirement talks about implementing a new feature in existing application, that will pop-up a dialogue when user tries to query some data on the form. And what is the purpose of the new screen ? Bingo....audit user access.....and the icing on the cake is the new screen needs to be displayed randomly.....
Sometimes, I really feel people think that computer is a magician...
:)
KenW: If you're running XP and *not* seeing this, you have automatic updates turned off, or don't have an internet connection on your machine. I'm using a fresh install of Windows XP Media Edition (which is XP Pro with a handful of media enhancements added) with SP2; until I found out you could fix this issue using Group Policy Editor, it drove me nuts.
Are we talking about the same thing here? I was referring to the Forced reboot in 5 minutes. While I admit I don't have my home PC set to Automatically install updates currently, I can't think of the countdown for a forced reboot ever appearing. I only ever see that on my Work PC hooked up to the SMS server.
At home, my Automatic updates are set to Download, and notify, and I DO get the Updates have been installed, you need to reboot nag message.
So ... buy a Leopard
This and many more problems fixed ...
Scot, the "fix" only works if the programmers let it work. It's enabled by default in Vista, and we still have problems with evil programmers deciding to steal the focus.
Jeff Atwood on December 7, 2007 10:45 AMComandment #8: "Thou shall not steal"
Mac on December 7, 2007 11:18 AMHow's this for an example of why stealing focus is bad:
http://img441.imageshack.us/img441/671/lolfirefoxrj1.jpg
Jeroen on December 8, 2007 1:45 AMThat's the reason why I don't let my programmers talk to each other. For example, if there're two of them, for one it's always faster (1 minute) to ask something that he's forgotten (class name, how to use a specific command in editor, etc), then to read the manual (3 minutes). But for the other programmer it's an interruption (15 minutes!!!). After he switches to another task, he has to switch back, remember what he was doing, the structure, etc. So I don't let them sit together - and it really affects their productivity.
Alex on December 9, 2007 2:22 AMWhile not quite the same, I've accidentally deleted accounts using Novell's Console One because of the quirkiness of how it manages focuses. Just as annoying I suppose.
deww on December 12, 2007 8:59 AMI HATE that stupid popup so much. If I am in-game and it comes up it minimizes my window, I have a lame graphics card so I can't tab back into my game! RUINING MY GAME! =(
Cody on December 13, 2007 4:54 AMIf the Devil contributed anything to software, or has any influence in Redmond, I'm sure this is his greatest (most malevolent) contribution...
110% agreed - Stealing focus is nothing short of Satanic.
As for "so long as it is due to a user generated action" - I'd say that's not "stealing" then. It's due to a user action. Stealing is *not* due to a user action.
Ryan Smyth on December 13, 2007 8:11 AMStealing the focus is perfectly acceptable,
so long as it is due to a user generated action.
Adobe Reader's update or confirm dialog sometimes doesnt pop up- stealing focus- but pops under, which seems to make the program freeze.
never acceptable? dude just disable automatic updates, and btw. dont use adobe reader either.
J on December 13, 2007 8:46 AMRyan, see Rhett Torek's post, above. It was a hypothetical example. All modern source control systems use two-phase commit, as does Team System.
Jeff Atwood on December 14, 2007 1:25 AMYeah, sorry, but Mac OS X can do it just as much as anything else. One of the worst offenders is Software Update. We have a lot of hosts at work that we don't update except at fixed times, since they're production servers. But if you log in via Apple Remote Desktop and start doing something, not only does Software Update pop up in front of whatever else you're doing, but "Install N items" is the default choice in the dialog! Why in the name of God is a potentially destructive choice, _in an app you didn't even consciously start_, the default?
JD on December 14, 2007 7:50 AMThe fact that their source control is so flimsy should be warning enough. We use Subversion where I work. If a commit fails, it gets rolled back. No half-in, half-out states to worry about. I've had plenty of problems with dialogs stealing focus myself, but nothing that has ever rendered an entire project useless.
Ryan Grange on December 14, 2007 12:11 PMstealing focus in this particular case, and few others, are remains of psychological trauma from time when ms operating systems had variety and severity of security issues in such a degree that could cause trauma. :)
Danijel Kecman on December 16, 2007 1:16 AMThose MS bastards! ;)
Just started download of the MS Office SP3 updates for office, project and visio. A whooping 202208KB - not something you download in a couple of minutes, no matter how good your internet connection is.
The 'Office Update Installation Wizard -- Web Page Dialog' window pops up , and it doesn't include any option to minimize the window, nor are you able to minimize the IE window that initiated the download.
just wanted to add my experience. my firewall kept giving me notifications that a pc on my lan is trying to access my comp, allow or disallow... one such notification came while i was typing a mail, my finger pressed the key "a" simultaneously as the popup came, the focus shifted to the popup, the "a" keypress nicely coincided with "a" for allow, the pc got access to my comp, infected it with GOD know what virus... had to do a clean format...
man, do i hate my firewall!!
Amith on December 20, 2007 1:03 AMI'm so glad that KDE has it right. Though, somehow, KDE does allow some applications to steal focus (emacs!!) and they've kept the mechanism for disallowing it a secret. Searching the personal settings for "steal" yields nothing; searching for "focus" gets you a "focus" page that has nothing at all about stealing; and Googling has only gotten me here. *ICK*
Bruce on February 7, 2008 8:31 AMThere was a program once which I believe could change all of these settings without having to do it through the registry. Also those annoying popups.
Rob on February 25, 2008 10:32 AMdsfdas
sdfasdf on March 17, 2008 5:52 AMBy a great coincidence, I came across this just as I was coding a little app to monitor another application and pop up when necessary. All I can say is, Microsoft doesn't make it easy. I tried ShowWindow with SW_SHOWNOACTIVATE, but the window was still getting the focus. Strangely enough, if you minimized the window and let it pop up again, it worked correctly. Now my startup code flashes the window briefly before minimizing it, just to make sure the focus works properly later.
Mark Ransom on March 21, 2008 3:54 AMThe reg file thing doesn't even work for MS's OWN product, IE! I am running Vista and I get focus steals all over the place. Even from Vista. (makes me miss TweakUI and XP)
The two most annoying, frequent, and destructive are...
File Copy Dialogs
Downloads Complete
Why can't MS just add a option in the CP for this!?!? BAAAAAAHHH!!!!
"Do you know that the 90%+ users of windows will never reboot (or do anything, no matter if the taskbar is flashing or a new icon appear in the tray bar) unless they are forced to?"
That may be true, but Microsoft should consider cutting competent users some slack every now and again. Vista gives you the impression of being a giant, dirty two-fingered salute to anyone who is even slightly knowledgeable in the use of their PC. The lack of attention given to the supremely annoying focus problem (supposedly fixed in Windows 2000!!) is another sign that Microsoft doesn't care about you if you can tell the difference between "suspend" and "off". Productivity and convenience are out, idiot-proofing is in. And idiots don't use the keyboard.
David Pritchard on June 2, 2008 8:46 AMWelcome to Growth Plus+ Link Directories.where you get more traffic.
Gus Gaspar on June 29, 2008 6:03 AMAfter waking from sleep mode in Vista, it seems a process is stealing focus from Office context menus and my start menu. Thing is, it's not one of the processes on my desktop, that's for certain, and my menus sometimes disappear before I can even hover over them. Aaargh!
seanb890 on August 1, 2008 12:35 PMThe comments to this entry are closed.
|
|
Traffic Stats |