in

ASP.NET Weblogs

This Blog

Syndication

My Job

Jeff Key

It works on my machine

Focus-stealing dialogs should not have default buttons

I don't know how many times I've been typing something when a dialog pops up mid-word and then it disappears as quickly as it appeared because my brain doesn't work fast enough to tell my fingers to stop typing the instant an unexpected dialog box appears.  This is generally A Bad Thing since whatever popped the dialog thought it was important enough to disrupt whatever I was doing in the first place.  This just happened with my firewall.  I was in the middle of typing an IM and apparently some app wanted to use the internet.  Which app was that, you ask?  I have no idea because the dialog contains a default button.  

I consider this a bug and I'm going to file a bug report when I'm done typing this.  Please, friends, if you must pop up a dialog that steals focus, don't give it a default button.  I and many others thank you.

Published Dec 19 2003, 07:07 PM by jeffreykey
Filed under:

Comments

 

Robert McLaws said:

AMEN!
December 19, 2003 8:11 PM
 

Raymond Chen said:

Even if it doesn't have a default button, if it has keyboard shortcuts you're still at risk. Support you were typing the word "bye" when the dialog popped up. The "b" goes to the dialog and beeps, then the "y" pushes the "Yes" button. Oops, you just allowed an unknown app to get through your firewall.
December 19, 2003 8:50 PM
 

Drew Marsh said:

I agree. However, I would beg developers to stop using pop up windows all together. Find an alternate solution such as sticking a notification icon in the task tray with a pop-up balloon. Longhorn offers a built in notification API which totally rocks and standardizes things making it even easier for the user to handle notifications such as these. Ultimately though, the problem is that today's Windows still lets this happen.
December 19, 2003 9:11 PM
 

Raymond Chen said:

At each new version, Windows has made it harder and harder for apps to steal focus, but on the other hand, developers are becoming more and more resourceful in finding ways to get around each layer of block we add. Just do a google search for the words (setforeground behavior) and you'll find gobs of people who don't like the behavior and are looking for ways around it.

Every developer thinks their program is "so important that the rules don't apply to me".
December 19, 2003 9:51 PM
 

gimp said:

amen brother! preach the word!
December 19, 2003 11:21 PM
 

Jeff Key said:

Good point about the shortcuts, Raymond. Microsoft is guilty of this, too, and the craziest thing just happened: As I was typing that, Outlook 2003 popped up a dialog letting me know it couldn't retrieve email from one of my accounts, stealing focus while I was typing. Also, the popup that was the inspiration for the initial post was a Microsoft product. :)
December 20, 2003 12:20 AM
 

Shannon J Hager said:

manual trackback to my thoughts/frustrations with this issue: http://hdconsultants.us/posts/326.aspx
December 20, 2003 12:39 AM
 

matthew said:

that's what you get for using ZoneAlarm!
December 20, 2003 5:31 AM
 

Michael said:

Oh yes, I hope somebody from the SUS-Team will read this so they change their update-client so it doesn't request a reboot with a default-OK button.
December 20, 2003 6:28 AM
 

RM said:

The "stealing focus" issue was a major issue of debate between IBM and Microsoft when OS/2 was in development. Since Windows had from the start allowed focus stealing, they wanted to keep it that way. IBM vehemently said this was bad UI design and fought it. IBM would remove the capability, MS would put it back.

This was also the case with client versus System redraw of windows. IBM said System, meaning if a window was obscured the OS would save the bits on the screen and redisplay them when it was visible without calling the client app to do so. MS said "no", call the client app to redraw wasting memory and countless CPU cycles.

Someday MS will pull they heads out. It is just bad UI design and a major privacy and security hole.

May 3, 2004 2:09 PM

Leave a Comment

(required)  
(optional)
(required)  
Add