It depends on whether your GM thinks you target somebody when you move hex
In Chapter 10: Spellcasting there is the "A Clear Path to the Target" section, which states:
To target something, you must have a clear path to it, so it can't be behind total cover. [...]
This applies to all instances of a spell targeting somebody - but does moving hex to a new creature actually target them?
Furthermore the section on "Total Cover" states:
A target with total cover can't be targeted directly by an attack or a spell, although some spells can reach such a target by including it in an area of effect. A target has total cover if it is completely concealed by an obstacle.
If somebody is behind a window, and thus has total cover, they cannot be targeted by a spell. We run into the same question, does hex target somebody when you move it to a new creature?
The follow Q/A discusses this in relation to the Sorcerer's Twinned Spell Metamagic:
And this Q/A discusses what count as spell targets in general:
There is plenty of debate as to what counts as a target. There's a reason Twinned Spell is asked about so frequently here and it's because what counts as a target for a spell is not particularly clear. Plenty of people disagree so you're going to have to ask your GM whether hex targets somebody when you move it. If it does, then a window will stop it.
What this GM would rule
I would say that hex targets somebody when you move it. You are actively choosing to affect a creature with the spell and for me that it sufficient to conclude that you are targeting them.