示例#1
0
文件: state.py 项目: Excedrin/pytyle2
def update_NET_DESKTOP_GEOMETRY(force=False):
    global properties, xinerama

    old_geom = properties["_NET_DESKTOP_GEOMETRY"]
    old_xinerama = xinerama

    time.sleep(1)

    properties["_NET_DESKTOP_GEOMETRY"] = ptxcb.XROOT.get_desktop_geometry()
    xinerama = ptxcb.connection.xinerama_get_screens()

    if old_xinerama != xinerama or force:
        if not force and len(old_xinerama) == len(xinerama):
            for mon in Workspace.iter_all_monitors():
                mid = mon.id
                mon.refresh_bounds(
                    xinerama[mid]["x"], xinerama[mid]["y"], xinerama[mid]["width"], xinerama[mid]["height"]
                )
                mon.calculate_workarea()
        else:
            for mon in Workspace.iter_all_monitors():
                for tiler in mon.tilers:
                    tiler.destroy()

            for wid in Window.WINDOWS.keys():
                Window.remove(wid)

            for wsid in Workspace.WORKSPACES.keys():
                Monitor.remove(wsid)
                Workspace.remove(wsid)

            reset_properties()
            load_properties()
示例#2
0
文件: state.py 项目: Excedrin/pytyle2
def update_NET_WORKAREA():
    global properties

    properties["_NET_WORKAREA"] = ptxcb.XROOT.get_workarea()

    for mon in Workspace.iter_all_monitors():
        mon.calculate_workarea()
示例#3
0
文件: state.py 项目: Excedrin/pytyle2
def apply_config():
    Command.init()

    for mon in Workspace.iter_all_monitors():
        if config.get_option("tile_on_startup", mon.workspace.id, mon.id):
            mon.tile(force_tiling=True)