Fixing thread issue when switching screen resolution

in the usual quick and dirty way