add more control over window bounds tweak for allowing more margin