code: def wait_for_exist(self, title, timeOut=5):
          
          regex = re.compile(title)
          waited = 0
          while waited <= timeOut:
              retCode, output = self._run_wmctrl(["-l"])
              for line in output.split('\n'):
                  if regex.match(line[14:].split(' ', 1)[-1]):
                      return True
                      
              if timeOut == 0:
                  break  # zero length timeout, if not matched go straight to end
  
              time.sleep(0.3)
              waited += 0.3
              
          return False
docs: Wait for window with the given title to be created
          
          Usage: C{window.wait_for_exist(title, timeOut=5)}
  
          If the window is in existence, returns True. Otherwise, returns False if
          the window has not been created by the time the timeout has elapsed.
          
          @param title: title to match against (as a regular expression)
          @param timeOut: period (seconds) to wait before giving up
          @rtype: boolean