I'm off - but in answer, I'd sand the window frame , see if the discolouration reduces. If yes, consider sanding more. If you're varnishing then go with a matt not a gloss. There is no primer for varnish, but you'd put on multiple light thin coats, sanding lightly between them.
If you're painting, I'd put on a suitable primer.