Exemplo n.º 1
0
 def refresh_desktops():
     for desk in PROBE.get_desktops().values():
         if desk['id'] in State.get_desktops():
             desktop = State.get_desktops()[desk['id']]
             desktop.update_attributes(desk)
             for viewport in desktop.viewports.values():
                 for screen in viewport.screens.values():
                     screen.needs_tiling()
Exemplo n.º 2
0
 def refresh_desktops():
     for desk in PROBE.get_desktops().values():
         if desk['id'] in State.get_desktops():
             desktop = State.get_desktops()[desk['id']]
             desktop.update_attributes(desk)
             for viewport in desktop.viewports.values():
                 for screen in viewport.screens.values():
                     screen.needs_tiling()
Exemplo n.º 3
0
    def load_window(window_id):
        attrs = PROBE.get_window_by_id(window_id)
        if not attrs['popup'] and attrs['desktop'] in State.get_desktops():
            for viewport in State.get_desktops()[attrs['desktop']].viewports.values():
                if viewport.is_on_viewport(attrs['x'], attrs['y']):
                    for screen in viewport.screens.values():
                        if screen.is_on_screen(attrs['x'], attrs['y']):
                            win = Window(screen, attrs)
                            if not win.filtered():
                                screen.add_window(win)
                                screen.needs_tiling()

                                if win.id == PROBE.get_active_window_id():
                                    win.activate()
Exemplo n.º 4
0
    def load_window(window_id):
        attrs = PROBE.get_window_by_id(window_id)
        if not attrs['popup'] and attrs['desktop'] in State.get_desktops():
            for viewport in State.get_desktops()[
                    attrs['desktop']].viewports.values():
                if viewport.is_on_viewport(attrs['x'], attrs['y']):
                    for screen in viewport.screens.values():
                        if screen.is_on_screen(attrs['x'], attrs['y']):
                            win = Window(screen, attrs)
                            if not win.filtered():
                                screen.add_window(win)
                                screen.needs_tiling()

                                if win.id == PROBE.get_active_window_id():
                                    win.activate()
Exemplo n.º 5
0
 def reload_desktops():
     # initialize all desktops and their associated windows
     for desktop in State.get_desktops().values():
         for viewport in desktop.viewports.values():
             for screen in viewport.screens.values():
                 desk_or_view = desktop.id
                 if PROBE.is_compiz():
                     desk_or_view = viewport.id
                     
                 screen.set_tiler(Config.tilers(Config.tiling(screen.id, desk_or_view)))
                 screen.needs_tiling()
Exemplo n.º 6
0
    def reload_desktops():
        # initialize all desktops and their associated windows
        for desktop in State.get_desktops().values():
            for viewport in desktop.viewports.values():
                for screen in viewport.screens.values():
                    desk_or_view = desktop.id
                    if PROBE.is_compiz():
                        desk_or_view = viewport.id

                    screen.set_tiler(
                        Config.tilers(Config.tiling(screen.id, desk_or_view)))
                    screen.needs_tiling()
Exemplo n.º 7
0
    def refresh(self):
        oldscreen = self.screen
        oldviewport = oldscreen.viewport
        olddesk = oldviewport.desktop
        oldstate = self.hidden
        update = PROBE.get_window(self.xobj)

        # So this is a little bit weird- we're updating the window, but while
        # we care about it's new x,y (screen change?), we don't care about it's
        # new width and height. We're tiling, so we're in complete control of
        # width and height. (The key here is that x/y *completely* determines
        # which screen the window is on.) Therefore, we don't update them- but
        # why? It would seem harmless, except that some windows (like terminals,
        # text editors, etc) set width_inc/height_inc hints which standards
        # compliant window managers honor- like OpenBox. Therefore, the WM could
        # be resizing the width/height of a given window slightly differently than
        # what PyTyle thinks it's at. This causes the width/height to change slightly
        # on each window update, and has a cascading effect that mangles the
        # window's size. YUCK. (And these width_inc/height_inc hints seemingly
        # cannot be reset.)
        update['width'] = self.width
        update['height'] = self.height
        self.update_attributes(update)

        if olddesk.id != self.desktop or not oldviewport.is_on_viewport(
                update['x'], update['y']) or not oldscreen.is_on_screen(
                    update['x'], update['y']):
            for viewport in State.get_desktops()[
                    self.desktop].viewports.values():
                if viewport.is_on_viewport(update['x'], update['y']):
                    for screen in viewport.screens.values():
                        if screen.is_on_screen(update['x'], update['y']):
                            oldscreen.delete_window(self)
                            screen.add_window(self)
                            screen.needs_tiling()
                            oldscreen.needs_tiling()
                            self.screen = screen
        elif oldstate != self.hidden:
            self.screen.needs_tiling()

        # If it's the active window, then make sure PyTyle knows that. We don't
        # want to set input focus (well, it should already have it if X tells us
        # it's the active window) because it will generate another window change
        # event, and we end up in a positive feedback loop. Yuck.
        if self.id == PROBE.get_active_window_id():
            State.reload_active()
Exemplo n.º 8
0
    def refresh(self):
        oldscreen = self.screen
        oldviewport = oldscreen.viewport
        olddesk = oldviewport.desktop
        oldstate = self.hidden
        update = PROBE.get_window(self.xobj)

        # So this is a little bit weird- we're updating the window, but while
        # we care about it's new x,y (screen change?), we don't care about it's
        # new width and height. We're tiling, so we're in complete control of
        # width and height. (The key here is that x/y *completely* determines
        # which screen the window is on.) Therefore, we don't update them- but
        # why? It would seem harmless, except that some windows (like terminals,
        # text editors, etc) set width_inc/height_inc hints which standards
        # compliant window managers honor- like OpenBox. Therefore, the WM could
        # be resizing the width/height of a given window slightly differently than
        # what PyTyle thinks it's at. This causes the width/height to change slightly
        # on each window update, and has a cascading effect that mangles the
        # window's size. YUCK. (And these width_inc/height_inc hints seemingly
        # cannot be reset.)
        update['width'] = self.width
        update['height'] = self.height
        self.update_attributes(update)

        if olddesk.id != self.desktop or not oldviewport.is_on_viewport(update['x'], update['y']) or not oldscreen.is_on_screen(update['x'], update['y']):
            for viewport in State.get_desktops()[self.desktop].viewports.values():
                if viewport.is_on_viewport(update['x'], update['y']):
                    for screen in viewport.screens.values():
                        if screen.is_on_screen(update['x'], update['y']):
                            oldscreen.delete_window(self)
                            screen.add_window(self)
                            screen.needs_tiling()
                            oldscreen.needs_tiling()
                            self.screen = screen
        elif oldstate != self.hidden:
            self.screen.needs_tiling()

        # If it's the active window, then make sure PyTyle knows that. We don't
        # want to set input focus (well, it should already have it if X tells us
        # it's the active window) because it will generate another window change
        # event, and we end up in a positive feedback loop. Yuck.
        if self.id == PROBE.get_active_window_id():
            State.reload_active()