def untile(self): if self.alternate is None: return self.alternate.remove_all() self.alternate = None if focus.focused(): focus.focused().stack_raise()
def _get_focused_leaf(self): focused = focus.focused() for leaf in self.root.childs(): if leaf.client is focused: return leaf return None
def toggle_catchall(self): if frame.State.CatchAll not in self.frame.allowed_states: return self.catchall = not self.catchall if self is not focus.focused(): self.frame.set_state(frame.State.CatchAll if self. catchall else frame.State.Inactive)
def attention_stop(self): if not self.is_in_timeout(): return self.stop_timeout() if self is focus.focused(): self.focused() else: self.unfocused()
def _get_focused_section(self): focused = focus.focused() for leaf in self.master.childs(): if leaf.client is focused: return self.master for leaf in self.slave.childs(): if leaf.client is focused: return self.slave return None
def determine_focus(): client = focus.focused() if client: if client.workspace is not None: client.workspace.focused() else: geom = client.frame.parent.geom monitor_focus(monitor.which(geom['x'], geom['y'])) else: qp = state.core.QueryPointer(state.root).reply() monitor_focus(monitor.which(qp.root_x, qp.root_y))
def tile(self, layoutClass=None): if layoutClass is not None: self._add_layout(self._find_layout(layoutClass)) else: if not self.layouts: self._add_layout(self.cycle_lays[0]) self.alternate = self.layouts[-1] for client in self.floater.clients(): force_master = True if client is focus.focused() else False self.alternate.add(client, doplace=False, force_master=force_master) self.alternate.place()
def _get_focused_index(self, section): focused = focus.focused() if section is self.master: for i, leaf in enumerate(self.master.childs()): if leaf.client is focused: return i if section is self.slave: for i, leaf in enumerate(self.slave.childs()): if leaf.client is focused: return i return 0
def unmapped(self, light=False): icccm.set_wm_state(state.conn, self.win.id, icccm.State.Iconic, 0) fallback = focus.focused() is self self.frame.unmap() self.mapped = False self.update_struts() if not light: if fallback: focus.fallback() self.workspace.hide_client(self) state.conn.flush()
def __init__(self, client, parent): # Start activated? if focus.focused() == client: self.state = State.Active else: self.state = State.Inactive self.allowed_states = [State.Active, State.Inactive] self.client = client self.parent = parent or Parent(self) # State variables self.moving = None self.resizing = None if parent is None: state.conn.core.ReparentWindow(self.client.win.id, self.parent.id, self.pos['client']['x'], self.pos['client']['y']) else: parent.frame = self self.client.win.configure(x=self.pos['client']['x'], y=self.pos['client']['y'])
def _with_layout(): client = focus.focused() if client is not None: layout = client.layout() if hasattr(layout, meth_name): getattr(layout, meth_name)()
def _with_focused(): client = focus.focused() if client is not None: if hasattr(client, meth_name): getattr(client, meth_name)()
def _with_focused(): client = focus.focused() if client is not None: fun(client)