def __init__(self, name, doc, cycle): Action.__init__(self, name=name, doc=doc, filter=TYPE_FILTER, unshade=False) self.cycle = cycle
def __call__(self, win, **kwargs): active_win = WM.active_window() if not win == active_win: # TODO: What about 'switch win1' from some dbus client window? self.__from_win_id = active_win.id if self.__from_win_id: WM.unregister(self.__handler) Action.__call__(self, win) else: self.__from_win_id = win.id WM.register(self.__handler)
def __init__(self, name, doc, keep_active): Action.__init__(self, name=name, doc=doc, filter=TYPE_FILTER) self.args = ['window'] self.keep_active = keep_active self.__handler = ActiveChangedEventHandler(self) self.__from_win_id = 0