windowPreview: Ensure scaling is limited to defined size increase
The preview was getting scaled up by a factor based on what is needed to increase the width by activeExtraSize pixels. With windows that are wider than than they are tall, this means that the size of the window will not increase any more than activeExtraSize in any direction, but for windows that are taller than they are wide, the vertical scaling can exceed this. This would break some of the assumptions in the reported size for the preview chrome and could for very narrow windows result in a rather large scale.
To fix this, calculate the scaling factor based on whatever is larger, the height or the width.