Please Don't Steal My Focus

@Daniel

There crops burned and there field salted.
Suddenly, finaly I understand what happend to Cartage.
They stole focus from the Roman empire :wink:

paktep wrote: ā€œAlso, why is it that 95% of the programs ask you to reboot when they finish installing?. Most of them don’t even touch the registry or your DS or S32 directories, just copy some files in a folder, put a shortcut in the start menu, and that’s it!ā€

That’s because they need to replace files which are in use. Windows doesn’t let you replace application binaries which are being used by a running process.

I believe Windows uses the position of binaries in order to perform some optimisation (leave some code out of RAM but have the option to load it later?) but I’m not certain this is the reason - or the main reason - why you’re not allowed to replace such files.

Um… no only does the focus not take over in OS X, but even in tabs in browsers in OS X. I can have a login box or alert in one tab and it will not override what I’m doing in the current tab. Ridiculous.

Hey Now Jeff,
I couldn’t agree w/ you more. It happens often to me with outlook reminders I get frustrated.
Coding Horror Fan,
Catto

AttatchThreadInput is usually abused in order to workaround the flashing taskbar intercept that Microsoft added to SetForegroundWindow

@David Dawkins: Get a sense of humour

Let us all say AMEN! Short of a catastrophic system failure, there is no reason for any application or system notification to steal the focus from the user. EVER. And Microsoft is often the worst offender.

It drives me nuts when programs do this. At the very least, it should n’t ever happen when I’m playing a game full-screen. I play EUO, a multiplayer online game based on the old Ultima games, and I’m tired of having my character killed and my quests interrupted because someone IMed me or my antivirus wanted to let me know everything is a-ok.

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.

More applications should be like Firefox… when you go to download a plugin it makes you wait 3 seconds before you click ok, and the download boxes have to be moused to (or wait 3 seconds) before you can accept the download.

The stolen focus is annoying…

But what about those stupid messages saying ā€œSystem will be restarted in 5 minā€? What about if you got up from your desk and left your computer working on any heavy task? When you are back… system restarted and work lost.

Work lost = time lost = improductivity = expensive O.S.

People used to get random bits of code over AIM from me occasionally. Other people weren’t as lucky, like one who sent his berpassword (as everything at University used the same password) to a random friend.

I think the problem is that programmers hate timeouts because they make things more complex. So code doesn’t get written to worry about these things.

Akira, you’re absolutely right about IE downloading to a temp folder and then copying it. Yes, its focus stealing behaviour here is not acceptable, but the real problem is that it shouldn’t need to present that notification in the first place. Just do it the way Firefox does it, and download to a temp filename in the selected directory, and then rename the file when the download is complete. This is item #1 on my ā€œWhy I don’t use IEā€ list.

This is my ABSOLUTE biggest pet peeve with graphical OSs. In fact, it’s the main reason I went all Mac for my work about 4 years ago. It still happens in OS X but it’s very rare and it tends to be appropriate - unlike Linux at work

To see this sort of end user notification and feed back down right, see Growl. It’s absolute genius and deserves to be in the core of OS X and mimicked by everyone else:
http://growl.info/

paul

ā€œLeave me alone!! I’m reading Coding Horror!!ā€ I pressed the ā€œrestart laterā€ button. Oops. This IS the blog. Silly me.

Yeah, I was about to second the mention of Growl on OS X in regards to the fellow mentioning Adium (my IM client of choice http://www.adiumx.com ) popping stuff up…

I have a couple applications that steal the focus repeatedly during startup. One has a splash screen that steals focus to tell me things like ā€œLoading DLLsā€ and ā€œLoading scriptsā€ and ā€œLoading preferencesā€.

Designers may steal focus for their dialogs because they’ve encountered dialogs that get behind the main application window and can never be accessed again. Too many times I’ve killed a ā€œnon-responsiveā€ app to find a dialog hiding behind it. My team even wrote one of these back in PowerBuilder days.

Splash screens are another evil. Lotus Notes has one that’s Always On Top, can’t be moved, can’t be sized. I really want to sit and stare at this thing for half a minute. Not.

Pet Peeve: The Google home page, best designed page on the internet, etc., etc., will internally steal focus inside your browser. If you are typing in the address bar while the Google home page loads, the last half of your url will get entered into Google. It’s rather frustrating.

I’ve never thought about it before, but is this why the ā€œOKā€ button on Firefox download dialogs is disabled for the initial few seconds? So you won’t mistakenly hit enter right away?

I just wish the reboot now or window had a ā€œNEVER ASK ME EVER F**KING AGAINā€ checkbox. Because, ya know, I’d check it.

Have you ever installed Norton Antivirus?..acidentally I hit Enter…
the computer restarted and I lost some work -_-

So use the free Grisoft AVG anti-virus software. It never does that, it never seems to require a reboot, and it’s free. (I’ve had viruses in the past which have caused less damage than I’ve heard Norton causes!)