'Return current client with focus, if any'

def get_focus_client(self):

    widget = QApplication.focusWidget()
    for client in self.get_clients():
        if ((widget is client) or (widget is client.get_control())):
            return client
