def _move_focus(pymux, cli, get_x, get_y):
    """ Move focus of the active window. """
    window = pymux.arrangement.get_active_window(cli)
    try:
        write_pos = pymux.layout_manager.pane_write_positions[window.
            active_pane]
    except KeyError:
        pass
    else:
        x = get_x(write_pos)
        y = get_y(write_pos)
        for pane, wp in pymux.layout_manager.pane_write_positions.items():
            if (wp.xpos <= x < wp.xpos + wp.width and wp.ypos <= y < wp.
                ypos + wp.height):
                window.active_pane = pane
                return
