refactor desktop window management; added event handling to refresh
windows;