X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=scripts%2Fcycle.py;h=308c8c8c61873330aa1eae84f2f803e09f5332c4;hb=d2adccbe2880e7d5b2cb39d833877cfddeff11f4;hp=fbae810b66f66dc4d38fbecdc1e583d51d168f7b;hpb=31d41a7aa60b06caea77d2c20af48e5c54eed600;p=chaz%2Fopenbox diff --git a/scripts/cycle.py b/scripts/cycle.py index fbae810b..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)