Comment out the icon code and check if you are getting the proper top level application windows first.