Add logic to resize source window based on view size