code: def waitForFocusedWindowToChange(self, nextWinName, timeout=10):
          
          callback = AXCallbacks.returnElemCallback
          retelem = None
          return self.waitFor(timeout, 'AXFocusedWindowChanged',
                              AXTitle=nextWinName)
docs: Convenience method to wait for focused window to change
  
          Returns: Boolean