"Show Desktop" sometimes sets a window to "always on top"

No worries, not another "where is my show desktop button gone" question.

What I found under Windows 7, when you use the "Show Desktop" feature (I prefer the ⊞ Win + D shortcut) and then bring all windows back by using it again, some windows behave as if they're glued to the front of the z-order. What this means is, say, I have windows A B and C open, with focus on A, hit ⊞ Win + D twice, and now it may happen that if I then want to switch to B or C, either by Alt+Tab or by selecting them on the taskbar, the taskbar shows the highlight, but A stays visible (and usable, it's not just a rendering issue) in the foreground.

Imagine the following situations, all three windows cascading and overlapping:

A (focus)
B
C

-> ⊞ Win + D

Desktop (focus)

-> ⊞ Win + D

A (focus)
B
C

-> click C on taskbar

A
C (focus)
B

-> click B on taskbar

A
B (focus)
C

And so on. Focus means actual input focus, i.e. in second situation, any keyboard typing is sent to window B while window A is in the foreground.

It does not matter what kind of application; in my current case an instance of Outlook and an instance of Explorer is stuck, while a second instance of Explorer and an instance of Firefox behave normally. This should show that this problem can occur even between multiple instances of the same application, and that there are no fancy applications involved that like to pretend they are the most important program and internally force "always on top".

Showing and unshowing the desktop again doesn't help; in the worst case another window might end up with the "glued to the top of the z-order" too. Between those, I can easily switch, but in order to get a window which still behaves normally on top, I have to manually minimize the offending windows.

The only cure seems to close the offending windows so far, I've not found anything else that helps.

Could it be that Windows 7 has a bug that can force an ALWAYS_ON_TOP flag onto some windows when restoring from "Show Desktop", or am I doing something wrong?

More information:

⊞ Win+d issue easy to replicate on Win7-64bit-Ultimate.

The affected windows (of any program) seem to be placed into a separate "Z" group. You can place multiple/many windows into this always-on-top state, those in the affected state will function normally in relation to each other with the exception that:

  • The group as a whole is always-on-top of any non-affected window
  • The whole group is in front of the taskbar.
  • The whole group does not respond to (context on taskbar) "cascade windows" or similar commands.

The fact that the affected windows are on top of the taskbar and otherwise function as "special windows" shows that windows 7 must have a hidden "feature" of always-on-top that gets applied with the show desktop function. The feature appears to place windows in a super window state that is on top of the taskbar (the normal group remaining behind the taskbar). When you click the start menu or context menu of the taskbar, the start menu/taskbar comes to the foreground of the always-on-top group, however this does not revert the affected windows, only a temporary takeover until you switch to something other than the start menu/taskbar.

This is key to finding an answer. How do we get windows to unassign the special super status or not do the assignment in the first place?

Even More info from another user: It appeared to have cleared by closing all windows and restarting. Initially I could not reproduce the error, then after opening all my working windows, I did indeed reproduce it on any window.

I almost think it could be initialized with something to do with multiple windows of Chrome, and then the show desktop problem will crop up once one window has it. This was because: After messing around some more with a chrome session saver (session buddy) and restoring sessions and getting the super state, I restored and closed the window I was in and now I am again at a place where I can not reproduce the error, even in my "work environment" with some 35 chrome tabs in two windows, plus other programs, file locations, remote desktops and a second chrome profile with another dozen tabs.

So, back to square one with finding the actual instigator of the super state phenomenon.

Once you actually have the super sate issue, the following will reproduce: Ok, I am doing this as I type it:

Open chrome (to view this website), then Notepad, then Calculator, (could be any windows, but for the purpose of demonstration, follow along with me)

The windows should function normally, overlap your windows so that you can see the edge of all windows and the Z-order is (from front to back):the browser on top, then the calculator, then Notepad (you should be able to see part of the background windows).

Now, with the browser on top, press win+d, then win+d again.

Click on Calculator, then your browser, your browser is now stuck in the foreground. Clicking on notepad will bring the focus to notepad, and it will be in front of the calculator, yet it will stay behind the browser, as your browser is in "super state". (many arrangements of switching focus after returning from win+d will create the problem, with the exeption of clicking the desktop, I also noticed that I could not get calculator into super state unless it overlapped my chrome browser).

Again, this does not seem to work until at least one of your windows is affected.

We still do not know how to get the initial window into Superstate, only subsequent ones.


Recently experienced this issue. Unsure how it started, but I was able to put windows to this "super window" state with ⊞ win + d twice and clicking on a different window. I was going to try the Ctrl + Shift + Esc shortcut to open the Task Manager but hit Ctrl + Alt + Esc instead and the window returned to the normal state. I was able to successfully return all windows to their normal state using the key sequence on each window and ⊞ win + d no longer puts windows to the "super window" state. Hope this helps.


