Ejemplo n.º 1
0
def event_map_window(event):
    debug("map request: %r\n" % event.__dict__)
    wk = current_workspace()
    cl = wk.get_client(event.window)
    if cl is None:
        need_configure = False
        ignored, cls = ignored_client(event.window)
        if ignored:
            if cls == "QuakeConsole":
                runtime.quake_console = event.window
                quakeconsole_show()
                return
            else:
                gmx = runtime.con.core.GetGeometry(event.window).reply()
                if gmx.border_width == 0:
                    gmx.x -= 1
                    gmx.y -= 1
                    need_configure = True
                geo = Geometry(gmx.x, gmx.y, gmx.width, gmx.height, 1)
        else:
            geo = None

        cl = Client(runtime.con, event.window, event.parent, wk, geo, ignored)
        runtime.clients[cl.id] = cl
        wk.add(cl)

        if need_configure:
            cl.real_configure_notify()
            cl.stack_above()

    wk.map(cl)
    current_workspace().update_focus(cl)
Ejemplo n.º 2
0
def event_configure_window_request(event):
    wk = current_workspace()
    cl = wk.get_client(event.window)
    if cl is None:
        vanilla_configure_window_request(event)
    else:
        cl.configure(event)
Ejemplo n.º 3
0
def event_enter_notify(event):
    debug("enter notify 0x%x: %r\n" % (event.event, event.__dict__))

    cl = runtime.clients.get(event.event)
    if cl is None:
        return

    if runtime.ignore_next_enter_notify:
        runtime.ignore_next_enter_notify = False
        debug("** ignored **\n")
        return

    if not set_current_screen_from(cl.workspace.screen):
        debug("no screen for client 0x%x on workspace %s\n" % (cl.id, cl.workspace.name))
        return

    current_workspace().update_focus(cl, True)
Ejemplo n.º 4
0
def event_destroy_notify(event):
    wk = current_workspace()
    cl = wk.get_client(event.window)
    if cl is not None:
        debug("destroy client %d\n" % event.window)
        if cl.tiled:
            wk.untile(cl)
        wk.remove(cl)
        runtime.clients.__delitem__(cl.id)
    elif event.window == runtime.quake_console:
        runtime.quake_console = None
        runtime.quake_console_toggle = False
Ejemplo n.º 5
0
    def release(self, event):
        debug("button release 0x%x: %r\n" % (event.child, event.__dict__))
        set_current_screen_at(Geometry(event.root_x, event.root_y))

        if self._acting is None:
            return

        owk = self._c.workspace
        nwk = current_workspace()
        if nwk != owk and self._c.located_into(nwk):
            owk.detach(self._c)
            nwk.attach(self._c)

        if self._c.tiled:
            self._c.stack_below()

        self._acting = None
Ejemplo n.º 6
0
    def press(self, event):
        debug("button press 0x%x: %r\n" % (event.child, event.__dict__))
        if self._acting is not None or event.child == 0:
            return

        wk = current_workspace()
        self._c = wk.get_client(event.child)
        if self._c is None:
            return

        self._c.stack_above()
        self._acting = self._bindings[event.detail][event.state]
        self._x = event.root_x
        self._y = event.root_y

        if self._x - wk.screen.x < self._c.geo_virt.x+(2*self._c.geo_virt.b+self._c.geo_virt.w)/2:
            self._left = True
        else:
            self._left = False

        if self._y - wk.screen.y < self._c.geo_virt.y+(2*self._c.geo_virt.b+self._c.geo_virt.h)/2:
            self._up = True
        else:
            self._up = False