Brad
Brad

Reputation: 1207

Windows App Focus: Why does it require a click?

When I have 2 apps open and one has the focus but I want to execute a command in the other app, it requires a click to regain focus and another to execute the command. Is there some good reason why I couldn't take focus on MouseOver? I'm working with a WPF app if that is pertinent. TIA

EDIT: Oddly enough the MouseOvers work without focus.

Upvotes: 2

Views: 1506

Answers (3)

Sam Harwell
Sam Harwell

Reputation: 99869

The setting is configurable at a system-wide level. You should never ever override the user's current setting regarding this.

MS Windows Vista -- focus follows mouse (There's also a link on how to do it on XP.)

Edit: Normally, you can click a button on a form and both bring focus to the window and click it at the same time. The origins of the current setting "eating" the initial mouse click that brings focus to a window started as a fix to a bug in the Ribbon UI. The discussion is somewhere in this video: The Story of the Ribbon. Sorry I can't narrow it down more than that, but at least the video is a great insight and work watching - maybe you can send a message to Jensen Harris if you need a faster answer.

Edit 2: I just added a button to a WPF window, and I'm able to click it as long as I can see it - whether or not the window has focus.

Upvotes: 4

Reed Copsey
Reed Copsey

Reputation: 564413

I would not recommend doing this. This is not a standard way of working in Windows, so you will confuse your users. People are used to clicking into an application (or tabbing) to provide focus.

However, this is a configurable setting via the Accessability Tools in Windows. It can be enabled by choosing "Activate a window by hovering over it with the mouse" globally. Let your users specify this behavior if they want it.

Upvotes: 4

Ilya Khaprov
Ilya Khaprov

Reputation: 2524

You can take focus on MouseOver manually

Upvotes: 0

Related Questions