Two work arounds:

I use win+D. Issue easy to replicate, Win7-64bit-Ultimate.

Workaround One Elevate all windows to the superstate so that they interact normally with one another. The problem with this work around is that new windows will still open behind all of your super state windows, which can be very annoying to try to find if you have many windows and/or many monitors.

Workaround Two The other semi-solution is to close the process and open it back up. The new window will be in the normal state it but the issue can recur if I use Win+d, which can lead to a lot of closing and reopening dozens of windows to avoid the issue.


I use "Show Desktop" as a mouse-button command and have noticed the same thing you are experiencing. On occasion, certain windows, when focused upon while pressing the "Show Desktop" button, and then after pressing the "Show Desktop" button again and executing the reverse command, will behave as 'always on top' windows.

I've noticed it with Internet Explorer, Windows Explorer, and OUtlook. I'm running Windows 7, Ultimate, x64. No solution but to close and reopen the window for me either.

I'm interested, though, in intentionally executing this command without third party software running from the system tray.

EDIT 9/29/11

In furtherance to my original comment, I have found a solution/workaround for this issue - but this solution is specific to my system because I use UltraMon and you would have to install that program for this to work for you. In addition, it has to be UltraMon version 3.1.0 or later. After downloading and installing the software, go to http://www.realtimesoft.com/ultramon/scripts/ and download the "Always on Top" script. It's a .vbs file that performs this function:

_Set wnd = CreateObject("UltraMon.Window")
If wnd.GetForegroundWindow() = True Then
    If wnd.AlwaysOnTop = True Then
        wnd.AlwaysOnTop = False
    Else
        wnd.AlwaysOnTop = True
    End If
    wnd.ApplyChanges 0
End If_

Then open up UltraMon Options and go to the Hotkeys tab and select "Run application or script" and click on Add Hotkey. A modal dialog box will open where you should enter the keyboard prompt (combination) you want to use, target to the script we downloaded earlier, and then click ok. Now you've got a hotkey combination that will toggle between enable and disable for the Always_on_Top value. So when the bug occurs while you're Showing Desktop or Undoing Show Desktop, we now have a quick keyboard fix. And like I commented above, if you want windows to be forced to the front intentionally, which can be helpful at times, you now have the option to do that as well.

This works for me because I keep UltraMon open at all times. It's a great program, but a lot of the features were already covered by my video card, so I was considering removing it altogether, but now it's ensured it's place on my computer with this valubale feature.

And if anyone has any insight on the script above and whether it can be applied to an active window without the need for Ultramon to be loaded, please feel free to contribute to my answer. Thanks.


There's actually an old program that can fix this issue, I just couldn't recall the name of it until now. It's a utility from back in the day called WinExplorer, by Nirsoft. It has an option, under the Size & Position tab, called "Set To No Topmost" that will remove the "always on top" behavior from a window. I've just used it on Windows 7 to fix the very problem described above, where "Show Desktop" messes things up. It's still available here: http://www.nirsoft.net/utils/winexp.html


I know it's been almost 8 years, but if I'm still struggling with this problem in windows 10, certainly there are more people facing this issue in 2019.

Apparently it has something to do with a window style called "WS_MINIMIZEBOX" being enabled on windows always on top. I think it causes some sort of bug or something like. The way I was able to workaround this issue was using a program called AutoHotkey (great program by the way) and creating a "Always on Top" functionality that makes the window on top and also disables this "WS_MINIMIZEBOX".

In another words, instead of you guys using the original always on top function of wherever program you are using – let's say you are using media player classic, instead of using the always on top function inside the media player classic software – you will use this script to make the desired window to be always on top. I set the hotkey as windows+a (if you want to change the shortcut for something more suitable to your needs, just take a look the Key List on AutoHotkey's site, it's super simple to change and you can set practically any key combinations you wish). Here's my script, just save it in a text file and then change the file format to .ahk

The only hurtle with my solution is that you lose the ability of minimizing that window until you close it again. But, I assume that if you are working with a window always on top you probably don't want to minimize it. Also, although you can't minimize you can remove the always on top option, just by pressing windows+a again, so if you don't want to see a window always on top anymore just press it again. I'm sure that are more elegant/functional ways to deal with this issue, but that is what I was able to come up with.

;Better Always on Top
count = 1
#a::
If count = 1
{
WinSet, Style, -0x20000, A
Winset, Alwaysontop, , A
return
}
Else If count = 2
{
WinSet, Style, ^0x20000, Off ;WS_MINIMIZEBOX
Winset, Alwaysontop, Off
return
}
Return