Windows stealing your focus?

I did some research into this, after being reminded of it as a problem that leads to sysadmin error. When you are typing into a window (such as an SSH session) you do not want a program such as Pidgin to take the input focus and wind up typing the root password into an IM box to a friend – and over the network in the clear besides!

This problem is not unique to Windows; it is just happens in more places in Windows. MacOS X and Gnome can suffer from this problem; KDE apparently is the has the least number of problems with this.

Apparently, there is a registry setting that will fix this (almost); it can be set by using TweakUI or by changing the value by hand with RegEdit. The key and value are:

HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout – set to 30d40 (hex)

Johan Känngård has a short article where he describes a program he wrote to set the proper setting every time he logs in – to foil programs that reset the setting.

There is a detailed explanation from Jeff Atwood at Coding Horror about the problems inherent in the focus-stealing approach, and how to fix it as a user – and also an article about the problems with XP’s automatic update nagging (a prime offender in focus-stealing).

There is also a nice article from Pro Reviewer about the problem. One suggestion sometimes made (and made well here) is to use a utility that keeps a window on top of all others: this utility will also, by extension, refuse to give up focus from the affected window. Pro Reviewer reviews DeskPins, which seems to work well. Just don’t expect any windows to come to the front…. like Outlook notifications or popups, etc.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: