MultiWindowed App Support

Fix to work fine in an already multi windowed application.