code: def qteFocusChanged(self, old, new):
          
          # Do nothing if new is old.
          if old is new:
              return
  
          # If neither is None but both have the same top level
          # window then do nothing.
          if (old is not None) and (new is not None):
              if old.isActiveWindow() is new.isActiveWindow():
                  return
docs: Slot for Qt native focus-changed signal to notify Qtmacs if
          the window was switched.
  
          .. note: This method is work in progress.