Roof leaks can be VERY DECEPTIVE! Water in one place could be coming from a hole in the roofing 20 feet away. The water can get in through a break in the shingles and then run along the wood until it finds a place to drip through. You may try doing some "detective work" before you go replacing a window or putting on a new roof. Have you looked in the attic while it's raining to see what you find? Can you spray water on the window while it's NOT raining and see if it leaks? How old is your roof? And the window?