Author
Topic: Back again: focus flicker ... (Read 4523 times)

Seems as though Ive been asking a lot of questions lately. Prolly 'cause I have.

I've been dealing with this for a while, now. However, what was a minor annoyance has become a major irritant.

I've been researching this for several months, but while I've found something like 1,110,000+ references - up by ~8,000 since last week or so - none of them seem to apply.

The problem is that when I change focus from one window to another, the focus doesn't stick. It flickers from the selected window to another. This can be a back-and-forth process, sometimes just once back and forth, sometimes as many as ten times, possibly greater. Of the referenced million-plus pages, once I filter out Ford Focus, Logitech drivers, and other such kinda, sorta false positives, there are still more pages than I can begin to peruse in what's left of this year, much less in the next few weeks.

While this was not a serious problem before, now that I'm contracting again, there are several downsides that are not tenable.

One of 'em is that when I switch from, say, PHP to CSS IDEs, what I start typing may not end up in the right IDE . 'Nother one is that when I work with a DVCS, I can't always depend upon the commands going to the right place.

The OS is 36-bit Win7 on a dual-core 2.8 GHz processor, 3G Ram, mucho disk space available. Don't think this started with Win7, may have started with installation of Google's Chrome, but I think it was later. Think I first noticed it after installing Prism HUD, a system resource monitor, but it doesn't seem attributable to Prism HUD.

Oh, yeah ... the focus doesn't always switch back to the window I was in ... sometimes it flickers from the window I'm in to I wot not what.

Frankly, I'm at a loss to 'splain it. I can, if I'm careful - and abominably slow - work with it, but I'd much rather work without it.

@barney: I had a similar - though not identical - problem (running Windows XP SP3 on a laptop with a Centrino Duo processor). Some applications were trying to "steal focus" or priority in the User Interface.I don't know what caused it - it just started to happen one day - but I fixed it with Tweak UI - which is a component of the Microsoft PowerToys for Windows XP.You can download the separate Power Toys (e.g., such as Tweak UI) from here: http://www.microsoft...oys/Xppowertoys.mspx

Steps: 1. Install and then start up Tweak UI. 2. Click to expand the "General" branch on the tree in the LHS of the Tweak UI control box. 3. Click on the "Focus" branch on the tree. 4. Play with the settings to "Prevent applications from stealing focus".

I think it changes settings in the registry. I don't know where the settings are or what they are.You may need to do a user logoff and on again, or reboot, when changing Tweak UI settings, before they affect your system.Anyway, it worked for me. Hope it helps you.I'd be interested in your feedback on this, if you try it.You may have to go back and repeat these steps if something (some program or other) keeps persistently changing the settings back in your registry.

@mouser, I've stripped Win7 nude, for all practical purposes, but still have the issue.@IanB, I cannot seem to find a tweak system for Win7 that allows the things I remember doing with XP.

I've check several forae that mentioned nVidia as a possible cause, but none of the fixes published were viable. Same thing with various Logitech boards, even though I don't use Logitech drivers, 'cause sometimes a solution will not be related to the board it's on. I've tried several TweakUI variants supposedly for Win7, but have yet to find one that is even close to comprehensive. Even tried the XP version, with mixed results, but nothing has addressed this problem to date. As I said, I've been working with this, off and on, for a while, to the point that I'll accept, or at least try, just about any left-field suggestion. Not quite ready to dance naked under a full moon with esoteric symbols painted on my body, but if I thought it would help ...

Frequently, when I call forth a window that is system/application modal, e.g., a configuration window, it will draw onscreen, then immediately move behind the application from which I called it. Now I cannot grab the title bar and move the application because the other window is modal, but cannot bring the other window to the fore since is smaller than, and covered by, the application window. Sometimes I can switch to another window, then use the task bar icon to move back to the application in question - the modal window appears and stays on top. Other times, I have to use a task manager tool to abort the application, then restart it. If the called window is truly system modal, the latter course of action is the only viable one.

Video acceleration properties haven't seemed to have any affect one way or the other.

Yep, title bar changes color - but that doesn't always mean another title bar changes color to show getting focus.

Reliably reproduce? Not exactly. I never know when it will happen, but it happens often enough that I think I could say it reliably reproduces itself .

The flicker is not always from one visible window to another ... at times the only visible evidence, other than typing glitches, is the alternating color of the title bar of the window I'm trying to use. And I think I've seen that alternating title bar at times when I was not actively using a window, but I cannot be certain of that.

I've checked the event logs to see if anything would jump out and slap me, but have found nothing glaring to date.

@barney: In my comment above, I made the implicit assumption that the focus flickering was governed by the system registry, but I suppose that it could be governed by the video graphics processor settings or process priority (or maybe a mixture of these?).

I Googled "steal focus in Windows 7" and came up with lots of items. It's evidently a problem for some Windows 7 users, and the usual fixes seem to be to change the registry settings or the video graphics processor settings. Some of the articles try to con you into running some dubious free "This'll Fix IT" PC tuning software (I wouldn't touch 'em with a bargepole), but there are some useful tips as well.

In case you have not already seen this particular tip, I have copied below from a post by mirandalee at sevenforums.com, here.

Windows 7 - window focus issues (windows 7 pro x64)1. Open Start >> Run and type regedit2. Navigate to the following path:[HKEY_CURRENT_USER\Control Panel\Desktop]3. Modify the existing value named ‘ForegroundLockTimeout’, modify the value to 0. (this value will cause the application to take the focus instantly.)4. Exit everything and restart Windows and hopefully it fixes your focus problem like it did for me.

However, if the above assumption (that the focus flickering was governed by the system registry) is wrong, and if you have drawn a blank with that anyway and with tweaking the video graphics processor settings, then that could leave the process priorities as being worthy of checking. They might, I suppose, somehow be fluctuating, resulting in priority interrupts as the priorities of different processes change. Or maybe a hardware interrupt? The only tool I use for monitoring stuff like that is Microsoft Sysinternals' Process Explorer. You could test whether process priority was a factor by setting the process priorities using Process Explorer or DonationCoder's ProcessTamer (it's a really useful tool) and observing the results in Process Explorer and by checking the behaviour of focus in the process windows.

Sorry to be so dilatory in responding ... slight medical emergency, ER visit(s), mostly age-related junk, kinda got in the way. Funny, but ERs aren't too wild ab. having a laptop in use <sigh />. And it was a no-no in the room, as well.

OK, back to the flicker.

Flicker may occur once, twice, or many times - as high as ten, so far - and while it usually flickers back to the previous focus, that is not always the case. In a significant number of instances, there was no visual evidence of the element that grabbed the focus. When flicker occurs, it can actually interrupt a pre-copy (mouse drag) highlighting in progress - ! - as well as affect keyboard input. I've pretty much given up on a cure, save through serendipity. However, I will continue to post [new] symptoms as they occur. Will also post a resolution should one evince itself - not hopeful, though.