The book said when you look at object close to you, the eye muscles contract and vice versa. I wonder what will be the status of the eye muscles when I stare at distance view (such as a mountain) inside an office through a glass wall. The mountain is far away but the glass wall is close to us. In this case, does the eye muscles relax?
In the situation you describe, the eye would be focused on the distant mountain. This would mean that the lens would be stretched and thin in order to minimize the focussing power of the eye. Therefore the ciliary muscles would be contracted rather than relaxed.
When you are looking out of the window, it is possible to make a conscious decision to focus on the window pane itself (thus adjusting the focus to be more powerful as the ciliary muscles relax), however then the distant object will be out of focus and uncomfortable to look at.
This is because the light rays reflecting from the mountain are barely affected by the pane of glass, hence its transparency.
To increase long range focus, the ciliary muscle is relaxed so that the zonular fibres flatten the lens. This flattening increases the focal distance and far away objects appear sharp. The process is reversed when increasing short range focus.
In your example you are watching out of the window into distance. To see the mountains sharp you need to increase range focus and this means relaxing the ciliary muscle. This is also the reason why it is recreative for your eyes to watch into the distance after hours of computer work for example. The window itself does not play any role because your focus is not on the window pane but somewhere in the distance.