コード例 #1
0
ファイル: workspace.py プロジェクト: sahwar/pyndow
 def focus(self):
     client = focus.focus_workspace(self)
     if client:
         client.focus()
     else:
         state.root_focus()
         self.focused()
コード例 #2
0
ファイル: workspace.py プロジェクト: BurntSushi/pyndow
 def focus(self):
     client = focus.focus_workspace(self)
     if client:
         client.focus()
     else:
         state.root_focus()
         self.focused()
コード例 #3
0
ファイル: focus.py プロジェクト: BurntSushi/pyndow
def fallback():
    def fallbackable(c):
        return (c.mapped
                and (c.workspace is None or workspace.current() == c.workspace))
    stck = [client for client in get_stack() if fallbackable(client)]

    # This is *really* important. On occasion, it seems that focus can stay
    # with a destroyed window. If this happens to be the last window, and
    # there is nothing left in the focus stack, we *must* fall back to the
    # root!
    if not stck:
        state.root_focus()
    else:
        client = stck[-1]

        # If the window isn't alive, pop the stack until we get a good window
        if client.is_alive():
            client.stack_raise()
            client.focus()
        else:
            remove(client)
            fallback()
コード例 #4
0
ファイル: focus.py プロジェクト: sahwar/pyndow
def fallback():
    def fallbackable(c):
        return (c.mapped and
                (c.workspace is None or workspace.current() == c.workspace))

    stck = [client for client in get_stack() if fallbackable(client)]

    # This is *really* important. On occasion, it seems that focus can stay
    # with a destroyed window. If this happens to be the last window, and
    # there is nothing left in the focus stack, we *must* fall back to the
    # root!
    if not stck:
        state.root_focus()
    else:
        client = stck[-1]

        # If the window isn't alive, pop the stack until we get a good window
        if client.is_alive():
            client.stack_raise()
            client.focus()
        else:
            remove(client)
            fallback()
コード例 #5
0
ファイル: __init__.py プロジェクト: BurntSushi/pyndow
 def activate(self):
     state.root_focus()
コード例 #6
0
events.register_callback(xproto.MappingNotifyEvent,
                         root.cb_MappingNotifyEvent, state.root)
events.register_callback(xproto.MapRequestEvent,
                         client.cb_MapRequestEvent, state.root)
events.register_callback(xproto.FocusInEvent,
                         client.cb_FocusInEvent, state.root)
events.register_callback(xproto.FocusOutEvent,
                         client.cb_FocusOutEvent, state.root)
events.register_callback(xproto.ConfigureRequestEvent,
                         window.cb_ConfigureRequestEvent, state.root)
events.register_callback(xproto.MotionNotifyEvent, grab.drag_do,
                         state.pyndow, None, None, None)
events.register_callback(xproto.ButtonReleaseEvent, grab.drag_end,
                         state.pyndow, None, None, None)

state.root_focus()

while True:
    event.read(state.conn, block=True)
    for e in event.queue():
        events.dispatch(e)

    events.run_latent()

    state.conn.flush()

    if state.die:
        break

misc.spawn('killall Xephyr')
コード例 #7
0
 def activate(self):
     state.root_focus()