Posted By: Bas | Sep 17th @ 4:57 PM
page 1 of 2
Comments: 27 | Views: 689
Bas
Bas
It finds lightbulbs.

Why is it that we've come so far since the first Windows OS, and all the game changing advances that have been made, and all the usability enhancements that have come in Windows 7, a background window can still come up and steal fous when I'm typing something in another window? 

I mean, honestly. Is it totally impossible to just make the taskbar button flash or something instead of stealing focus?

 

Sure, Windows 7, go ahead and cancel that file copy dialog. I was just typing an email while you were copying that stuff, so I actually didn't mean to press cancel when I pressed the spacebar, but go right ahead, I don't mind waiting idly while you completely start over copying those 20GB of files.

 

 

FlashWindow() exists and is used quite often... but in some cases it's not used as you'd like... why? You'd have to ask people other than I.

I'd love to hear Microsoft's back-compatibility story as to why they won't remove the ability of applications to steal focus.

 

I'm concerned, however, that a file copy dialog box, in the middle of copying files, randomly for no reason took focus on Bas's system.

 

brian.shapiro
brian.shapiro
things go on as always

I think in some cases just a flashing button is too minimal -- it would be nice if you could have balloon messages from apps on the taskbar and not just the system tray. Whenever a message box pops up and the main app window is minimized, it would appear in a balloon message.

Dodo
Dodo
I'm your creativity creator™ :)

It also only does this when you're typing something, if you're moving the mouse or browse the web, it just blinks. It's hilarious, really. Smiley

It seems to always do it, not just when I'm typing something, but right when I'm hitting the space bar and the focus-stealing window has the option I'm most likely not going to want to click as the default button.

Charles
Charles
Welcome Change

This isn't the fault of the OS... Windows is a platform. Without user mode applications running on it, well, it becomes just an incredibly over-engineered CPU heater.

 

Send feedback to the application owners and ask them to add the ability to configure how the application grabs your attention when it needs it and is currently out of focus.

 

C

Oh I hate it when that happens. My favorite is when a window pops up that I wasn't expecting, like some error message window, but I'm typing so the spacebar just closes it.

 

You'd think it would be pretty easy to just remap calls to Activate to FlashWindow. I doubt many applications absolutely need focus right that instant.

 

Charles
Charles
Welcome Change

What are the heuristics Windows should use to accomplish this? How does Windows know what's right for all applications in all contexts? Applications are ultimately responsible for doing things that do not piss off users, right?

C

> This isn't the fault of the OS...

 

I kind of... disagree. If someone gives you a way to shoot yourself in the foot then you will most likely do it, remember the registry? If it’s there and there aren’t restrictions on how/when to use it, then it is as well your fault, who designed it. And it's a "bit" too late to request a redesign, when you have billions of applications into the wild.

Charles
Charles
Welcome Change

I will agree to disagree with you. Smiley

C

But Windows already has mitigations in place to prevent a background application from stealing focus, which means that either something has been missed or that the application in question is doing something deliberately to cicumvent that and steal focus when they know it isn't allowed, Ifan app developer is so convinced that their app is the only one important to you that they are prepared to go to any length to get the behaviour they want, there is little Windows can do to stop them.

This has been an ongoing battle between Windows and the apps running on Windows literally since the early days of Windows.  Windows tries to stop applications from stealing the focus and the apps keep trying to find ways to work around Windows so that they can steal the focus. 

 

Raymond's written about it before:

http://blogs.msdn.com/oldnewthing/archive/2004/02/16/73780.aspx

http://blogs.msdn.com/oldnewthing/archive/2009/02/20/9435239.aspx

http://blogs.msdn.com/oldnewthing/archive/2008/08/01/8795860.aspx

 

Charles
Charles
Welcome Change

Thanks for the links, Larry!!
C

RoyalSchrubber
RoyalSchrubber
One. How many time travellers does it take to change a lightbulb?

I can't imagine a single situation where you want an application to suddenly take over and grab all the key presses and mouse clicks you thought you were making in another situation. Can you?

 

Calendar app notifying you that you have important meeting? Anything that needs your immediate attention where little flashing icon isn't enough.

TommyCarlier
TommyCarlier
I want my scalps!

What about a user-initiated action across processes? If you double-click a file in Explorer and that file is opened by a single-instance application that is already running, then that application should steal focus instead of flashing a taskbar button.

We have an application for transmitting and receiving files, and we add a shortcut of our application to the “Send To” menu of Explorer. So, in Explorer you right-click on a file, select “Send To” and in the sub-menu select “Transceiver Communicator”. At that moment, our application shows a new transmission window. A flashing taskbar button instead of the window stealing focus is very annoying in this situation.

brian.shapiro
brian.shapiro
things go on as always

Anything thats the result of a user-initiated action or is extremely critical should steal focus, but short of that something thats less intrusive would be better. Thats why I suggest making notification balloons standard for the taskbar.

Maddus Mattus
Maddus Mattus
Do, or do not. There is no try. - Yoda

Why not just make it a configurable property?

 

"Allow Window to take focus" or "Supress Window take focus"

Massif
Massif
aim stupidly high, expect to fail often.

 

How about freezing out keyboard input to windows for the first 0.5 seconds of being visible? Might be a middle ground, and no-one on earth is going to be able to read and process a dialog that quickly.

 

Granted, it'd get annoying fast when I can no longer just hold down a key to auto-dismiss repeatedly opened stupid warning boxes. (like, I just asked a program to do something to 200 files it has to tell me individually for each file that it can't for some reason! Gah!)

GoddersUK
GoddersUK
I CAN has cheezburger and you CAN'T has stop me!

Firefox/Ch9 does that to me with a security dialgoue Sad

 

Granted that is Firefox's fault, not 9's.

stevo_
stevo_
Human after all

Meh, I'd rather not muddle in more behavioral complications.. windows needs to work on enforcing that windows cannot arbitrarily steal focus.. if something needs my attention then it can flash in the taskbar, or it it REALLY has to, show a window that doesn't steal focus (like the balloon hints).

Apps already have to call the AllowSetForegroundWindow API to say they're happy for the focus to be taken by another process. It's not perfect but it's a huge improvement over the days of Windows 95.

 

However, it doesn't always work, even when apps aren't deliberately bypassing the mechanism. I don't think any of the apps I use bypass it on purpose; in fact they tend to go out of their way not to take the focus, but it does still happen sometimes for whatever reasons.

 

(As for apps which do deliberately bypass the mechanism, I think it'd be very hard to completely stop them without a redesign of the desktop, process isolation, etc.. It's a cat & mouse game at best.)

 

I think one of the problems is where you have multithreaded (or simply multi-window) apps which "take the focus" from different parts of themselves. Their process already has the focus so another part of it can take it, even though to the user the two parts of the program are like separate things. That's something app developers can improve but it's not trivial to find all the places where it can happen and fix them.

 

page 1 of 2
Comments: 27 | Views: 689
Microsoft Communities