If you open the door and try 'locking' the door whilst open you will know if it does 'lock' then there is not a fault with the actual lock mechanism and adjustment is only required either on the hinges or if the door has 'dropped' then the glass needs re-packing (Toe & heeling).
If it still doesnt lock in the open position then you probably need to buy a new lock mechanism.
Mike at Agree-a-price frames
September 2010