fix the trouble with glowbrush when Window hide/show

this fixes #839