September 9th, 2004

Why isn’t the original window order always preserved when you undo a Show Desktop?

A commenter asked why the original window order is not always preserved when you undo a Show Desktop.

The answer is “Because the alternative is worse.”

Guaranteeing that the window order is restored can result in Explorer hanging.

When the windows are restored when you undo a Show Desktop, Explorer goes through and asks each window that it had minimized to restore itself. If each window is quick to respond, then the windows are restored and the order is preserved.

However, if there is a window that is slow to respond (or even hung), then it loses its chance and Explorer moves on to the next window in the list. That way, a hung window doesn’t cause Explorer to hang, too. But it does mean that the windows restore out of order.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.