Google Chrome: Always On Top Bug

15

5

Sorry for the vague title but this one is hard to explain so bear with me please.

I'm using Windows Vista at work for web development and sometimes when I Click or Alt-Tab to background window, the window will get focus but it will not be brought to the front.

In order to bring the window to the front, I have to click on the applications border (when the resize cursor appears) and the window will then jump to the front.

I've had this problem for about a year now and it happens at least a dozen times a day, but it doesn't do this all the time - seems random.

I hope I have explained the issue fully (and you've understood it) and would appreciate any constructive answers or comments to solve this problem.

Example: If I Alt-Tab from Google Chrome to Notepad and this problem randomly occurs, Google Chrome will remain in front of Notepad, however, I will be able to type text into Notepad while the window is behind Google Chrome. Clicking on Notepad's content area will not bring it to the front but clicking it's window border will.

Video Exampe

http://vimeo.com/19388998

In this video, I clicked from Google Chome to UltraEdit and chrome stayed in font, but as you can see, I can still type in UltraEdit.

I'm starting to believe that this could be a bug in Google Chrome so I'll continue to watch if this between other applications.

GateKiller

Posted 2011-01-28T16:08:46.703

Reputation: 347

Could you set your computer to a lower resolution (HD 720p or less) and upload a video that shows the problem using Jing. Furthermore, try disabling applications that automatically start with Autoruns and ShellExView to see if an idle program or explorer extension is causing this behavior, watch out what you disable though...

– Tamara Wijsman – 2011-01-31T00:51:29.820

Does it happen when you have a certain application open in front and try to alt tab from that? It could be a case that that window has been set to always be on top. I had this issue for a little while when my mIRC window was set to always be on top. – Windos – 2011-01-31T00:55:37.663

I encounter this problem too (using Windows 7). While I don't exactly know the nature of the problem, I think it happens when I have my Web browser opened and there's a flash content on one of the Web sites I got opened. Having said that though, I can't seem to replicate it. – happy_soil – 2011-01-31T03:00:33.013

Now that I think of it, I got some programs running in the background that are set as "Always on Top", so I think that might be interfering with the window focusing. – happy_soil – 2011-01-31T03:02:14.137

@happy_soil: You might put this up as an answer. A running "Always on Top" window is a good explanation for this behavior. – harrymc – 2011-01-31T08:42:33.073

Thanks for the comments. If it happens today I'll quickly record and upload. @happy_soil: I think it might be when switching between my web browser(chrome) and other windows. I'll make a note each time it happens. @harrymc: I don't think it has anything to do with "Always on Top" since none of my windows are on top, they are normal windows so to speak. – GateKiller – 2011-01-31T11:43:39.033

@harrymc Notifying you of GateKiller's comment. GateKiller: Only one user (the first mentioned) is notified of a comment. – Daniel Beck – 2011-01-31T11:49:26.920

@Daniel Beck: Thanks. Remarking also that the poster is always advised of all comments everywhere. – harrymc – 2011-01-31T12:12:50.787

BTW, does this happen only on Chrome? – happy_soil – 2011-01-31T14:10:45.927

I've now added a video http://vimeo.com/19388998 showing this problem.

– GateKiller – 2011-01-31T14:32:32.827

@happy_soil Currently unknown. – GateKiller – 2011-01-31T14:32:50.283

Answers

6

In the case of Chrome, this is a known issue : Chrome window always-on-top behavior

A quick fix for this problem is to select the Chrome Window and press F11 twice.

harrymc

Posted 2011-01-28T16:08:46.703

Reputation: 306 093

1I am on Windows 10. This problem is still there, and F11 twice does not work either. – Rosdi – 2015-10-06T03:57:42.137

Thanks for the link the this bug, however, it isn't the issue I am having. My problem is related to application windows and not the taskbar. I cannot confirm at this stage if it is Chrome causing this issue or not. – GateKiller – 2011-01-31T13:37:44.613

I'm sorry if that previous comment sounded rude. It wasn't my intention. I do appreciate your input :) – GateKiller – 2011-01-31T13:41:47.100

This bug apparently affects both alt-tab and the taskbar. The initial bug report was for the taskbar, but comment 41 also noted its effect upon alt-tab. (and your comment didn't sound rude at all.) – harrymc – 2011-01-31T13:46:30.347

After further reading and testing I agree that Google Chrome for Windows is indeed the problem. I have added workarounds to your answer while we wait for Google to fix the issue. – GateKiller – 2011-02-01T11:56:27.933

I highly doubt that these 10 issue reports will be fixed as it dates back from Version 2.0.* in May 16, 2009; and there is no way to reproduce it nor is the source of the problem find. If you want it fixed instead of pressing F11 twice every time you might want to look into more troubleshooting and a solution... – Tamara Wijsman – 2011-02-01T14:54:16.263

4

To disable this you have to hit

ALT + Space + C

alt+space+c

After pressing these buttons Google chrome browser will close automatically. Then start again the Google chrome browser.

The problem will be solve for ever :)

Firefog

Posted 2011-01-28T16:08:46.703

Reputation: 141

ALT + Space + C closed my browser and fixed the problem. I had to come back here to upvote your answer. – Oscar Fraxedas – 2018-04-24T15:23:56.810

