X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fcycle.py;h=308c8c8c61873330aa1eae84f2f803e09f5332c4;hb=d2adccbe2880e7d5b2cb39d833877cfddeff11f4;hp=6165afab06c2d95b096980082636aca4ba3f4183;hpb=671230f83e05bc0f60abd42cac0735657ff90ed6;p=chaz%2Fopenbox diff --git a/scripts/cycle.py b/scripts/cycle.py index 6165afab..308c8c8c 100644 --- a/scripts/cycle.py +++ b/scripts/cycle.py @@ -230,16 +230,10 @@ class _Cycle: def next(self, data): """Focus the next window.""" - if not data.state: - raise RuntimeError("next must be bound to a key" + - "combination with at least one modifier") self.cycle(data, 1) def previous(self, data): """Focus the previous window.""" - if not data.state: - raise RuntimeError("previous must be bound to a key" + - "combination with at least one modifier") self.cycle(data, 0) #---------------------- Window Cycling -------------------- @@ -248,9 +242,9 @@ class _CycleWindows(_Cycle): """ This is a basic cycling class for Windows. - An example of inheriting from and modifying this class is _ClassCycleWindows, - which allows users to cycle around windows of a certain application - name/class only. + An example of inheriting from and modifying this class is + _ClassCycleWindows, which allows users to cycle around windows of a certain + application name/class only. This class has an underscored name because I use the singleton pattern (so CycleWindows is an actual instance of this class). This doesn't have @@ -413,8 +407,7 @@ class _CycleWindowsLinear(_CycleWindows): def populateItems(self): # get the list of clients, keeping iconic windows at the bottom iconic_clients = [] - for i in range(self.screen.clientCount()): - c = self.screen.client(i) + for c in self.screen.clients: if self.shouldAdd(c): self.items.append(c) @@ -455,8 +448,6 @@ class _CycleDesktops(_Cycle): def __eq__(self, other): return other.index == self.index - START_WITH_NEXT = 0 - def __init__(self): _Cycle.__init__(self)