The window shown here is EMBEDDED (lower than the roofline) in the roof framing - and is LIKELY to trap water, leak, and promote rot/fungal growths/insects.
Roof sheathing (the plywood / OSB / Boards which are under the shingles) can sometimes warp, expand, sag or bow, or curl when Heat and/or Moisture build up underneath - or if not properly fastened or spaced (typically a 1/8" gap is required between sheets of OSB or Plywood to allow for expansion) Often this is a resullt of poor, missing or non-functioning attic ventilation. This is a more common issue than most people realize - as the 1/8" gap is very often missing between the sheathing.
Missing flashings and open gaps (see the multiple white caulk "patches on the upper left) can allow in water and cause leaks and related damage. The sheathing and some rafters showed stains and damage on the interior attic under this open gap.