Fix for case when dialog width / height is bigger than screen
resolution.