コード例 #1
0
ファイル: workspace.py プロジェクト: BurntSushi/pyndow
    def untile(self):
        if self.alternate is None:
            return

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

        if focus.focused():
            focus.focused().stack_raise()
コード例 #2
0
ファイル: workspace.py プロジェクト: sahwar/pyndow
    def untile(self):
        if self.alternate is None:
            return

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

        if focus.focused():
            focus.focused().stack_raise()
コード例 #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
コード例 #4
0
ファイル: tile.py プロジェクト: BurntSushi/pyndow
    def _get_focused_leaf(self):
        focused = focus.focused()
        for leaf in self.root.childs():
            if leaf.client is focused:
                return leaf

        return None
コード例 #5
0
ファイル: client.py プロジェクト: sahwar/pyndow
    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)
コード例 #6
0
ファイル: client.py プロジェクト: sahwar/pyndow
    def attention_stop(self):
        if not self.is_in_timeout():
            return

        self.stop_timeout()

        if self is focus.focused():
            self.focused()
        else:
            self.unfocused()
コード例 #7
0
ファイル: tile.py プロジェクト: BurntSushi/pyndow
    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
コード例 #8
0
ファイル: workspace.py プロジェクト: sahwar/pyndow
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))
コード例 #9
0
ファイル: workspace.py プロジェクト: BurntSushi/pyndow
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))
コード例 #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
コード例 #11
0
ファイル: workspace.py プロジェクト: BurntSushi/pyndow
    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()
コード例 #12
0
ファイル: tile.py プロジェクト: BurntSushi/pyndow
    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
コード例 #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
コード例 #14
0
ファイル: client.py プロジェクト: sahwar/pyndow
    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()
コード例 #15
0
ファイル: workspace.py プロジェクト: sahwar/pyndow
    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()
コード例 #16
0
ファイル: __init__.py プロジェクト: BurntSushi/pyndow
    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'])
コード例 #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'])
コード例 #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)()
コード例 #19
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         if hasattr(client, meth_name):
             getattr(client, meth_name)()
コード例 #20
0
 def _with_focused():
     client = focus.focused()
     if client is not None:
         fun(client)
コード例 #21
0
ファイル: keybind.py プロジェクト: BurntSushi/pyndow
 def _with_focused():
     client = focus.focused()
     if client is not None:
         fun(client)
コード例 #22
0
ファイル: keybind.py プロジェクト: BurntSushi/pyndow
 def _with_focused():
     client = focus.focused()
     if client is not None:
         if hasattr(client, meth_name):
             getattr(client, meth_name)()
コード例 #23
0
ファイル: keybind.py プロジェクト: BurntSushi/pyndow
 def _with_layout():
     client = focus.focused()
     if client is not None:
         layout = client.layout()
         if hasattr(layout, meth_name):
             getattr(layout, meth_name)()