def load_layout(vehname):
    '''load window layout'''
    global display_size
    global window_list
    global loaded_layout
    global pending_load
    global vehiclename
    if display_size is None:
        pending_load = True
        return
    vehiclename = vehname
    fname = layout_filename(True)
    if fname is None:
        print("No file to load layout from")
        return
    try:
        layout = pickle.load(open(fname,"rb"))
    except Exception:
        layout = {}
        print("Unable to load %s" % fname)
        loaded_layout = layout
        return
    count = 0
    for name in window_list:
        if name in layout:
            try:
                window_list[name].callback(layout[name])
                count += 1
            except Exception as ex:
                print(ex)
    loaded_layout = layout
    print("Loaded layout for %u windows" % count)
load window layout