Beispiel #1
0
    def reload_active(active=None, force=False):
        if not active:
            activeid = PROBE.get_active_window_id()
        else:
            activeid = active.id

        # Check to make sure we need to probe for anything...
        if not force and activeid and State._DESKTOP and State._DESKTOP._VIEWPORT and State._DESKTOP._VIEWPORT._SCREEN:
            current = State._DESKTOP._VIEWPORT._SCREEN.get_active()
            if current and current.id == activeid:
                return

        State._DESKTOP = State.get_desktops()[PROBE.get_desktop()]

        if not activeid:
            if not State._DESKTOP._VIEWPORT:
                State._DESKTOP._VIEWPORT = State._DESKTOP.viewports[0]

            if not State._DESKTOP._VIEWPORT._SCREEN:
                State._DESKTOP._VIEWPORT._SCREEN = State._DESKTOP._VIEWPORT.screens[
                    0]
        else:
            for viewport in State._DESKTOP.viewports.values():
                for screen in viewport.screens.values():
                    if activeid in screen.windows:
                        State._DESKTOP._VIEWPORT = viewport
                        State._DESKTOP._VIEWPORT._SCREEN = screen
                        State._DESKTOP._VIEWPORT._SCREEN.set_active(
                            screen.windows[activeid])
                        break
Beispiel #2
0
 def reload_active(active = None, force = False):
     if not active: 
         activeid = PROBE.get_active_window_id()
     else:
         activeid = active.id
         
     # Check to make sure we need to probe for anything...
     if not force and activeid and State._DESKTOP and State._DESKTOP._VIEWPORT and State._DESKTOP._VIEWPORT._SCREEN:
         current = State._DESKTOP._VIEWPORT._SCREEN.get_active()
         if current and current.id == activeid:
             return
         
     State._DESKTOP = State.get_desktops()[PROBE.get_desktop()]        
             
     if not activeid:
         if not State._DESKTOP._VIEWPORT:
             State._DESKTOP._VIEWPORT = State._DESKTOP.viewports[0]
             
         if not State._DESKTOP._VIEWPORT._SCREEN:
             State._DESKTOP._VIEWPORT._SCREEN = State._DESKTOP._VIEWPORT.screens[0]
     else:
         for viewport in State._DESKTOP.viewports.values():
             for screen in viewport.screens.values():
                 if activeid in screen.windows:
                     State._DESKTOP._VIEWPORT = viewport
                     State._DESKTOP._VIEWPORT._SCREEN = screen
                     State._DESKTOP._VIEWPORT._SCREEN.set_active(screen.windows[activeid])
                     break