1This is the only thing that solved my issue. – ddonche – 2019-08-10T03:24:20.303

4

What does it look like?

There is only one behavior close to that problem and that would be the Always On Top behavior.
Some piece of code, perhaps from the program itself might be changing the property of your window...

How is a window set to be "Always On Top"?

How To Create a Form That Always Stays on Top shows us that SetWindowPos is called with the second parameter set to HWND_TOPMOST, this immediately places it on top and keeps it that way.

After a quick Google, this result reveals User32.dll to be the owner of this function.

Who sets my window "Always On Top"?

Now that we have the knowledge what function is called, we will want to know when that function is called. This will require us to make stack traces and analyze them, while Windows Performance Toolkit can do this we can be very happy that Rohitab Batra has written the awesome Api Monitor.

Sorry, but this is hard homework:

  • Download API Monitor and install it.
  • Open API Monitor as an administrator, if you have 64 bit, you need to do this twice.
  • Make sure that nothing is checked in API Capture Filter at the left side.
  • In the same place, change All Modules at the top of that Dialog to User32.dll.
  • Go to

    Windows Application UI Development > Windows and Messages > Windows
    

    and then

    User32.dll > SetWindowPos
    

Now, you will want to hook some processes. Word of caution: Sort by PID and do not hook into winlogon.exe or anything that has a lower PID than that, if you do so you will either hang or crash your system. You might experience this behavior with other processes too, but it's kind of like a trial and error to see which ones you can hook. So:

  • Sort by PID, and hook everything that's newer than winlogon.exe.
  • If everything goes well, you can look through the threads in the Hooked Process dialog.
  • Look for an API call that looks like this:

    SetWindowPos ( 0x000000000002043c, HWND_BOTTOM | 0x00000000fffffffe, 0, 0, 0, 0,
    SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE )

A call to SetWindowPos with HWND_BOTTOM | 0x00000000fffffffe (-2 + 1 = -1 = HWND_TOPMOST) is what we are after and the process that does this call is the one you should blame for your problem.

I give up... How can I remedy my "Always On Top" problem?

Battle fire with fire, we're going to set all windows to HWND_NOTOPMOST.

Yikes, programming! But, this can easily be done through scripting too...

So a very simple homework task:

  • Download AutoIt v3.

  • Create a ByeByeTopMost.au3 file that contains:

    While 1
        $var = WinList()
    
        For $i = 1 to $var[0][0]
            WinSetOnTop($var[$i][1], "", 0)
        Next
    
        Sleep(5000)
    WEnd
    
  • Place it in your start-up folder and run it or reboot.

Or if you don't like homework at all, download this zip file I made.

Have fun... :-)

PS: You can't use the "Always On Top" feature in this last case. Either troubleshoot or work-around... ;-)

Tamara Wijsman

Posted 2011-01-28T16:08:46.703

Reputation: 54 163

I like this answer. – Supercereal – 2011-01-31T23:39:01.823

SetWindowPos is not firing when the problem occurs... I also find it highly offensive that you rename the question completely and then write an answer for it. – GateKiller – 2011-02-01T11:21:15.857

1@GateKiller: How is that offensive? It helps you toward receiving better answers. It's also a more proper description of your problem (as "windows in front" is commonly known as "always-on-top") and now you have changed your title to Google Chrome after receiving answers. Anyhow, you're always free to rollback and I'm glad you had your problem resolved, furthermore SetWindowPos would fire before the problem occurs or another similar procedure that has the same effect could be called... :-) – Tamara Wijsman – 2011-02-01T14:49:20.013

1

Got this problem too and find a way to circumvent it. I've installed "Always on Top" software.

And I use it on Chrome for Windows, which changed the state of the property alwaysontop.

Jaime Alves

Posted 2011-01-28T16:08:46.703

Reputation: 11

0

Well I had the same problem, and double tapping F11 didn't resolve anything. But I saw, since I had two Google Chrome windows open, that only one of them was on top of every other window I had (Steam, Notepad, etc). I then took one of the always on top tabs and made a new window with it and then took every other tab from the top window to the new one. Now every window appears on top when I select it, like normal.

Hope this can help :)

Heltsuki

Posted 2011-01-28T16:08:46.703

Reputation: 1

0

One quick fix is to click on 'show desktop' button twice on the very right side of the taskbar on windows 7/8/8.1

Vnay

Posted 2011-01-28T16:08:46.703

Reputation: 1

1As written, your answer provides very little useful information. Can you expand it on a bit? – bwDraco – 2014-11-30T20:09:26.807

0

I had this same problem and managed to fix it by going to "Switch User" in the Start menu and after logging back in the windows respected the toolbar again. It seemed to affect all windows and while chrome might be a cause, it definitely seemed to affect Windows system wide, suggesting a possible culprit from within Windows itself. Making this post after my first run-in with the issue after being a Chrome user for 5 years on both Windows XP & 7.

Leviscus Tempris

Posted 2011-01-28T16:08:46.703

Reputation: 101

-3

Open Chrome and press ALT + Space + C

Gustavo

Posted 2011-01-28T16:08:46.703

Reputation: 11

3The OP isn't asking how to close their Chrome window. – Anthony Geoghegan – 2015-05-20T15:37:39.517