Just tried this and it worlks a treat. Don't use masking take on the glass, use vaseline on the glass to act as a paint barrier. Work in well with a finger, smearing the vaseline a good half inch from the window frame. Don't get the vaseline on the woodwork itself. Now you can paint all the tricky inner edges. When the paint is dry wash the glass thoroughly with warm water and detergent using a soft scourer. Result - neatly painted windows with shining glass!