Thanks for all the earlier advice. Here is an update:
A guy from the window company visited to fix the leak. He said that the inverted cap wasn't helping, but the main cause was the drainage holes inside the frame, which had been drilled too high (as shown in the pic below). He fixed it by...