예제 #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
 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
 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()