Exemplo n.º 1
0
    def untile(self):
        if self.alternate is None:
            return

        self.alternate.remove_all()
        self.alternate = None

        if focus.focused():
            focus.focused().stack_raise()
Exemplo n.º 2
0
    def untile(self):
        if self.alternate is None:
            return

        self.alternate.remove_all()
        self.alternate = None

        if focus.focused():
            focus.focused().stack_raise()
Exemplo n.º 3
0
    def _get_focused_leaf(self):
        focused = focus.focused()
        for leaf in self.root.childs():
            if leaf.client is focused:
                return leaf

        return None
Exemplo n.º 4
0
    def _get_focused_leaf(self):
        focused = focus.focused()
        for leaf in self.root.childs():
            if leaf.client is focused:
                return leaf

        return None
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    def attention_stop(self):
        if not self.is_in_timeout():
            return

        self.stop_timeout()

        if self is focus.focused():
            self.focused()
        else:
            self.unfocused()
Exemplo n.º 7
0
    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
Exemplo n.º 8
0
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))
Exemplo n.º 9
0
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))
Exemplo n.º 10
0
    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
Exemplo n.º 11
0
    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()
Exemplo n.º 12
0
    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
Exemplo n.º 13
0
    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
Exemplo n.º 14
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()
Exemplo n.º 15
0
    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()
Exemplo n.º 16
0
    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'])
Exemplo n.º 17
0
    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'])
Exemplo n.º 18
0
 def _with_layout():
     client = focus.focused()
     if client is not None:
         layout = client.layout()
         if hasattr(layout, meth_name):
             getattr(layout, meth_name)()
Exemplo n.º 19
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         if hasattr(client, meth_name):
             getattr(client, meth_name)()
Exemplo n.º 20
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         fun(client)
Exemplo n.º 21
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         fun(client)
Exemplo n.º 22
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         if hasattr(client, meth_name):
             getattr(client, meth_name)()
Exemplo n.º 23
0
 def _with_layout():
     client = focus.focused()
     if client is not None:
         layout = client.layout()
         if hasattr(layout, meth_name):
             getattr(layout, meth_name)()