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 --------------------
"""
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
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)