Please Don't Steal My Focus

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.


This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2007/12/please-dont-steal-my-focus.html
1 Like

Hereā€™s the interesting part. Itā€™s not that itā€™s just bad behavior, itā€™s bad behavior that must also annoy a lot of people at Microsoft. I could probably come up with a list of at least ten windows quirks that must utterly annoy Microsofties - and yet they persist in the software for years.

This is really baffling to me. If it bugs you, then why wouldnā€™t you fix it? Your customers probably hate it as well. Youā€™re knowingly making sub standard software if you donā€™t.

Some Linux desktop managers (Gnome and KDE, IIRC) have this annoying property:

  1. Go to workspace 2.
  2. Launch a slow, bloaty program that takes a long time to come up
  3. Go back to workspace 1.
  4. Do some other work.
  5. Slow, bloaty program elbows its way into workspace 1 instead of 2.

The inferior Comcast version of TiVo, once a program has completed recording, will throw up the equivalent of a system modal dialog the size of a mattress informing you that recording is complete (and blocking whatever youā€™re trying to watch). But thatā€™s one defect among many, many for this hateful piece of software.

Groove is also annoying; unless you select ā€œsuppress alertsā€, the task tray icon interprets any mouse move within 200 pixels (ok, exaggerated) as a request to list every workspace that has updated files.

That leads to another problem where programs have no settings other than ā€œdonā€™t tell me about anything, even fatal errorsā€, and ā€œlevel 7 OMG STFU all possible debug messagesā€. Iā€™m looking at you, InstallShield. And Ant, to a lesser degree.

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.

Oh, and Peggle, which takes an inordinately long time to load for a 2-D non-scrolling game, stops loading if you alt-tab away from it. Loading will only complete if itā€™s in the foreground.

We donā€™t need no pop-up windows,
We donā€™t need no modal box,
No focus-stealing bad behaviour,
Coders leave my apps alone,
Hey! Coders! Leave my apps alone.

Better question - where did all the work go towards allowing updates to install without requiring a reboot? There was an initiative on the server side to minimize that back in the early part of the decade during my days at MSFT. It seems like every other Vista update requies me to update. Iā€™m left wondering if itā€™s really about replacing files in use, or could they have given me the option to close applications while something restarts on the PC.

I second the issue with Gmail stealing focus multiple times while itā€™s loading. This is extremely annoying and goes to show this isnā€™t just about desktop apps, Web 2.0 is just as guilty.

Switch to Mac OS X :slight_smile:

Right, I was wondering about whatā€™s going on with this focus issue, too. It works like you said - OS mostly prevents stealing focus but sometimes it doesnā€™t and when it doesnā€™t and one is typing a disaster might occur.
I hope someday this is fixed for good because the problem is really annoying.

Once, I wanted to close a windows with Alt-F4, when another window came stole the focus.

She got what she deserved, and was killed. Nobody stands in my keyboard line-of-fire and lives to tell the tale :slight_smile:

ā€œIā€™m wondering if itā€™s because badly behaved programmers ā€¦ā€

Itā€™s not always badly behaved programmers. Itā€™s quite often badly behaved customers.

I speak from experience.

Can happen to mousers too - if you haveā€™ā€˜SmartMoveā€™ enabled (obviously, they made the reboot now button the default!).

This will keep happening on Windows, because Windows apps are in direct control of theirā€¦ wellā€¦ windows. Linux apps are just as obnoxious (Thunderbird is killing meā€¦), but I can always override them from the window manager. Focus stealing is still allowed by default, though. Talk about misguided programmers.

Focus stealing has been the bane of my computer existence for a great number of years, and I have only ever had one question:

Who ever thought it as a good idea, and why???

MacOS X tends to pop to front much the way windows does. No change there.

I seem to remember that MacOS classic didnā€™t do this. If a backgrounded app wanted attention it would flash itā€™s icon in the application menu. For example, it would do this if it popped up a dialog box.

The only time an app would pop to front was when it launched. I donā€™t even think that putting up a new window would pop the app to front.

Yet another reason why MacOS X is worse than MacOS classic. :slight_smile:

Perhaps someone who uses a Mac (I donā€™t) can confirm this, but itā€™s my understanding that apps canā€™t steal the focus on OSX. If this is true, surely itā€™s been fixed at an OS level - which leads me to the next question: why does Windows allow apps to steal the focus? Why not just force apps to flash the taskbar instead? Iā€™ve been burned by this many a timeā€¦

Visual Studio help suffers from similar problems. At times it decides the best course of action is to steal my focus while Iā€™m typing in my search query - because it is loading online help!?. Clicking back on the input field clears your query so you have to type it again. While typing my query for the second time ā€œhelpā€ decides to refresh the online help pane and steals my focus againā€¦

Iā€™ve learned to open the help window at the start of my day - and close it at reboot :slight_smile:

I agree, focus stealing is incredably annoying.

If you start some application and then try to edit a word document or an email while you wait, the other application invariably pops up without warning in the middle of a keystroke.

Didnā€™t AmigaOS get this right 20 years ago?

at least itā€™s not modal.