resize logic for InternalWindow