Added a method to reset the desktop of a window.

There are also a few additional tests to ensure that this functionality
works.